From aa39dc791aa8f59e9cee940f5445bf265709d304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corentin=20S=C3=A9chet?= Date: Tue, 21 May 2024 01:15:42 +0200 Subject: [PATCH] feat: use content to generate news section (#6) --- content/news/2024-21-05-test-news.md | 15 ++++++++ src/pages/index/news.html | 23 ++++++++++++ src/pages/index/page.html | 53 +--------------------------- 3 files changed, 39 insertions(+), 52 deletions(-) create mode 100644 content/news/2024-21-05-test-news.md create mode 100644 src/pages/index/news.html diff --git a/content/news/2024-21-05-test-news.md b/content/news/2024-21-05-test-news.md new file mode 100644 index 0000000..49a6221 --- /dev/null +++ b/content/news/2024-21-05-test-news.md @@ -0,0 +1,15 @@ +--- +title: This is a long news title to test how it presents on little resolutions +--- + +Here we specialize in creating bite-sized adventures that anyone can pick up +and play, but only the true gaming aficionados can conquer. Think of us as the +David to the Goliaths of the gaming industry. Our games might be small, but +they will keep you coming back for more. Now, you might be wondering, how on +earth do two people manage to steer the ship in this vast ocean of pixels? +Well, let me tell you, it's all about that sweet, sweet collective +decision-making magic. We're like yin and yang, balancing each other's quirks +and strengths as we navigate the treacherous waters of game development. + +**markdown here too** + diff --git a/src/pages/index/news.html b/src/pages/index/news.html new file mode 100644 index 0000000..2b720f4 --- /dev/null +++ b/src/pages/index/news.html @@ -0,0 +1,23 @@ +{% set title = "News" %} +{% set title_image = "/img/section-news.png" %} + +{% extends "lib/section.html.j2" %} + +{% block content %} + {% with content = site.content.load("news") %} + {% for news in content.glob("*.md") %} +
+
+

{{ news.meta.title }}

+ {% with creation_date = news | git_creation_date %} +
{{ creation_date.strftime('%d/%m/%Y') }}
+ {% endwith %} +
+
+ {{ news.html }} +
+
+ + {% endfor %} + {% endwith %} +{% endblock %} diff --git a/src/pages/index/page.html b/src/pages/index/page.html index 726c70d..9221182 100644 --- a/src/pages/index/page.html +++ b/src/pages/index/page.html @@ -54,60 +54,9 @@ {% include "pages/index/games.html" %} + {% include "pages/index/news.html" %} -
-

- News -

-
-
-
-

This is a long news title to test how it presents on little resolutions

-
- 02/05/2024 -
-
-
- Here we specialize in creating bite-sized adventures that anyone - can pick up and play, but only the true gaming aficionados can - conquer. Think of us as the David to the Goliaths of the gaming - industry. Our games might be small, but they will keep you coming - back for more. Now, you might be wondering, how on earth do two - people manage to steer the ship in this vast ocean of pixels? Well, - let me tell you, it's all about that sweet, sweet collective - decision-making magic. We're like yin and yang, balancing each - other's quirks and strengths as we navigate the treacherous waters - of game development. -
-
-
-
-

This is a long news title to test how it presents on little resolutions

-
- 02/05/2024 -
-
-
- Here we specialize in creating bite-sized adventures that anyone - can pick up and play, but only the true gaming aficionados can - conquer. Think of us as the David to the Goliaths of the gaming - industry. Our games might be small, but they will keep you coming - back for more. Now, you might be wondering, how on earth do two - people manage to steer the ship in this vast ocean of pixels? Well, - let me tell you, it's all about that sweet, sweet collective - decision-making magic. We're like yin and yang, balancing each - other's quirks and strengths as we navigate the treacherous waters - of game development. -
-
-
-