added and refined templates

This commit is contained in:
eclipse 2025-02-06 15:33:25 +01:00
parent 75e969200e
commit 102de4ff8f
5 changed files with 93 additions and 13 deletions

View File

@ -0,0 +1,29 @@
{% extends "base.html" %}
{% block title %}{{ article.title }} - {{ SITENAME }}{% endblock %}
{% block metadesc %}{% if article.summary %}{{ article.summary|e }}{% else %}An Article in {{ SITETAG }}: {{
article.title }}{% endif
%}{% endblock %}
{% block container_body %}
{% block container_header %}
{% endblock container_header %}
<article>
{% block content_header %}
<header>
<h3>{{ article.title }}</h3>
</header>
{% endblock content_header %}
{% block content_body %}
{{ article.content }}
{% endblock content_body %}
{% block content_footer %}
<footer>ISBN: Bla</footer>
{% endblock content_footer %}
</article>
{% endblock container_body %}
{% block container_footer %}
{% endblock container_footer %}

View File

@ -3,7 +3,11 @@
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="{% block metadesc %}{{ DEFAULT_METADESC|e }}{% endblock %}" />
<meta name="author" content="{{ AUTHOR }}" />
<meta name="generator" content="Pelican" />
<meta name="color-scheme" content="light dark" />
{% for css in STYLESHEET_FILES %}
<link rel="stylesheet" href="{{ SITEURL }}/theme/css/{{ css }}" />
@ -19,18 +23,16 @@
</header>
<main class="container">
{% block container_header %}
{% endblock %}
{% block content_header %}
{% endblock %}
{% block content_body %}
{% endblock %}
{% block content_footer %}
{% endblock %}
{% block container_footer %}
{% endblock %}
<div id="main-content" role="document">
<div id="main-header" class="shadow">
{% block content_header %}
{% endblock %}
</div>
{% block content_body %}
{% endblock %}
{% block content_footer %}
{% endblock %}
</div>
</main>
<footer id="site-footer">{% include "includes/footer.html" %}</footer>

View File

@ -0,0 +1,33 @@
{% extends "page.html" %}
{% block title %} {{ super() }} {% endblock %}
{% block metadesc %} {{ super() }} {% endblock %}
{% block content_header %} {{ super() }} {% endblock content_header %}
{% block content_body %}
{% set selector_value = page.card_selector_value if page.card_selector_value is defined else page.title %}
<section class="cards">
{% for article in articles if article[page.card_selector_key] == selector_value %}
<article class="card">
<header class="article-header">
<h3><a href="{{ article.url }}" title="{{ article.title }}">{{ article.title }}</a></h3>
</header>
<div class="article-body">
{% if article.titelbild %}
<a href="{{ article.url }}" title="{{ article.title }}"><img alt='Titelbild zu "{{ article.title }}"'
src="{{ article.titelbild }}" /></a>
{% endif %}
{% if article.summary %}
<p>{{ article.summary }}</p>
{% endif %}
</div>
</article>
{% endfor %}
</section>
{% endblock content_body %}
{% block content_footer %}
{% endblock content_footer %}

View File

@ -1,5 +1,5 @@
<div class="container">
<ul>
<ul class="shadow">
{% for title, link in MENUITEMS %}
{% if link == url %}
<li aria-current="page">

16
theme/templates/page.html Normal file
View File

@ -0,0 +1,16 @@
{% extends "base.html" %}
{% block title %}{{ page.title }} - {{ SITENAME }}{% endblock %}
{% block metadesc %}{% if page.summary %}{{ page.summary|e }}{% else %}A Page in {{ SITETAG }}: {{ page.title }}{% endif
%}{% endblock %}
{% block content_header %}
<h1>{{ page.title }}</h1>
{% endblock content_header %}
{% block content_body %}
{{ page.content }}
{% endblock content_body %}
{% block content_footer %}
{% endblock content_footer %}