From 35df898826ca1964cba8e695af1dd25515119efa Mon Sep 17 00:00:00 2001 From: Dominik George <dominik.george@teckids.org> Date: Wed, 9 Oct 2024 18:10:58 +0200 Subject: [PATCH] WIP --- .../campdays/freizeit.jpg | Bin .../campdays/index.md | 0 .../campdays/themensessions.jpg | Bin templates/blog/meta_line.html | 1 - templates/blog/post.html | 20 +++++++++- templates/blog/section.html | 17 ++++++++ templates/blog/tag_line.html | 7 ++++ templates/frontpage/blog.html | 14 +------ templates/menu.html | 9 +---- templates/menu/gemeinschaft.html | 37 ++++++++++++++++++ templates/menu/gemeinschaften.html | 20 ---------- templates/menu/projects.html | 3 +- templates/menu/updates.html | 20 ---------- templates/pages/content.html | 20 +++++----- templates/pages/raw.html | 1 - templates/pages/related_posts.html | 10 ----- templates/shortcodes/teckids_related.html | 2 +- 17 files changed, 94 insertions(+), 87 deletions(-) rename content/gemeinschaft/{ => offene-gemeinschaft}/campdays/freizeit.jpg (100%) rename content/gemeinschaft/{ => offene-gemeinschaft}/campdays/index.md (100%) rename content/gemeinschaft/{ => offene-gemeinschaft}/campdays/themensessions.jpg (100%) create mode 100644 templates/blog/section.html create mode 100644 templates/blog/tag_line.html create mode 100644 templates/menu/gemeinschaft.html delete mode 100644 templates/menu/gemeinschaften.html delete mode 100644 templates/menu/updates.html delete mode 100644 templates/pages/related_posts.html diff --git a/content/gemeinschaft/campdays/freizeit.jpg b/content/gemeinschaft/offene-gemeinschaft/campdays/freizeit.jpg similarity index 100% rename from content/gemeinschaft/campdays/freizeit.jpg rename to content/gemeinschaft/offene-gemeinschaft/campdays/freizeit.jpg diff --git a/content/gemeinschaft/campdays/index.md b/content/gemeinschaft/offene-gemeinschaft/campdays/index.md similarity index 100% rename from content/gemeinschaft/campdays/index.md rename to content/gemeinschaft/offene-gemeinschaft/campdays/index.md diff --git a/content/gemeinschaft/campdays/themensessions.jpg b/content/gemeinschaft/offene-gemeinschaft/campdays/themensessions.jpg similarity index 100% rename from content/gemeinschaft/campdays/themensessions.jpg rename to content/gemeinschaft/offene-gemeinschaft/campdays/themensessions.jpg diff --git a/templates/blog/meta_line.html b/templates/blog/meta_line.html index 87d40f93..0da20b03 100644 --- a/templates/blog/meta_line.html +++ b/templates/blog/meta_line.html @@ -2,4 +2,3 @@ <span title="Veröffentlicht am"><i class="fa-solid fa-calendar-days"></i> <time datetime="{{ post.date }}" property="schema:datePublished">{{ post.date }}</time></span> · <span title="Lesezeit"><i class="fa-solid fa-hourglass-start"></i> {{ post.reading_time }} min</span> </p> - diff --git a/templates/blog/post.html b/templates/blog/post.html index ef7b1148..92b4823e 100644 --- a/templates/blog/post.html +++ b/templates/blog/post.html @@ -37,7 +37,25 @@ </div> </div> </div> - {% block related_posts %}{% endblock %} + <div class="card"> + <header class="card-header"> + <p class="card-header-title">Weitere Posts dazu</p> + </header> + <div class="card-content"> + {% for kind, terms in page.taxonomies %} + {% for term in terms %} + {% set taxonomy = get_taxonomy_term(kind=kind, term=term) %} + {% set posts = taxonomy.pages | filter(attribute="date") %} + {% if posts %} + <p class="subtitle is-7">{{ kind | title }}: {{ term }}</p> + {% for post in posts | slice(end=5) %} + <a href="{{ post.permalink }}">{{ post.title}}</a> + {% endfor %} + {% endif %} + {% endfor %} + {% endfor %} + </div> + </div> </div> </div> {% endblock %} diff --git a/templates/blog/section.html b/templates/blog/section.html new file mode 100644 index 00000000..30501aaa --- /dev/null +++ b/templates/blog/section.html @@ -0,0 +1,17 @@ +{% set main_blog_section = get_section(path="blog/_index.md") %} +{% if not posts is defined %} + {% set posts = main_blog_section.pages %} +{% endif %} +<section class="section" resource="{{ main_blog_section.permalink }}" typeof="schema:Blog"> + <meta property="schema:publisher" href="https://teckids.org/" /> + <div class="container"> + <h2 class="title is-2">{{ title | default(value="Aus dem Teckids-Blog") }}</h2> + <div class="columns is-multiline is-same-height mt-4"> + {% for post in posts | slice(end=count|default(value=9)) %} + <div class="column is-one-third"> + {% include "blog/card.html" %} + </div> + {% endfor %} + </div> + </div> +</section> diff --git a/templates/blog/tag_line.html b/templates/blog/tag_line.html new file mode 100644 index 00000000..5782c3d7 --- /dev/null +++ b/templates/blog/tag_line.html @@ -0,0 +1,7 @@ + <div class="tags"> + {% for kind, terms in post.taxonomies %} + {% for term in terms %} + <span class="tag">{{ term }}</span> + {% endfor %} + {% endfor %} + </div> diff --git a/templates/frontpage/blog.html b/templates/frontpage/blog.html index f02416b1..af159e98 100644 --- a/templates/frontpage/blog.html +++ b/templates/frontpage/blog.html @@ -1,14 +1,2 @@ {% set blog_section = get_section(path="blog/_index.md") %} -<section class="section" resource="{{ blog_section.permalink }}" typeof="schema:Blog"> - <meta property="schema:publisher" href="https://teckids.org/" /> - <div class="container"> - <h2 class="title is-2">{{ title | default(value="Aus dem Teckids-Blog") }}</h2> - <div class="columns is-multiline is-same-height mt-4"> - {% for post in blog_section.pages | slice(end=9) %} - <div class="column is-one-third"> - {% include "blog/card.html" %} - </div> - {% endfor %} - </div> - </div> -</section> +{% include "blog/section.html" %} diff --git a/templates/menu.html b/templates/menu.html index 5083e4da..fdda3507 100644 --- a/templates/menu.html +++ b/templates/menu.html @@ -34,14 +34,7 @@ <div class="navbar-item has-dropdown is-hoverable"> <a href="#" class="navbar-item">Teckids-Gemeinschaft</a> <div class="navbar-dropdown is-boxed"> - {% include "menu/gemeinschaften.html" %} - </div> - </div> - - <div class="navbar-item has-dropdown is-hoverable"> - <a href="#" class="navbar-item">Updates</a> - <div class="navbar-dropdown is-boxed"> - {% include "menu/updates.html" %} + {% include "menu/gemeinschaft.html" %} </div> </div> </div> diff --git a/templates/menu/gemeinschaft.html b/templates/menu/gemeinschaft.html new file mode 100644 index 00000000..d50624fb --- /dev/null +++ b/templates/menu/gemeinschaft.html @@ -0,0 +1,37 @@ +{% set gemeinschaft_section = get_section(path="gemeinschaft/_index.md") %} + +<div class="container is-fluid"> + <div class="columns"> + {% for gemeinschaft_section_path in gemeinschaft_section.subsections %} + {% set gemeinschaft_subsection = get_section(path=gemeinschaft_section_path) %} + <section class="column"> + <div class="card p-0 m-0 is-shadowless is-radiusless is-overlay is-flex is-flex-direction-column is-fullheight is-justify-content-space-between"> + <div class="card-content p-0 m-0"> + <h1 class="title is-6 is-mega-menu-title"> + <p> {{ gemeinschaft_subsection.title }} </p> + <p class="is-4">{{ gemeinschaft_subsection.description }}</p> + </h1> + + {% for page in gemeinschaft_subsection.pages %} + <a class="navbar-item" href="{{ page.permalink }}"> + <div class="navbar-content">{{ page.title }}</div> + </a> + {% endfor %} + </div> + {% if gemeinschaft_subsection.extra.products %} + <div class="card-footer"> + {% for product in gemeinschaft_subsection.extra.products %} + <a class="card-footer-item" href="{{ product.link }}"> + <span class="icon-text"> + <span>{{ product.name }}</span> + <span class="icon"><i class="fa-solid fa-up-right-from-square"></i></span> + </span> + </a> + {% endfor %} + </div> + {% endif %} + </div> + </section> + {% endfor %} + </div> +</div> diff --git a/templates/menu/gemeinschaften.html b/templates/menu/gemeinschaften.html deleted file mode 100644 index 9c386774..00000000 --- a/templates/menu/gemeinschaften.html +++ /dev/null @@ -1,20 +0,0 @@ -{% set gemeinschaften = get_taxonomy(kind = "gemeinschaft") %} - -<div class="container is-fluid"> - <div class="columns"> - {% for gemeinschaft in gemeinschaften.items %} - <section - class="column menu-gemeinschaft-section" - id="menu-gemeinschaft-section-{{ gemeinschaft.slug }}" - > - <h1 class="title is-6 is-mega-menu-title">{{ gemeinschaft.name }}</h1> - - {% for page in gemeinschaft.pages %} - <a class="navbar-item" href="{{ page.permalink }}"> - <div class="navbar-content">{{ page.title }}</div> - </a> - {% endfor %} - </section> - {% endfor %} - </div> -</div> diff --git a/templates/menu/projects.html b/templates/menu/projects.html index 054004cd..6af39393 100644 --- a/templates/menu/projects.html +++ b/templates/menu/projects.html @@ -4,8 +4,7 @@ <div class="columns"> {% for project_section_path in projects_section.subsections %} {% set project_section = get_section(path=project_section_path) %} - {% set project_taxonomy = get_taxonomy_term(kind="projekt", term=project_section.title) %} - <section class="column menu-project-section" id="menu-project-section-{{ project_taxonomy.slug }}"> + <section class="column menu-project-section" id="menu-project-section-{{ project_section.components[0] }}"> <div class="card p-0 m-0 is-shadowless is-radiusless is-overlay is-flex is-flex-direction-column is-fullheight is-justify-content-space-between"> <div class="card-content p-0 m-0"> <h1 class="title is-6 is-mega-menu-title"><a href="{{ project_section.permalink }}"> diff --git a/templates/menu/updates.html b/templates/menu/updates.html deleted file mode 100644 index 6894e946..00000000 --- a/templates/menu/updates.html +++ /dev/null @@ -1,20 +0,0 @@ -{% set updates = get_taxonomy(kind = "update") %} - -<div class="container is-fluid"> - <div class="columns"> - {% for update in updates.items %} - <section - class="column menu-update-section" - id="menu-update-section-{{ update.slug }}" - > - <h1 class="title is-6 is-mega-menu-title">{{ update.name }}</h1> - - {% for page in update.pages %} - <a class="navbar-item" href="{{ page.permalink }}"> - <div class="navbar-content">{{ page.title }}</div> - </a> - {% endfor %} - </section> - {% endfor %} - </div> -</div> diff --git a/templates/pages/content.html b/templates/pages/content.html index db8c4266..916a22f6 100644 --- a/templates/pages/content.html +++ b/templates/pages/content.html @@ -17,14 +17,14 @@ {% endblock content %} </div> </section> - {% block related_posts %} - {% set blog_section = get_section(path="blog/_index.md") %} - <section class="section" resource="{{ blog_section.permalink }}" typeof="schema:Blog"> - <meta property="schema:publisher" href="https://teckids.org/" /> - <div class="container"> - <h2 class="title is-2">{{ title | default(value="Aus dem Teckids-Blog") }}</h2> - {% include "pages/related_posts.html" %} - </div> - </section> - {% endblock %} + {% set blog_taxonomy = get_taxonomy_term(kind="aspekt", term=page.title, include_pages=true, required=false) %} + {% if blog_taxonomy and blog_taxonomy.pages %} + {% set posts = blog_taxonomy.pages | filter(attribute="date") %} + {% if posts %} + <aside> + {% set title="Verwandte Posts aus dem Teckids-Blog" %} + {% include "blog/section.html" %} + </aside> + {% endif %} + {% endif %} {% endblock %} diff --git a/templates/pages/raw.html b/templates/pages/raw.html index 085595c5..e2d9395c 100644 --- a/templates/pages/raw.html +++ b/templates/pages/raw.html @@ -2,5 +2,4 @@ {% block main %} {{ page.content | safe }} - {% include "pages/related_posts.html" %} {% endblock %} diff --git a/templates/pages/related_posts.html b/templates/pages/related_posts.html deleted file mode 100644 index 8ff2a7bb..00000000 --- a/templates/pages/related_posts.html +++ /dev/null @@ -1,10 +0,0 @@ -{% set blog_section = get_section(path="blog/_index.md") %} -<div class="columns is-multiline is-same-height mt-4"> - {% for post in blog_section.pages %} - {% if "aspekt" in post.taxonomies and page.title in post.taxonomies["aspekt"] %} - <div class="column is-one-third"> - {% include "blog/card.html" %} - </div> - {% else %}{% continue %}{% endif %} - {% endfor %} -</div> diff --git a/templates/shortcodes/teckids_related.html b/templates/shortcodes/teckids_related.html index 7b8a79e6..8856704c 100644 --- a/templates/shortcodes/teckids_related.html +++ b/templates/shortcodes/teckids_related.html @@ -58,7 +58,7 @@ </div> <div class="media-content"> <p class="is-subtitle is-6"> - <a href="{{ get_url(path="@/gemeinschaft/plattformen.md") }}"> + <a href="{{ get_url(path="@/gemeinschaft/offene-gemeinschaft/plattformen.md") }}"> Informationen und Hilfe zu unseren Plattformen </a> </p> -- GitLab