added meta data to page template

This commit is contained in:
Ro 2021-04-26 13:19:47 -07:00
parent 06787aac30
commit f3dfd3411a
2 changed files with 11 additions and 2 deletions

View file

@ -55,13 +55,14 @@ class Render
foreach ($taglist as $tag) { foreach ($taglist as $tag) {
$label = trim($tag); $label = trim($tag);
array_push($tags, [ array_push($tags, [
"tag_name" => $label, "label" => $label . " ",
"slug" => StringTools::safeString($label), "slug" => StringTools::safeString($label),
]); ]);
} }
$meta = [ $meta = [
"who" => $page["author"], "who" => $page["author"],
"when" => $page["updated"], "when" => $page["created"],
"tags" => $tags, "tags" => $tags,
]; ];

View file

@ -13,6 +13,14 @@
<article> <article>
<div class="page"> <div class="page">
<p>{{content | raw}}</p> <p>{{content | raw}}</p>
<div>
{{meta['who']}} dropped this {{ meta['when'] }}<br />
<strong>tags: </strong>
{% for tag in meta['tags'] %}
<a href="{{ "/tags/"~tag.slug~".html" }}">{{ tag.label }}</a>
{% endfor %}
</div>
</div> </div>
</article> </article>
{% endblock %} {% endblock %}