templates: Generate more specific page titles

This commit is contained in:
finga 2023-02-15 05:22:13 +01:00
parent f71e947586
commit 6cceafb21b
5 changed files with 18 additions and 1 deletions

View file

@ -4,7 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="{{ config.description }}"> <meta name="description" content="{{ config.description }}">
<title>{{ config.title }}</title> <title>{% block title %}{% endblock title %}</title>
<link href="{{ config.base_url | safe}}/style.css" rel="stylesheet"> <link href="{{ config.base_url | safe}}/style.css" rel="stylesheet">
<link rel="icon" href="/favicon.png" type="image/png" sizes="16x16"> <link rel="icon" href="/favicon.png" type="image/png" sizes="16x16">
{% if config.generate_feed %} {% if config.generate_feed %}

View file

@ -1,5 +1,9 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}
{{ config.title }} - {{ page.title }}
{% endblock title %}
{% block content %} {% block content %}
<h1 class="title">{{ config.title }}</h1> <h1 class="title">{{ config.title }}</h1>
<h2 class="subtitle">{{ page.title }}</h2> <h2 class="subtitle">{{ page.title }}</h2>

View file

@ -1,5 +1,9 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}
{{ config.title }}
{% endblock title %}
{% block content %} {% block content %}
<h1 class="title">{{ config.title }}</h1> <h1 class="title">{{ config.title }}</h1>
<div class="content"> <div class="content">

View file

@ -1,5 +1,10 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}
{% set section = get_section(path=page.ancestors | last) %}
{{ config.title }} - {{ section.title }} - {{ page.title }}: {{ page.date }}
{% endblock title %}
{% block content %} {% block content %}
{% set section = get_section(path=page.ancestors | last) %} {% set section = get_section(path=page.ancestors | last) %}
<h1 class="title">{{ config.title }}</h1> <h1 class="title">{{ config.title }}</h1>

View file

@ -1,5 +1,9 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}
{{ config.title }} - {{ section.title }}
{% endblock title %}
{% block content %} {% block content %}
<h1 class="title">{{ config.title }}</h1> <h1 class="title">{{ config.title }}</h1>
<h2 class="subtitle">{{ section.title }}</h2> <h2 class="subtitle">{{ section.title }}</h2>