refactor: migrate to /blog subdirectory
This commit is contained in:
41
src/_layouts/article.njk
Normal file
41
src/_layouts/article.njk
Normal 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>
|
||||
Reference in New Issue
Block a user