improved default template

This commit is contained in:
Bastian Venthur
2022-07-01 12:44:23 +02:00
parent 6d82d2ab79
commit 10bac5531f
5 changed files with 44 additions and 4 deletions

View File

@@ -1,5 +1,9 @@
# Changelog # Changelog
## unreleased
* improved default template
## [1.3.2] - 2022-06-29 ## [1.3.2] - 2022-06-29
* Added --version option * Added --version option

View File

@@ -7,6 +7,11 @@
{% if entry.title %} {% if entry.title %}
<h1><a href="{{entry.dst}}">{{entry.title}}</a></h1> <h1><a href="{{entry.dst}}">{{entry.title}}</a></h1>
{% if entry.description %}
<p>— {{ entry.description }}</p>
{% endif %}
{% endif %} {% endif %}
<p>Written on {{ entry.date.date() }}.</p> <p>Written on {{ entry.date.date() }}.</p>

View File

@@ -3,5 +3,26 @@
{% block title %}{{ title }}{% endblock %} {% block title %}{{ title }}{% endblock %}
{% block content %} {% block content %}
{{ content }}
{% if title %}
<h2>{{ title }}</h2>
{% endif %}
<aside>
<p>published on {{ date.date() }}
{% if tags %}
· tagged with
{% for tag in tags|sort(case_sensitive=true) %}
{%- if not loop.first and not loop.last %}, {% endif -%}
{%- if loop.last and not loop.first %} and {% endif %}
<a href="/tags/{{ tag }}.html">#{{ tag }}</a>
{%- endfor %}
{% endif %}
</p>
</aside>
{{ content }}
{% endblock %} {% endblock %}

View File

@@ -7,16 +7,20 @@
<meta name="author" content="{{ site.author }}"> <meta name="author" content="{{ site.author }}">
{%- if description %} {%- if description %}
<meta name="description" content="{{ description }}"> <meta name="description" content="{{ description }}">
{% endif %} {%- else %}
<title>{% block title %}{% endblock %}</title> <meta name="description" content="{{ site.description }}">
{%- endif %}
<title>{% block title %}{% endblock %} | {{ site.description }}</title>
</head> </head>
<body> <body>
<header> <header>
<h1>A Blog</h1> <h1><a href="/">{{ site.title }}</a></h1>
<nav> <nav>
<h2>{{ site.description }}</h2>
<ul> <ul>
<li><a href="/">Blog</a></li> <li><a href="/">Blog</a></li>
<li><a href="/tags/">Tags</a></li>
<li><a href="/atom.xml">Atom Feed</a></li> <li><a href="/atom.xml">Atom Feed</a></li>
</ul> </ul>
</nav> </nav>
@@ -26,6 +30,7 @@
{% block content %} {% block content %}
{% endblock %} {% endblock %}
</main> </main>
</body> </body>
</html> </html>

View File

@@ -7,6 +7,11 @@
{% if entry.title %} {% if entry.title %}
<h1><a href="/{{entry.dst}}">{{entry.title}}</a></h1> <h1><a href="/{{entry.dst}}">{{entry.title}}</a></h1>
{% if entry.description %}
<p>— {{ entry.description }}</p>
{% endif %}
{% endif %} {% endif %}
<p>Written on {{ entry.date.date() }}.</p> <p>Written on {{ entry.date.date() }}.</p>