Add breadcrumb navigation

This commit is contained in:
2026-08-07 04:05:49 +02:00
parent bda4ce5ef2
commit 881e4f1598
4 changed files with 33 additions and 1 deletions
+8
View File
@@ -4,6 +4,14 @@
{% block head %}<link rel="canonical" href="{{ site.origin }}{{ site.base_dir }}{{ article.uri }}">{% endblock %} {% block head %}<link rel="canonical" href="{{ site.origin }}{{ site.base_dir }}{{ article.uri }}">{% endblock %}
{% block breadcrumb %}
<nav aria-label="breadcrumb">
<a href="{{ site.base_dir }}">{{ site.name }}</a>
<a href="{{ site.base_dir }}{{ article.section }}/">{{ article.section }}</a>
{{ article.title }}
</nav>
{% endblock %}
{% block main %} {% block main %}
<article> <article>
<header> <header>
+1 -1
View File
@@ -9,7 +9,7 @@
</head> </head>
<body> <body>
<header> <header>
<a href="{{ site.base_dir }}">{{ site.name }}</a> {% block breadcrumb %}<a href="{{ site.base_dir }}">{{ site.name }}</a>{% endblock %}
</header> </header>
<main> <main>
{% block main %}{% endblock %} {% block main %}{% endblock %}
+17
View File
@@ -9,6 +9,23 @@
{% if page_num > 1 %}<meta name="robots" content="noindex, follow">{% endif %} {% if page_num > 1 %}<meta name="robots" content="noindex, follow">{% endif %}
{% endblock %} {% endblock %}
{% block breadcrumb %}
{% if section %}
<nav aria-label="breadcrumb">
<a href="{{ site.base_dir }}">{{ site.name }}</a>
{{ section }}
</nav>
{% elif tag %}
<nav aria-label="breadcrumb">
<a href="{{ site.base_dir }}">{{ site.name }}</a>
<a href="{{ site.base_dir }}tags/">Tags</a>
{{ tag }}
</nav>
{% else %}
{{ super() }}
{% endif %}
{% endblock %}
{% block main %} {% block main %}
{% if heading %}<h1>{{ heading }}</h1>{% endif %} {% if heading %}<h1>{{ heading }}</h1>{% endif %}
{% for item in items %} {% for item in items %}
+7
View File
@@ -6,6 +6,13 @@
<link rel="canonical" href="{{ site.origin }}{{ site.base_dir }}tags/"> <link rel="canonical" href="{{ site.origin }}{{ site.base_dir }}tags/">
{% endblock %} {% endblock %}
{% block breadcrumb %}
<nav aria-label="breadcrumb">
<a href="{{ site.base_dir }}">{{ site.name }}</a>
Tags
</nav>
{% endblock %}
{% block main %} {% block main %}
<h1>Tags</h1> <h1>Tags</h1>
<ul> <ul>