refactor: migrate to /blog subdirectory

This commit is contained in:
2022-11-09 09:45:19 +01:00
parent 1d65e67ca4
commit 782f466ee6
17 changed files with 45 additions and 47 deletions

41
src/_layouts/article.njk Normal file
View File

@@ -0,0 +1,41 @@
---
layout: blog.njk
templateClass: tmpl-post
---
<div class="main-content">
<h1>{{ title }}</h1>
<div class="post-metadata">
<div class="post-metadata__header">
Le <time datetime="{{ page.date | htmlDateString }}">{{ page.date | readableDate }}</time> {{ authors | readableAuthors }}
</div>
<ul>
{%- for tag in tags | filterTagList %}
{%- set tagUrl %}/tags/{{ tag | slugify }}/{% endset %}
<li><a href="{{ tagUrl }}" class="post-tag">#{{ tag }}</a>{%- if not loop.last %} {% endif %}</li>
{%- endfor %}
</ul>
</div>
{{ content | safe }}
<hr>
{%- if collections.articles %}
{# these filters are locale-aware in 2.0.0-canary.14 #}
{%- set previousArticle = collections.articles | getPreviousCollectionItem %}
{%- set nextArticle = collections.articles | getNextCollectionItem %}
{%- if nextArticle or previousArticle %}
<nav class="post-nav">
<ul>
{%- if previousArticle %}<li class="previous">Précédent : <a href="{{ previousArticle.url }}">{{ previousArticle.data.title }}</a></li>{% endif %}
{%- if nextArticle %}<li class="next">Suivant : <a href="{{ nextArticle.url }}">{{ nextArticle.data.title }}</a></li>{% endif %}
</ul>
</nav>
{%- endif %}
{%- endif %}
</div>
<aside class="right-side">
{% include "tagslist.njk" %}
{% include "other_links.njk" %}
</aside>