feat: created basic blog layout
This commit is contained in:
parent
42fd071301
commit
0d41db36ef
13 changed files with 935 additions and 3 deletions
30
_includes/post.njk
Normal file
30
_includes/post.njk
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
---
|
||||
layout: base.njk
|
||||
---
|
||||
|
||||
<article class="blog-post">
|
||||
<header class="post-header">
|
||||
<h1>{{ title }}</h1>
|
||||
<time datetime="{{ createdAt | dateFormat }}">{{ createdAt | dateFormat }}</time>
|
||||
{% if updatedAt %}
|
||||
<p class="updated-at">Updated: <time datetime="{{ updatedAt | dateFormat }}">{{ updatedAt | dateFormat }}</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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue