chiark / gitweb /
theme: don't repeat SITENAME if it's the same as page title.
authorVladimír Vondruš <mosra@centrum.cz>
Tue, 24 Oct 2017 09:07:40 +0000 (11:07 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Tue, 24 Oct 2017 09:07:40 +0000 (11:07 +0200)
So instead of

    m.css | m.css

on the index page one gets just

    m.css

doc/pelican/theme.rst
pelican-theme/templates/page.html

index 0058a9daea49fd4651a7b104c0f63c3be548a547..10e40ec5e2ee877c13f6793f59c8644442f4263a 100644 (file)
@@ -88,7 +88,8 @@ is present. Example configuration for the builtin dark theme:
     THEME_COLOR = '#22272e'
 
 Value of :py:`SITENAME` is used in the :html:`<title>` tag, separated with a
-``|`` character from page / article name.
+``|`` character from page / article title. If page title is the same as
+:py:`SITENAME` (for example on the index page), only the page title is shown.
 
 `Top navbar`_
 -------------
index cdd7bef7a9add12db27c514aa6963da759ebfe18..e08d84ae15ea1779c5f9a9a41d8923bac1790f4c 100644 (file)
@@ -6,7 +6,11 @@
 {% set breadcrumbs = page.breadcrumb.strip().split('\n') %}
 {% for i in breadcrumbs %}{% set url, _, title = i.strip().partition(' ') %}{{ title }} &raquo; {% endfor %}
 {% endif %}
+{% if page.title == SITENAME %}
+{{ page.title -}}
+{% else %}
 {{ page.title }} | {{ SITENAME -}}
+{% endif %}
 {% endblock %}
 
 {% block head %}