From c4be3181b6f9dc02f6b659506706445c11d9db45 Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Mon, 26 Jan 2026 16:13:52 +0100 Subject: Add a blog --- templates/base.html | 23 +++++++++++----------- templates/blog.html | 18 +++++++++++++++++ templates/blog_post.html | 19 ++++++++++++++++++ templates/header_macros.html | 19 ++++++++++++++++++ templates/pagination_macros.html | 25 ++++++++++++++++++++++++ templates/post_macros.html | 42 ++++++++++++++++++++++++++++++++++++++++ templates/shortcodes/hero.html | 1 + templates/shortcodes/window.html | 2 +- templates/taxonomy_list.html | 17 ++++++++++++++++ templates/taxonomy_single.html | 18 +++++++++++++++++ templates/text.html | 2 +- 11 files changed, 172 insertions(+), 14 deletions(-) create mode 100644 templates/blog.html create mode 100644 templates/blog_post.html create mode 100644 templates/header_macros.html create mode 100644 templates/pagination_macros.html create mode 100644 templates/post_macros.html create mode 100644 templates/shortcodes/hero.html create mode 100644 templates/taxonomy_list.html create mode 100644 templates/taxonomy_single.html (limited to 'templates') diff --git a/templates/base.html b/templates/base.html index 5cc8b33..62629ff 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,3 +1,5 @@ +{% import "header_macros.html" as header_macros %} + @@ -5,11 +7,11 @@ - + - Rubén Beltrán del Río — {{ section.title }} + Rubén Beltrán del Río — {{ config.title }} @@ -19,22 +21,19 @@ + + + -
-

- - Rubén Beltrán del Río -

-

✷ Holistic - tech - services ✷

-
+ {% block header %} + {{ header_macros::main_header() }} + {% endblock %}
{% block content %}{% endblock %}
@@ -43,10 +42,10 @@ - diff --git a/templates/blog.html b/templates/blog.html new file mode 100644 index 0000000..cd3c104 --- /dev/null +++ b/templates/blog.html @@ -0,0 +1,18 @@ +{% extends "base.html" %} +{% import "post_macros.html" as post_macros %} +{% import "header_macros.html" as header_macros %} +{% import "pagination_macros.html" as pagination_macros %} + +{% block header %} + {{ header_macros::small_header() }} +{% endblock %} + +{% block content %} +
+

Articles.

+ {% for page in paginator.pages %} + {{ post_macros::summary(post=page) }} + {% endfor %} + {{ pagination_macros::index_pages() }} +
+{% endblock %} diff --git a/templates/blog_post.html b/templates/blog_post.html new file mode 100644 index 0000000..82850c6 --- /dev/null +++ b/templates/blog_post.html @@ -0,0 +1,19 @@ +{% extends "base.html" %} +{% import "header_macros.html" as header_macros %} +{% import "post_macros.html" as post_macros %} +{% import "pagination_macros.html" as pagination_macros %} + +{% block header %} + {{ header_macros::small_header() }} +{% endblock %} + +{% block content %} +
+

+ {{ page.title }} +

+ {{ post_macros::meta(post=page) }} + {{ page.content | safe }} + {{ pagination_macros::page_pages() }} +
+{% endblock %} diff --git a/templates/header_macros.html b/templates/header_macros.html new file mode 100644 index 0000000..efe286c --- /dev/null +++ b/templates/header_macros.html @@ -0,0 +1,19 @@ +{% macro main_header() %} +
+

+ + Rubén Beltrán del Río +

+

✷ Holistic + tech + services ✷

+
+{% endmacro post_summary %} + +{% macro small_header() %} +
+ +

✷ Holistic tech services ✷

+
+{% endmacro post_summary %} + diff --git a/templates/pagination_macros.html b/templates/pagination_macros.html new file mode 100644 index 0000000..89e8c98 --- /dev/null +++ b/templates/pagination_macros.html @@ -0,0 +1,25 @@ +{% macro index_pages() %} + +{% endmacro index_pages %} + +{% macro page_pages() %} + +{% endmacro page_pages %} diff --git a/templates/post_macros.html b/templates/post_macros.html new file mode 100644 index 0000000..c128bc5 --- /dev/null +++ b/templates/post_macros.html @@ -0,0 +1,42 @@ +{% macro meta(post) %} +
+ +{% endmacro meta %} + +{% macro summary(post) %} +
+

+ {{ post.title }} +

+ {{ post_macros::meta(post=post) }} + {% if post.extra.visual_aid_src and post.extra.visual_aid_alt %} +
+ {% set resized_image = resize_image(path=post.extra.visual_aid_src, width=100, height=75) %} + {{post.extra.visual_aid_alt}} +

{{ post.summary | safe }}

+
+ {% else %} +

{{ post.summary | safe }}

+ {% endif %} +
+{% endmacro summary %} diff --git a/templates/shortcodes/hero.html b/templates/shortcodes/hero.html new file mode 100644 index 0000000..09c6d6f --- /dev/null +++ b/templates/shortcodes/hero.html @@ -0,0 +1 @@ +{{ page.extra.visual_aid_alt }} diff --git a/templates/shortcodes/window.html b/templates/shortcodes/window.html index 3fe8b50..6fe4a90 100644 --- a/templates/shortcodes/window.html +++ b/templates/shortcodes/window.html @@ -1,4 +1,4 @@ -
+
{{title}}
diff --git a/templates/taxonomy_list.html b/templates/taxonomy_list.html new file mode 100644 index 0000000..18e53ce --- /dev/null +++ b/templates/taxonomy_list.html @@ -0,0 +1,17 @@ +{% extends "base.html" %} +{% import "header_macros.html" as header_macros %} + +{% block header %} + {{ header_macros::small_header() }} +{% endblock %} + +{% block content %} +
+

{{ taxonomy.name | title }}

+ +
+{% endblock %} diff --git a/templates/taxonomy_single.html b/templates/taxonomy_single.html new file mode 100644 index 0000000..e90c968 --- /dev/null +++ b/templates/taxonomy_single.html @@ -0,0 +1,18 @@ +{% extends "base.html" %} +{% import "header_macros.html" as header_macros %} +{% import "post_macros.html" as post_macros %} +{% import "pagination_macros.html" as pagination_macros %} + +{% block header %} + {{ header_macros::small_header() }} +{% endblock %} + +{% block content %} +
+

{{ taxonomy.name | title }} / {{ term.name }}

+ {% for page in paginator.pages %} + {{ post_macros::summary(post=page) }} + {% endfor %} + {{ pagination_macros::index_pages() }} +
+{% endblock %} diff --git a/templates/text.html b/templates/text.html index 9ba2a71..0ca19f4 100644 --- a/templates/text.html +++ b/templates/text.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block content %} -
+
{{ section.content | safe }}
-- cgit