From 0791f417f395e36adc15d7f3b7f5ce8e354e3545 Mon Sep 17 00:00:00 2001 From: Filip Rojek Date: Thu, 3 Oct 2024 02:45:34 +0200 Subject: [PATCH] Core for the posts section --- config.toml | 2 +- content/posts/_index.md | 7 +++++++ content/posts/jellyfin.md | 9 +++++++++ content/posts/nextcloud.md | 9 +++++++++ templates/post.html | 26 ++++++++++++++++++++++++++ templates/post_list.html | 28 ++++++++++++++++++++++++++++ 6 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 content/posts/_index.md create mode 100644 content/posts/jellyfin.md create mode 100644 content/posts/nextcloud.md create mode 100644 templates/post.html create mode 100644 templates/post_list.html diff --git a/config.toml b/config.toml index b15461c..d0b1eb4 100644 --- a/config.toml +++ b/config.toml @@ -19,6 +19,6 @@ nav_items = [ {name="Home", path="/"}, {name="About", path="/about"}, {name="Projects", path="/projects/"}, - #{name="Posts", path="/posts"} + {name="Posts", path="/posts"} ] diff --git a/content/posts/_index.md b/content/posts/_index.md new file mode 100644 index 0000000..2af08ed --- /dev/null +++ b/content/posts/_index.md @@ -0,0 +1,7 @@ ++++ +title = "Posts" +template = "post_list.html" +page_template = "post.html" +sort_by = "date" ++++ + diff --git a/content/posts/jellyfin.md b/content/posts/jellyfin.md new file mode 100644 index 0000000..c9e5dd3 --- /dev/null +++ b/content/posts/jellyfin.md @@ -0,0 +1,9 @@ ++++ +title = "Jellyfin" +date = 2024-10-03 +description = "My Jellyfin docker based instance" ++++ + +This is an post about my docker based Jellyfin instance + + diff --git a/content/posts/nextcloud.md b/content/posts/nextcloud.md new file mode 100644 index 0000000..02f3799 --- /dev/null +++ b/content/posts/nextcloud.md @@ -0,0 +1,9 @@ ++++ +title = "Nextcloud" +date = 2024-10-03 +description = "My Nextcloud docker based instance" ++++ + +This is an post about my docker based Nextcloud instance + + diff --git a/templates/post.html b/templates/post.html new file mode 100644 index 0000000..91bdb80 --- /dev/null +++ b/templates/post.html @@ -0,0 +1,26 @@ +{% extends "base.html" %} + +{% block styles %} + +{% endblock styles %} + +{% block content %} +
+ + +

{{ page.title }}

+
+ {{ page.content | safe }} +
+ Back to list of posts +
+{% endblock content %} + diff --git a/templates/post_list.html b/templates/post_list.html new file mode 100644 index 0000000..471484c --- /dev/null +++ b/templates/post_list.html @@ -0,0 +1,28 @@ +{% extends "base.html" %} + +{% block styles %} + +{% endblock styles %} + +{% block content %} +
+

My Posts

+ {% for post in section.pages %} +
+ + {{ post.title }} + +

+ {% if post.description %} + {{ post.description }} + {% else %} + … + {% endif %} +

+
+

{{ post.date }}

+
+ {% endfor %} +
+{% endblock content %} +