rename templates

This commit is contained in:
jimmyff 2023-02-01 18:29:21 +00:00
parent c6523a8bc3
commit 34b7292813
4 changed files with 60 additions and 60 deletions

View file

@ -1,8 +1,8 @@
+++ +++
title = "Example posts" title = "Example posts"
sort_by = "date" sort_by = "date"
template = "post.html" template = "posts.html"
page_template = "section.html" page_template = "post.html"
+++ +++
Here are some example posts. The posts are grouped by year. Here are some example posts. The posts are grouped by year.

View file

@ -1,29 +1,33 @@
{% extends "base.html" %} {% block content %}
<h1 class="title">{{ section.title }}</h1>
<article>{{ section.content | safe }}</article> {% extends "base.html" %}
{% block content %}
{% for year, posts in section.pages | group_by(attribute="year") %} <section class="post">
<ul class="posts flat">
<h2 class="archive-year">{{ year }}</h2>
{% for post in posts %}
<li class="post">
<div class="post-header"> <div class="post-header">
<div class="meta"> <div class="meta">
<div class="date"> <div class="date">
<span class="day">{{ post.day }}</span> <span class="day">{{ page.date | date(format='%d')}}</span>
<span class="rest">{{ post.date | date(format='%b') }}</span> <span class="rest">{{ page.date | date(format='%b %y')}}</span>
</div> </div>
</div> </div>
<div class="matter"> <div class="matter">
<h4 class="title small"> <h1 class="title">{{ page.title }} {% if page.draft %}<span class="draft">Draft</span>{% endif %}</h1>
<a href="{{ post.permalink | safe }}">{{ post.title }}</a>
{% if post.draft %}<span class="draft">Draft</span>{% endif %}
</h4>
<span class="description"> {{post.description}} </span>
</div> </div>
</div> </div>
</li> {{ hooks::above_page(page=page) }}
<article>{{ page.content | safe }}</article>
{{ hooks::below_page(page=page) }}
{% if page.taxonomies is containing ("tags") %}
<ul class="tags">
{% for tag in page.taxonomies["tags"] %}
<li><a href='/tags/{{ tag | slugify }}'>{{ tag }}</a></li>
{% endfor %} {% endfor %}
</ul> </ul>
{% endfor %} {% endblock content %} {% endif %}
{{ hooks::below_tags(page=page) }}
</section>
{% endblock content %}

29
templates/posts.html Normal file
View file

@ -0,0 +1,29 @@
{% extends "base.html" %} {% block content %}
<h1 class="title">{{ section.title }}</h1>
<article>{{ section.content | safe }}</article>
{% for year, posts in section.pages | group_by(attribute="year") %}
<ul class="posts flat">
<h2 class="archive-year">{{ year }}</h2>
{% for post in posts %}
<li class="post">
<div class="post-header">
<div class="meta">
<div class="date">
<span class="day">{{ post.day }}</span>
<span class="rest">{{ post.date | date(format='%b') }}</span>
</div>
</div>
<div class="matter">
<h4 class="title small">
<a href="{{ post.permalink | safe }}">{{ post.title }}</a>
{% if post.draft %}<span class="draft">Draft</span>{% endif %}
</h4>
<span class="description"> {{post.description}} </span>
</div>
</div>
</li>
{% endfor %}
</ul>
{% endfor %} {% endblock content %}

View file

@ -1,33 +0,0 @@
{% extends "base.html" %}
{% block content %}
<section class="post">
<div class="post-header">
<div class="meta">
<div class="date">
<span class="day">{{ page.date | date(format='%d')}}</span>
<span class="rest">{{ page.date | date(format='%b %y')}}</span>
</div>
</div>
<div class="matter">
<h1 class="title">{{ page.title }} {% if page.draft %}<span class="draft">Draft</span>{% endif %}</h1>
</div>
</div>
{{ hooks::above_page(page=page) }}
<article>{{ page.content | safe }}</article>
{{ hooks::below_page(page=page) }}
{% if page.taxonomies is containing ("tags") %}
<ul class="tags">
{% for tag in page.taxonomies["tags"] %}
<li><a href='/tags/{{ tag | slugify }}'>{{ tag }}</a></li>
{% endfor %}
</ul>
{% endif %}
{{ hooks::below_tags(page=page) }}
</section>
{% endblock content %}