diff options
author | cel 🌸 <cel@blos.sm> | 2023-06-22 15:35:18 +0100 |
---|---|---|
committer | cel 🌸 <cel@blos.sm> | 2023-06-22 15:35:18 +0100 |
commit | a135acf943ba0fc442dca69f43339921728b1ed4 (patch) | |
tree | 77d8ad93d8064db1f0b71601e8b13b165c787cb9 /templates | |
parent | 139c26158bba4ec09e7ba690ba6c9c11da620707 (diff) | |
download | blossom-a135acf943ba0fc442dca69f43339921728b1ed4.tar.gz blossom-a135acf943ba0fc442dca69f43339921728b1ed4.tar.bz2 blossom-a135acf943ba0fc442dca69f43339921728b1ed4.zip |
implement blog tag filtering
Diffstat (limited to 'templates')
-rw-r--r-- | templates/base.html.tera | 2 | ||||
-rw-r--r-- | templates/blogpost-panel.html.tera | 2 | ||||
-rw-r--r-- | templates/filtertags.html.tera | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/templates/base.html.tera b/templates/base.html.tera index 3874df3..ece268c 100644 --- a/templates/base.html.tera +++ b/templates/base.html.tera @@ -56,7 +56,7 @@ </ul> </nav> - <main class="{% if reverse %}{{ reverse }}{% endif %}"> + <main class="{% if reverse %}reverse{% endif %}"> <div class="main-content"> {% block content %} diff --git a/templates/blogpost-panel.html.tera b/templates/blogpost-panel.html.tera index 061d87b..64f064c 100644 --- a/templates/blogpost-panel.html.tera +++ b/templates/blogpost-panel.html.tera @@ -1,7 +1,7 @@ <div class="panel content blogpost"> <h1 class="title">{{ blogpost.subject }}</h1> <h2 class="created-at">{{ blogpost.created_at }} <a href="/blog/{{ blogpost.data.name }}">permalink</a></h2> - <div class="tags">{% for tag in blogpost.tags %}<a class="tag" href="/tag/{{ tag }}">{{ tag }}</a>{% endfor %}</div> + <div class="tags">{% for tag in blogpost.tags %}<a class="tag {% if filter_hashset %}{% if tag in filter_hashset %}active{% endif %}{% endif %}" href="/blog?filter={{ tag }}">{{ tag }}</a>{% endfor %}</div> <div class="blogpost-content"> {{ blogpost.render }} </div> diff --git a/templates/filtertags.html.tera b/templates/filtertags.html.tera index da001e8..f79ee94 100644 --- a/templates/filtertags.html.tera +++ b/templates/filtertags.html.tera @@ -1,7 +1,7 @@ <div class="panel" id="filter-tags"> -<h2>filter tag</h2> +<h2>filter by tags</h2> <div class="tags"> - {% for tag in tags %}<a href="/blog/tag/{{ tag }}">{{ tag }}</a>{% endfor %} + {% for tag in tags %}<a class="{% if tag in filter_hashset %}active{% endif %}" href="{% if tag in filter_hashset %}/blog{% else %}/blog?filter={{ tag }}{% endif %}">{{ tag }}</a>{% endfor %} </div> <br> </div> |