diff options
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/macros.html | 17 | ||||
| -rw-r--r-- | templates/now.html | 10 | ||||
| -rw-r--r-- | templates/page.html | 10 |
3 files changed, 28 insertions, 9 deletions
diff --git a/templates/macros.html b/templates/macros.html index b4cb6d0..3922659 100644 --- a/templates/macros.html +++ b/templates/macros.html @@ -26,3 +26,20 @@ {% endfor %} </ul> {% endmacro %} + +{% macro page_h1(page) %} +<h1> + {{ page.title }}<br /> + {% if page.date %} + <small>({{ page.date }})</small> + {% endif %} + {% if page.extra.kind %} + <small>[{{ page.extra.kind }}]</small> + {% endif %} +</h1> +{% endmacro %} + +{% macro page_content(page) %} +{{ self::page_h1(page=page) }} +{{ page.content | replace(from="<!-- toc -->", to=macros::toc(page=page)) | safe }} +{% endmacro %} diff --git a/templates/now.html b/templates/now.html new file mode 100644 index 0000000..9eaa6a6 --- /dev/null +++ b/templates/now.html @@ -0,0 +1,10 @@ +{% extends "base.html" %} +{% import "macros.html" as macros %} + +{% block content %} +{% set posts = get_section(path="posts/_index.md") %} +{% set nows = posts.pages | filter(attribute="extra.kind", value="now") %} +{% set latest_now = nows | sort(attribute="date") | last %} + +{{ macros::page_content(page=latest_now) }} +{% endblock %} diff --git a/templates/page.html b/templates/page.html index 6c288d1..61db175 100644 --- a/templates/page.html +++ b/templates/page.html @@ -2,15 +2,7 @@ {% import "macros.html" as macros %} {% block content %} -<h1> - {{ page.title }}<br /> - {% if page.date %} - <small>({{ page.date }})</small> - {% endif %} - <small>[{{ page.extra.kind }}]</small> -</h1> - -{{ page.content | replace(from="<!-- toc -->", to=macros::toc(page=page)) | safe }} +{{ macros::page_content(page=page) }} <nav class="post-nav" aria-label="Post navigation"> {% if page.higher %} |
