volpe/_includes/post.njk

36 lines
No EOL
1 KiB
Text

---
layout: base.njk
pageType: post
---
<article class="blog-post">
{% if not released %}
<div class="draft-warning-banner">
⚠️ This post is still a draft and may be incomplete or subject to changes.
</div>
{% endif %}
<header class="post-header">
<h1>{{ title }}</h1>
<time class="localizable-time" datetime="{{ createdAt | isoDateTime }}">{{ createdAt | dateTimeFormat }}</time>
{% if updatedAt and (updatedAt | isMoreThanHourAfter(createdAt)) %}
<p class="updated-at">Updated: <time class="localizable-time" datetime="{{ updatedAt | isoDateTime }}">{{ updatedAt | dateTimeFormat }}</time></p>
{% endif %}
</header>
<div class="post-content">
{{ content | safe }}
</div>
{% set postTags = page.inputPath | extractTagsFromFile %}
{% if postTags.length > 0 %}
<section class="post-tags">
<h2>Tags</h2>
<ul class="tag-list">
{% for tag in postTags %}
<li><a href="/tags/{{ tag | lower }}/">#{{ tag }}</a></li>
{% endfor %}
</ul>
</section>
{% endif %}
</article>