From 740b2dcc724a8168e31b54e0db9a3b26c94ce9ff Mon Sep 17 00:00:00 2001 From: eclipse Date: Mon, 17 Mar 2025 18:38:17 +0100 Subject: [PATCH] created news template --- content/pages/neues.md | 5 +++ .../neues/20250307-webseiten-relaunch.md | 1 - pelicanconf.py | 4 +- theme/static/css/custom.css | 15 +------- theme/templates/news.html | 37 +++++++++++++++++++ 5 files changed, 46 insertions(+), 16 deletions(-) create mode 100644 theme/templates/news.html diff --git a/content/pages/neues.md b/content/pages/neues.md index e69de29..7fa202a 100644 --- a/content/pages/neues.md +++ b/content/pages/neues.md @@ -0,0 +1,5 @@ +--- +title: Neuigkeiten +template: news +slug: neues +--- \ No newline at end of file diff --git a/content/posts/neues/20250307-webseiten-relaunch.md b/content/posts/neues/20250307-webseiten-relaunch.md index 462ae8b..836465c 100644 --- a/content/posts/neues/20250307-webseiten-relaunch.md +++ b/content/posts/neues/20250307-webseiten-relaunch.md @@ -3,7 +3,6 @@ title: Meine neue Webseite ist live date: 2025-03-07 10:47 category: Neues author: Tobias Radloff -summary: Ich habe meine Webseite von Grund auf neu gestaltet lang: de featured_image: - pic: ../images/neues/pelican.webp diff --git a/pelicanconf.py b/pelicanconf.py index d397792..414a762 100644 --- a/pelicanconf.py +++ b/pelicanconf.py @@ -54,14 +54,14 @@ CATEGORY_SAVE_AS = '' CATEGORIES_SAVE_AS = '' DEFAULT_PAGINATION = 5 -PAGINATED_TEMPLATES = {} +PAGINATED_TEMPLATES = {'news'} DEFAULT_DATE = "fs" # Uncomment following line if you want document-relative URLs when developing RELATIVE_URLS = True -SUMMARY_MAX_LENGTH = 25 +SUMMARY_MAX_LENGTH = 50 FORMATTED_FIELDS = ['summary', 'klappentext', 'footer_line'] diff --git a/theme/static/css/custom.css b/theme/static/css/custom.css index 0b2bcb1..46da105 100644 --- a/theme/static/css/custom.css +++ b/theme/static/css/custom.css @@ -238,7 +238,6 @@ h1, h2, h3, h4, h5, h6 { } - /* make hamburger icon bigger */ #hamburger-label { font-size: 1.77rem; @@ -295,11 +294,7 @@ h1, h2, h3, h4, h5, h6 { text-decoration: none; } -#content-header h1 { - text-align: center; -} - -.featured-image { +#content-header h1, .featured-image { text-align: center; } @@ -565,7 +560,7 @@ article:not(:has(> form:first-child)) > header.card-header { flex-flow: wrap; column-gap: calc(var(--pico-nav-element-spacing-horizontal) * 2); - .wcard-gallery, .tag-content { + .wcard-gallery, .tag-content, .news-item { flex: 1 0 calc((100% - (2 * var(--pico-nav-element-spacing-horizontal))) * 0.618); min-width: 300px; } @@ -691,9 +686,3 @@ img.impr { .heart { color: var(--tr-accent-color); } - -/* -.article-footer { - margin-left: calc(var(--pico-nav-element-spacing-horizontal) * -1); - margin-right: calc(var(--pico-nav-element-spacing-horizontal) * -1); -}*/ \ No newline at end of file diff --git a/theme/templates/news.html b/theme/templates/news.html new file mode 100644 index 0000000..a8f887e --- /dev/null +++ b/theme/templates/news.html @@ -0,0 +1,37 @@ +{% extends "page.html" %} + +{% block content_all%} + +{% block content_header %} +{{ super.super() }} +{% endblock content_header %} + +{% block content_body %} +{% from 'includes/macros.html' import ci %} +{% set news = articles | selectattr("category", "==", "Neues") | list | sort(reverse=true, attribute="date") %} +{% for n in news %} +
+
+
+

{{ n.title }}

{{ n.summary }}

+

Weiterlesen →

+
+
+ {% if n.featured_image %} + {% set i = n.featured_image[0] %} + {{ ci(i.pic, SITEURL + "/" + n.url, i.text, i.alt, i.credit, i.credit_link) }} + {% endif %} +
+
+
veröffentlicht am {{ n.date | strftime("%d.%m.%y") }}
+
+{% endfor %} +{% endblock content_body %} + +{% block content_footer %} + +{% endblock content_footer %} + +{% endblock content_all%} \ No newline at end of file