From ededebacfceef65dd6a790623c897277c569d7f1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 19 Sep 2017 21:22:23 +0200 Subject: [PATCH] theme: support for page breadcrumb attributes. --- pelican-theme/templates/page.html | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) 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 -}} -- 2.30.2