From: Lukas Pirl Date: Wed, 13 May 2020 08:57:48 +0000 (+0200) Subject: wrap page/article content in blocks X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=4d1a78e9707fe52676074e600289e770a17720d8;p=blog.git wrap page/article content in blocks for easier extension/customization/overriding of templates --- diff --git a/pelican-theme/templates/article.html b/pelican-theme/templates/article.html index 7b09f18b..9c692161 100644 --- a/pelican-theme/templates/article.html +++ b/pelican-theme/templates/article.html @@ -93,7 +93,9 @@ {{ M_ARCHIVED_ARTICLE_BADGE|render_rst|replace('{year}', article.date.year)|indent(8) }} {% endif %} +{% block article_content %} {{ article.content|trim }} +{% endblock %} {% if article.category.badge or (article.author and article.author.badge) %} {{ badges()|rtrim|indent(10) }} @@ -121,7 +123,9 @@ {% endif %} {% if article.content %} +{% block article_content %} {{ article.content|trim }} +{% endblock %} {% endif %} {% if article.category.badge or (article.author and article.author.badge) %} diff --git a/pelican-theme/templates/page.html b/pelican-theme/templates/page.html index 2328e101..ae60833f 100644 --- a/pelican-theme/templates/page.html +++ b/pelican-theme/templates/page.html @@ -117,7 +117,9 @@ {% endif %} {% if page.content %} +{% block page_content %} {{ page.content|trim }} +{% endblock %} {% endif %} diff --git a/pelican-theme/templates/passthrough.html b/pelican-theme/templates/passthrough.html index bdf92b77..cacdfd26 100644 --- a/pelican-theme/templates/passthrough.html +++ b/pelican-theme/templates/passthrough.html @@ -21,6 +21,8 @@ {% endif %} +{% block page_content %} {{- page.content -}} +{% endblock %}