feat: Change article list on homepage to be simply date and title
This commit is contained in:
parent
776defa40d
commit
bb4dc4b1a5
4 changed files with 53 additions and 2 deletions
|
|
@ -7,7 +7,6 @@
|
|||
<section class="last-articles">
|
||||
<h1>Derniers articles</h1>
|
||||
{%- set section = get_section(path="articles/_index.md") -%}
|
||||
{%- set max_articles = 3 -%}
|
||||
{%- include "partials/articles.html" -%}
|
||||
{%- include "partials/articles-index.html" -%}
|
||||
</section>
|
||||
{% endblock content %}
|
||||
14
templates/partials/articles-index.html
Normal file
14
templates/partials/articles-index.html
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<ul class="articles-index">
|
||||
{% for page in section.pages %}
|
||||
{%- if max_articles is defined and loop.index > max_articles -%}{%- break -%}{%- endif -%}
|
||||
<li>
|
||||
<span class="date">
|
||||
<meta itemprop="datePublished" content="{{ page.date | date(format='%+') }}">
|
||||
{{ page.date | date(format='%Y-%m-%d') }}
|
||||
</span>
|
||||
<span class="title">
|
||||
<a href="{{ page.permalink }}">{{ page.title }}</a>
|
||||
</span>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
Loading…
Add table
Add a link
Reference in a new issue