Browse Source

fix page.html template

It currently looks that the name page.html is hardcoded, so it has to be
the one that is for the post (the end of the template extending chain).
master
Peter Babič 3 months ago
parent
commit
3055515035
  1. 2
      content/pages/about.md
  2. 2
      content/pages/legal.md
  3. 12
      templates/info.html
  4. 39
      templates/page.html
  5. 29
      templates/post.html

2
content/pages/about.md

@ -1,6 +1,6 @@
+++
title = "About me"
template = "page.html"
template = "info.html"
path = "about"
+++

2
content/pages/legal.md

@ -1,6 +1,6 @@
+++
title = "Imprint & Privacy Policy"
template = "page.html"
template = "info.html"
path = "legal"
+++

12
templates/info.html

@ -0,0 +1,12 @@
{% extends "index.html" %}
{% block content %}
<article class="post-single">
<header class="post-header">
<h1 class="post-title">{{ page.title }}</h1>
{% block meta %}{% endblock meta %}
</header>
<div class="post-content">{{ page.content | safe }}</div>
{% block footer %}{% endblock footer %}
</article>
{% endblock content %}

39
templates/page.html

@ -1,12 +1,29 @@
{% extends "index.html" %}
{% extends "info.html" %}
{% block content %}
<article class="post-single">
<header class="post-header">
<h1 class="post-title">{{ page.title }}</h1>
{% block meta %}{% endblock meta %}
</header>
<div class="post-content">{{ page.content | safe }}</div>
{% block footer %}{% endblock footer %}
</article>
{% endblock content %}
{% block meta %}
<div class="post-meta">
{% if config.extra.author_url %}
Author: <a class="post-author" href="{{ config.extra.author_url | safe }}">
{{ config.extra.author }}
</a>
{% else %}<span class="post-author">
Author: {{ config.extra.author }}
</span>{% endif %}
<br/>
<span class="post-date">Published: <time>{{ page.date | date(format="%B %e, %Y") }}</time></span>
<span>&middot;</span>
<span class="post-reading-time">{{ page.reading_time }} min read</span>
</div>
{% endblock meta %}
{% block footer %}
<footer class="post-footer">
{% if page.taxonomies.tags %}
<ul class="post-tags">
{% for tag in page.taxonomies.tags %}
<li><a href="{{ get_taxonomy_url(kind="tags", name=tag) | safe }}">{{ tag }}</a></li>
{% endfor %}
</ul>
{% endif %}
</footer>
{% endblock footer %}

29
templates/post.html

@ -1,29 +0,0 @@
{% extends "page.html" %}
{% block meta %}
<div class="post-meta">
{% if config.extra.author_url %}
Author: <a class="post-author" href="{{ config.extra.author_url | safe }}">
{{ config.extra.author }}
</a>
{% else %}<span class="post-author">
Author: {{ config.extra.author }}
</span>{% endif %}
<br/>
<span class="post-date">Published: <time>{{ page.date | date(format="%B %e, %Y") }}</time></span>
<span>&middot;</span>
<span class="post-reading-time">{{ page.reading_time }} min read</span>
</div>
{% endblock meta %}
{% block footer %}
<footer class="post-footer">
{% if page.taxonomies.tags %}
<ul class="post-tags">
{% for tag in page.taxonomies.tags %}
<li><a href="{{ get_taxonomy_url(kind="tags", name=tag) | safe }}">{{ tag }}</a></li>
{% endfor %}
</ul>
{% endif %}
</footer>
{% endblock footer %}
Loading…
Cancel
Save