From: Vladimír Vondruš Date: Tue, 19 Sep 2017 19:22:23 +0000 (+0200) Subject: theme: support for page breadcrumb attributes. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=ededebacfceef65dd6a790623c897277c569d7f1;p=blog.git theme: support for page breadcrumb attributes. --- diff --git a/pelican-theme/templates/page.html b/pelican-theme/templates/page.html index 01a9c1e3..2032cc5e 100644 --- a/pelican-theme/templates/page.html +++ b/pelican-theme/templates/page.html @@ -1,7 +1,13 @@ {% set page_title = page.title %} {% extends "base.html" %} -{% block title %}{{ page.title }} | {{ SITENAME }}{% endblock %} +{% block title %} +{% if page.breadcrumb %} +{% set breadcrumbs = page.breadcrumb.strip().split('\n') %} +{% for i in breadcrumbs %}{% set url, _, title = i.strip().partition(' ') %}{{ title }} » {% endfor %} +{% endif %} +{{ page.title }} | {{ SITENAME -}} +{% endblock %} {% block head %} {{- super() -}} @@ -14,7 +20,19 @@
-

{{ page.title }}

+ {% if not page.landing %} +

+ {% if page.breadcrumb %} + + {% set breadcrumbs = page.breadcrumb.strip().split('\n') %} + {% for i in breadcrumbs %} + {% set url, _, title = i.strip().partition(' ') %} + {{ title }} » + {% endfor %} + + {% endif %} + {{ page.title }} +

{{ page.content -}}