diff --git a/content/posts/_index.md b/content/posts/_index.md index 1c67892..b1f2702 100644 --- a/content/posts/_index.md +++ b/content/posts/_index.md @@ -1,8 +1,8 @@ +++ title = "Example posts" sort_by = "date" -template = "post.html" -page_template = "section.html" +template = "posts.html" +page_template = "post.html" +++ Here are some example posts. The posts are grouped by year. diff --git a/templates/post.html b/templates/post.html index 00c7ada..a71a984 100644 --- a/templates/post.html +++ b/templates/post.html @@ -1,29 +1,33 @@ -{% extends "base.html" %} {% block content %} -

{{ section.title }}

-
{{ section.content | safe }}
+{% extends "base.html" %} +{% block content %} -{% for year, posts in section.pages | group_by(attribute="year") %} - -{% endfor %} {% endblock content %} + +
+

{{ page.title }} {% if page.draft %}Draft{% endif %}

+
+ + {{ hooks::above_page(page=page) }} +
{{ page.content | safe }}
+ + + {{ hooks::below_page(page=page) }} + {% if page.taxonomies is containing ("tags") %} + + {% endif %} + + {{ hooks::below_tags(page=page) }} + +{% endblock content %} diff --git a/templates/posts.html b/templates/posts.html new file mode 100644 index 0000000..00c7ada --- /dev/null +++ b/templates/posts.html @@ -0,0 +1,29 @@ +{% extends "base.html" %} {% block content %} +

{{ section.title }}

+ +
{{ section.content | safe }}
+ +{% for year, posts in section.pages | group_by(attribute="year") %} + +{% endfor %} {% endblock content %} diff --git a/templates/section.html b/templates/section.html deleted file mode 100644 index a71a984..0000000 --- a/templates/section.html +++ /dev/null @@ -1,33 +0,0 @@ - -{% extends "base.html" %} -{% block content %} - -
-
-
-
- {{ page.date | date(format='%d')}} - {{ page.date | date(format='%b %y')}} -
-
- -
-

{{ page.title }} {% if page.draft %}Draft{% endif %}

-
-
- {{ hooks::above_page(page=page) }} -
{{ page.content | safe }}
- - - {{ hooks::below_page(page=page) }} - {% if page.taxonomies is containing ("tags") %} - - {% endif %} - - {{ hooks::below_tags(page=page) }} -
-{% endblock content %}