Skip to content

Commit

Permalink
Remove search page, make posts page have a search
Browse files Browse the repository at this point in the history
  • Loading branch information
gamingrobot committed Dec 22, 2023
1 parent 0a91630 commit 7b9c7dc
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 19 deletions.
2 changes: 1 addition & 1 deletion config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ highlight_theme = "cobalt2"

[extra]
menu = [
{url = "/pages/search", name = "Search"},
{url = "/posts", name = "Posts"},
{url = "/atom.xml", name = "RSS"},
{url = "/pages/about", name = "About"},
]
Expand Down
6 changes: 0 additions & 6 deletions content/pages/search.md

This file was deleted.

3 changes: 3 additions & 0 deletions content/posts/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
+++
title = "Posts"
sort_by = "date"
template = "posts.html"
transparent = true
[extra]
hide_copyright = true
+++
2 changes: 1 addition & 1 deletion themes/hyde-hyde-hyde-zola/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
{% block content %}
{% endblock content %}
{% block copyright %}
{% if not page.extra.hide_copyright %}
{% if not page.extra.hide_copyright and not section.extra.hide_copyright %}
<div class=copyright>&copy; {{ now() | date(format="%Y") }} Morgan Creekmore - <a href=https://creativecommons.org/licenses/by/4.0>CC BY 4.0</a></div>
{% endif %}
{% endblock copyright %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
{% extends "base.html" %}

{% block title %}
{{ page.title }} - {{ config.title }}
{{ section.title }} - {{ config.title }}
{% endblock title %}

{% block metadata %}
<meta content="website" property="og:type"/>
<meta content="{{ config.title }}" property="og:site_name"/>
<meta content="{{ current_url | safe }}" property="og:url"/>
<meta content="{{ current_url | safe }}" property="twitter:url"/>
{% if page.title %}
<meta content="{{ page.title }}" property="og:title"/>
<meta content="{{ page.title }}" property="twitter:title"/>
{% if section.title %}
<meta content="{{ section.title }}" property="og:title"/>
<meta content="{{ section.title }}" property="twitter:title"/>
{% endif %}
{% endblock metadata %}

{% block content %}
<article>
<header>
<h1>{{ page.title }}</h1>
</header>
<div>
<h1 class=section__title>{{ section.title }}</h1>
<div class="search-form">
<input id="search" tabindex="0">
<input id="search" tabindex="0" placeholder="Search">
<ul class="search-results__items">
{% set section = get_section(path="posts/_index.md") %}
{% for page in section.pages %}
<li>
<span class=list__title--small>
Expand All @@ -34,7 +31,7 @@ <h1>{{ page.title }}</h1>
{% endfor %}
</ul>
</div>
</article>
</div>
{% endblock content %}

{% block js_body %}
Expand Down
11 changes: 11 additions & 0 deletions themes/hyde-hyde-hyde-zola/templates/section.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@
{{ section.title }} - {{ config.title }}
{% endblock title %}

{% block metadata %}
<meta content="website" property="og:type"/>
<meta content="{{ config.title }}" property="og:site_name"/>
<meta content="{{ current_url | safe }}" property="og:url"/>
<meta content="{{ current_url | safe }}" property="twitter:url"/>
{% if section.title %}
<meta content="{{ section.title }}" property="og:title"/>
<meta content="{{ section.title }}" property="twitter:title"/>
{% endif %}
{% endblock metadata %}

{% block content %}
<div>
<h1 class=section__title>{{ section.title }}</h1>
Expand Down

0 comments on commit 7b9c7dc

Please sign in to comment.