From 0c71f81c78a00c10f3d5c8d42ee5f8067e18d128 Mon Sep 17 00:00:00 2001 From: Alexis Fourmaux Date: Wed, 4 Jun 2025 01:39:48 +0200 Subject: [PATCH] feat: create index and about pages --- content/_index.md | 5 +++++ content/a-propos.md | 6 ++++++ sass/parts/_index.scss | 9 +++++++++ sass/styles.scss | 1 + templates/about.html | 12 ++++++++++++ templates/blog.html | 18 +----------------- templates/index.html | 13 +++++++++---- templates/partials/articles.html | 18 ++++++++++++++++++ 8 files changed, 61 insertions(+), 21 deletions(-) create mode 100644 content/_index.md create mode 100644 content/a-propos.md create mode 100644 sass/parts/_index.scss create mode 100644 templates/about.html create mode 100644 templates/partials/articles.html diff --git a/content/_index.md b/content/_index.md new file mode 100644 index 0000000..14e01bf --- /dev/null +++ b/content/_index.md @@ -0,0 +1,5 @@ ++++ +title = "Accueil" ++++ + +Contenu \ No newline at end of file diff --git a/content/a-propos.md b/content/a-propos.md new file mode 100644 index 0000000..6d61c69 --- /dev/null +++ b/content/a-propos.md @@ -0,0 +1,6 @@ ++++ +title = "À propos" +template = "about.html" ++++ + +A propos de ce site \ No newline at end of file diff --git a/sass/parts/_index.scss b/sass/parts/_index.scss new file mode 100644 index 0000000..1ca5b17 --- /dev/null +++ b/sass/parts/_index.scss @@ -0,0 +1,9 @@ +section.last-articles { + margin-top: 4rem; + + h1 { + border-bottom-width: .1rem; + border-bottom-style: solid; + border-bottom-color: var(--surface0); + } +} \ No newline at end of file diff --git a/sass/styles.scss b/sass/styles.scss index f42cd56..5f0b538 100644 --- a/sass/styles.scss +++ b/sass/styles.scss @@ -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'; diff --git a/templates/about.html b/templates/about.html new file mode 100644 index 0000000..c9ef304 --- /dev/null +++ b/templates/about.html @@ -0,0 +1,12 @@ +{% extends "base.html" %} + +{% block content %} +

+ {{ page.title }} +

+
+
+ {{ page.content | safe }} +
+
+{% endblock content %} \ No newline at end of file diff --git a/templates/blog.html b/templates/blog.html index f09a58e..4030285 100644 --- a/templates/blog.html +++ b/templates/blog.html @@ -4,21 +4,5 @@

{{ section.title }}

- +{%- include "partials/articles.html" -%} {% endblock content %} \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 5b14ef8..42cf49d 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,8 +1,13 @@ {% extends "base.html" %} {% block content %} -

- This is my blog made with Zola. -

-

Posts.

+
+{{ section.content | safe }} +
+
+

Derniers articles

+{%- set section = get_section(path="articles/_index.md") -%} +{%- set max_articles = 3 -%} +{%- include "partials/articles.html" -%} +
{% endblock content %} \ No newline at end of file diff --git a/templates/partials/articles.html b/templates/partials/articles.html new file mode 100644 index 0000000..76387cb --- /dev/null +++ b/templates/partials/articles.html @@ -0,0 +1,18 @@ + \ No newline at end of file