feat: create index and about pages
This commit is contained in:
parent
cc39ed4c4e
commit
0c71f81c78
8 changed files with 61 additions and 21 deletions
5
content/_index.md
Normal file
5
content/_index.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
+++
|
||||
title = "Accueil"
|
||||
+++
|
||||
|
||||
Contenu
|
||||
6
content/a-propos.md
Normal file
6
content/a-propos.md
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
+++
|
||||
title = "À propos"
|
||||
template = "about.html"
|
||||
+++
|
||||
|
||||
A propos de ce site
|
||||
9
sass/parts/_index.scss
Normal file
9
sass/parts/_index.scss
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
section.last-articles {
|
||||
margin-top: 4rem;
|
||||
|
||||
h1 {
|
||||
border-bottom-width: .1rem;
|
||||
border-bottom-style: solid;
|
||||
border-bottom-color: var(--surface0);
|
||||
}
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
@use 'shortcodes/callout';
|
||||
@use 'parts/anchor';
|
||||
@use 'parts/articles';
|
||||
@use 'parts/index';
|
||||
@use 'parts/code';
|
||||
@use 'parts/footnote';
|
||||
@use 'parts/misc';
|
||||
|
|
|
|||
12
templates/about.html
Normal file
12
templates/about.html
Normal 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 %}
|
||||
|
|
@ -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 %}
|
||||
|
|
@ -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 %}
|
||||
18
templates/partials/articles.html
Normal file
18
templates/partials/articles.html
Normal 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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue