-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement taxonomies using
categories
- Loading branch information
1 parent
8b55853
commit f5e42b1
Showing
6 changed files
with
226 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{% extends "base.html" %} | ||
{% block title %}Categories{% endblock title %} | ||
{% block content %} | ||
<div> | ||
<h1>Categories</h1> | ||
<p><i>All the categories used in posts.</i></p> | ||
<hr /> | ||
<ul> | ||
{% for category in categories | sort %} | ||
{%- set_global cat_posts = 0 -%} | ||
{% for post in posts %} | ||
{% if category in post.categories %} | ||
{%- set_global cat_posts = cat_posts + 1 -%} | ||
{% endif %} | ||
{% endfor %} | ||
<li> | ||
<a href="{{ config.rootUrl }}/categories/{{ category }}">{{ category }}</a> | ||
<span>({{ cat_posts }} post{{ cat_posts | pluralize }})</span> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
{% endblock content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{% extends "base.html" %} | ||
{% block title %}Category: {{ category }}{% endblock title %} | ||
{% block content %} | ||
<div> | ||
<h1>Posts in {{ category }}</h1> | ||
<p><i>All the posts with the category "{{ category }}"</i></p> | ||
<hr /> | ||
<ul> | ||
{% for post in posts %} | ||
{% if category in post.categories %} | ||
<li> | ||
<a href="{{ post.permalink }}">{{ post.title }}</a> | ||
<time>{{ post.created | date(format="%B %e, %Y") }}</time> | ||
</li> | ||
{% endif %} | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
{% endblock content %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters