From 4ac79a72e913e8c29f9bd00e1a1c5c1ec06cb5e3 Mon Sep 17 00:00:00 2001 From: eclipse Date: Thu, 6 Mar 2025 21:17:54 +0100 Subject: [PATCH] added paragraph preservation for Klappentext; small changes --- content/pages/success.md | 2 +- content/php/contact.php | 5 +++-- theme/static/css/custom.css | 6 ++++-- theme/templates/article.html | 7 ++++--- theme/templates/includes/macros.html | 9 +++++++-- 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/content/pages/success.md b/content/pages/success.md index cdc5a22..f2f7add 100644 --- a/content/pages/success.md +++ b/content/pages/success.md @@ -1,5 +1,5 @@ --- -title: "Das hat geklappt" +title: "Das hat geklappt :-)" date: 2025-03-04 23:19 author: Tobias Radloff summary: Ein Arbeitsschritt wurde erfolgreich bewƤltigt. diff --git a/content/php/contact.php b/content/php/contact.php index c6d0a4a..9f34d04 100644 --- a/content/php/contact.php +++ b/content/php/contact.php @@ -19,6 +19,7 @@ $body = [ "Emailadresse: {$_POST['email']}", "Nachricht: {$_POST['nachricht']}" ]; + $mailContents = [ 'subject' => 'Diese Nachricht kam ueber das Kontaktformular von t-r.de', 'bodyText' => implode("\n\n", $body), @@ -32,6 +33,6 @@ try { GracefulExit($errorURL, "{$err}: {$e->getMessage()}"); } -header("Location: {$successURL}"); +// success +GracefulExit($successURL, "Deine Nachricht wurde erfolgreich verschickt und ist jetzt auf dem Weg zu mir."); ?> - diff --git a/theme/static/css/custom.css b/theme/static/css/custom.css index af7c0b7..bade7bf 100644 --- a/theme/static/css/custom.css +++ b/theme/static/css/custom.css @@ -431,12 +431,14 @@ figcaption { } .article-stats { - padding-left: 0; + margin-top: var(--pico-block-spacing-vertical); + + ul { padding-left: 0; li { list-style: none; } - } + }} } diff --git a/theme/templates/article.html b/theme/templates/article.html index 3e6c683..9c186ab 100644 --- a/theme/templates/article.html +++ b/theme/templates/article.html @@ -18,8 +18,9 @@
{% if article.content | length is not eq(0) %}{{ article.content | safe }}{% endif %} {% if article.klappentext %} + {% from 'includes/macros.html' import kt %}

Klappentext

-
{{ article.klappentext | e }}
+
{{ kt(article.klappentext) }}
{% endif %}
@@ -28,9 +29,9 @@ {% set i = article.featured_image[0] %} {{ fi(i.pic, i.link, i.text, i.title, i.credit, i.credit_link) }} {% endif %} -
+

Details

-
    +
      {% if article.reihe is defined %}
    • aus der Reihe {{ article.reihe }}
    • {% endif %} diff --git a/theme/templates/includes/macros.html b/theme/templates/includes/macros.html index e04b5e7..2074160 100644 --- a/theme/templates/includes/macros.html +++ b/theme/templates/includes/macros.html @@ -1,4 +1,4 @@ -{# featured image macro #} +{# output a featured image #} {% macro fi(pic, link='', alt='', title='', credit='', credit_link='') %} {% endmacro %} -{# card image macro #} +{# output a card image #} {% macro ci(pic, link='', alt='', title='', credit='', credit_link='') %}
      @@ -17,3 +17,8 @@
      {% endmacro %} + +{# split long string (e.g. Klappentext) into paragraphs and output them as

      elements #} +{% macro kt(text) %} +{% for k in text.strip().split("\n\n") | list %}

      {{ k }}

      {% endfor %} +{% endmacro %} \ No newline at end of file