feat: create index and about pages

This commit is contained in:
Alexis Fourmaux 2025-06-04 01:39:48 +02:00
parent cc39ed4c4e
commit 0c71f81c78
8 changed files with 61 additions and 21 deletions

12
templates/about.html Normal file
View file

@ -0,0 +1,12 @@
{% extends "base.html" %}
{% block content %}
<h1 class="section-title">
{{ page.title }}
</h1>
<article>
<section>
{{ page.content | safe }}
</section>
</article>
{% endblock content %}

View file

@ -4,21 +4,5 @@
<h1 class="section-title">
{{ section.title }}
</h1>
<ul class="articles">
{% for page in section.pages %}
<li>
<h2 class="title">
<a href="{{ page.permalink | safe }}">{{ page.title }}</a>
</h2>
<span class="date">
<meta itemprop="datePublished" content="{{ page.date | date(format='%+') }}">
{{ page.date | date(format='%d %B %Y') }}
</span>
</p class="description">
<span>{{ page.summary | safe }}</span>
<span><a class="read-more" href="{{ page.permalink | safe }}">Lire la suite...</a></span>
</p>
</li>
{% endfor %}
</ul>
{%- include "partials/articles.html" -%}
{% endblock content %}

View file

@ -1,8 +1,13 @@
{% extends "base.html" %}
{% block content %}
<h1 class="title">
This is my blog made with Zola.
</h1>
<p><a href="{{ get_url(path='@/articles/_index.md') }}">Posts</a>.</p>
<section class="intro">
{{ section.content | safe }}
</section>
<section class="last-articles">
<h1>Derniers articles</h1>
{%- set section = get_section(path="articles/_index.md") -%}
{%- set max_articles = 3 -%}
{%- include "partials/articles.html" -%}
</section>
{% endblock content %}

View file

@ -0,0 +1,18 @@
<ul class="articles">
{% for page in section.pages %}
{%- if max_articles is defined and loop.index > max_articles -%}{%- break -%}{%- endif -%}
<li>
<h2 class="title">
<a href="{{ page.permalink }}">{{ page.title }}</a>
</h2>
<span class="date">
<meta itemprop="datePublished" content="{{ page.date | date(format='%+') }}">
{{ page.date | date(format='%d %B %Y') }}
</span>
</p class="description">
<span>{{ page.summary | safe }}</span>
<span><a class="read-more" href="{{ page.permalink }}">Lire la suite...</a></span>
</p>
</li>
{% endfor %}
</ul>