From 4ccfa4b818af0f69ae29e55aad3ba9e1eee1402d Mon Sep 17 00:00:00 2001 From: eclipse Date: Tue, 11 Mar 2025 21:46:44 +0100 Subject: [PATCH] streamlined all templates --- theme/static/css/custom.css | 22 +++++++++--- theme/templates/article.html | 21 ++++++----- theme/templates/base.html | 18 ++++++---- theme/templates/cards.html | 16 +++++++-- theme/templates/contact.html | 35 +++++++++++++------ theme/templates/includes/footer.html | 2 +- theme/templates/includes/macros.html | 4 +-- .../{subscribe.html => subscribe_form.html} | 0 ...unsubscribe.html => unsubscribe_form.html} | 0 theme/templates/index.html | 29 ++++++++------- theme/templates/page.html | 18 ++++++---- theme/templates/tag.html | 2 +- theme/templates/termine.html | 26 ++++++++++---- theme/templates/wide-cards.html | 13 +++++-- 14 files changed, 140 insertions(+), 66 deletions(-) rename theme/templates/includes/{subscribe.html => subscribe_form.html} (100%) rename theme/templates/includes/{unsubscribe.html => unsubscribe_form.html} (100%) diff --git a/theme/static/css/custom.css b/theme/static/css/custom.css index f71ac0c..41aa241 100644 --- a/theme/static/css/custom.css +++ b/theme/static/css/custom.css @@ -283,14 +283,18 @@ h1, h2, h3, h4, h5, h6 { /* Main content */ -#main-header h1, -#site-footer p { +#site-footer p, +.extra-header h1 { box-shadow: var(--pico-card-box-shadow); padding: calc(var(--pico-block-spacing-horizontal) * 0.5) calc(var(--pico-block-spacing-vertical) * 0.5); text-align: center; background-color: var(--pico-card-background-color); } +#content-header h1 { + text-align: center; +} + .featured-image { text-align: center; } @@ -299,7 +303,7 @@ figcaption { text-align: center; font-size: 0.8em; - a { font-size: 0.85m;} + a { font-size: 0.85em;} } #no-bottom-margin { @@ -307,8 +311,16 @@ figcaption { clip-path: inset(-138px -138px -0px -138px); } -/* Index page */ +article form { + box-shadow: none; +} +.padded { + margin-left: var(--pico-block-spacing-horizontal); + margin-right: var(--pico-block-spacing-horizontal); +} + +/* Index page */ .index { display: flex; flex-wrap: wrap; @@ -593,7 +605,7 @@ img.impr { height: 1.2lh; } -.main-footer { +.content-footer { font-size: calc(var(--pico-font-size) * .7); a { diff --git a/theme/templates/article.html b/theme/templates/article.html index 3a435ce..de92130 100644 --- a/theme/templates/article.html +++ b/theme/templates/article.html @@ -7,14 +7,16 @@ {% if article.summary %} {{ article.summary|e }} {% else %} An Article in {{ SITETAG }}: {{ article.title }}{% endif %} {% endblock %} -{% block content_header %} -
-

{{ article.title }}

-
-{% endblock content_header %} - -{% block content_body %} +{% block content_all %}
+ + {% block content_header %} +
+

{{ article.title }}

+
+ {% endblock content_header %} + + {% block content_body %}
{% if article.content | length is not eq(0) %} @@ -62,9 +64,12 @@
{% endblock content_body %} + {% block content_footer %} + {% endblock content_footer %} +
-{% endblock content_footer %} +{% endblock content_all %} diff --git a/theme/templates/base.html b/theme/templates/base.html index fd7c963..ef76f40 100644 --- a/theme/templates/base.html +++ b/theme/templates/base.html @@ -17,22 +17,26 @@ -
-
{% include "includes/jumbotron.html" %}
-
+ {% block site_header %} +
{% include "includes/jumbotron.html" %}
+ {% endblock site_header %}
-
+
+ {% block content_all %} {% block content_header %} - {% endblock %} + {% endblock content_header %} {% block content_body %} - {% endblock %} + {% endblock content_body %} {% block content_footer %} - {% endblock %} + {% endblock content_footer %} + {% endblock content_all %}
+ {% block site_footer %} + {% endblock site_footer %} \ No newline at end of file diff --git a/theme/templates/cards.html b/theme/templates/cards.html index 796e1f0..18f4b5d 100644 --- a/theme/templates/cards.html +++ b/theme/templates/cards.html @@ -1,8 +1,16 @@ -{% extends "page.html" %} +{% extends "base.html" %} + +{% block content_all %} + +{% block content_header %} +
+

{{ page.title }}

+
+{% endblock content_header %} {% block content_body %} {% set selector_value = page.card_selector_value if page.card_selector_value is defined else page.title %} -
+
{% set article_list = [] %} {% for article in articles if article[page.card_selector_key] == selector_value %}{% do article_list.append(article) %}{% endfor %} {% for article in article_list | sort(attribute="order") %} @@ -19,5 +27,7 @@
{% endfor %} -
+ {% endblock content_body %} + +{% endblock content_all %} diff --git a/theme/templates/contact.html b/theme/templates/contact.html index 39f0de6..f47a4ef 100644 --- a/theme/templates/contact.html +++ b/theme/templates/contact.html @@ -1,13 +1,28 @@ -{% extends "page.html" %} {% block content_header %} +{% extends "page.html" %} + +{% block content_all %}
+ + {% block content_header %} + {{ super() }} + {% endblock content_header %} + + {% block content_body %} {% if page.featured_image %} -
- {% from 'includes/macros.html' import fi %} {% set i = - page.featured_image[0] %} {{ fi(i.pic, i.link, i.text, i.alt, i.credit, - i.credit_link) }} -
- {% endif %} {% endblock content_header %} {% block content_body %} {% include - "includes/contact_form.html" %} {% endblock content_body %} {% block - content_footer %} + {% from 'includes/macros.html' import fi %} + {% set i = page.featured_image[0] %} + {{ fi(i.pic, i.link, i.text, i.alt, i.credit, i.credit_link) }} + {% endif %} + + {% if page.content %} +
+ {{ page.content }} +
+ {% endif %} + + {% include "includes/contact_form.html" %} + + {% endblock content_body %} +
-{% endblock content_footer %} +{% endblock content_all %} diff --git a/theme/templates/includes/footer.html b/theme/templates/includes/footer.html index 56dd932..f4d3c5d 100644 --- a/theme/templates/includes/footer.html +++ b/theme/templates/includes/footer.html @@ -1,4 +1,4 @@ - + {% endif %} +
@@ -35,12 +43,16 @@
{% endblock content_body %} - {% if page.written_at is defined %} + {% block content_footer %} + {% if page.written_at is defined %} - {% endblock content_footer %} {% endif %} + {% endblock content_footer %} + +{% endblock content_all %} {% endif %} + diff --git a/theme/templates/wide-cards.html b/theme/templates/wide-cards.html index 868ef6b..6474f9e 100644 --- a/theme/templates/wide-cards.html +++ b/theme/templates/wide-cards.html @@ -1,4 +1,12 @@ -{% extends "page.html" %} +{% extends "base.html" %} + +{% block content_all%} + +{% block content_header %} +
+

{{ page.title }}

+
+{% endblock content_header %} {% block content_body %} {# build list of pages where the slugs correspond to an entry in page.wide_cards; some hackiness required to keep the @@ -35,5 +43,4 @@ wide_card) | list | first is defined %} {% endfor %} {% endblock content_body %} -{% block content_footer %} -{% endblock content_footer %} \ No newline at end of file +{% endblock content_all %} \ No newline at end of file