chiark / gitweb /
wrap page/article content in blocks
authorLukas Pirl <git@lukas-pirl.de>
Wed, 13 May 2020 08:57:48 +0000 (10:57 +0200)
committerLukas Pirl <git@lukas-pirl.de>
Wed, 13 May 2020 08:57:48 +0000 (10:57 +0200)
for easier extension/customization/overriding of templates

pelican-theme/templates/article.html
pelican-theme/templates/page.html
pelican-theme/templates/passthrough.html

index 7b09f18b0997e53e1fc9468dbcaa957cdc11bd77..9c692161f0ecd0859434a36dbf03ba215251d350 100644 (file)
@@ -93,7 +93,9 @@
           {{ M_ARCHIVED_ARTICLE_BADGE|render_rst|replace('{year}', article.date.year)|indent(8) }}
           {% endif %}
 <!-- content -->
+{% block article_content %}
 {{ article.content|trim }}
+{% endblock %}
 <!-- /content -->
           {% if article.category.badge or (article.author and article.author.badge) %}
           {{ badges()|rtrim|indent(10) }}
       {% endif %}
       {% if article.content %}
 <!-- content -->
+{% block article_content %}
 {{ article.content|trim }}
+{% endblock %}
 <!-- /content -->
       {% endif %}
       {% if article.category.badge or (article.author and article.author.badge) %}
index 2328e10160fe2925310d447e855ebe3bf5549089..ae60833f1c0107bdd282a68a0710a208d2b5caf5 100644 (file)
         {% endif %}
         {% if page.content %}
 <!-- content -->
+{% block page_content %}
 {{ page.content|trim }}
+{% endblock %}
 <!-- /content -->
         {% endif %}
       </div>
index bdf92b773fccf2980531a680251803025de7242e..cacdfd26747ee3ea907a0595827e881665688600 100644 (file)
@@ -21,6 +21,8 @@
   {% endif %}
 </head>
 <body>
+{% block page_content %}
 {{- page.content -}}
+{% endblock %}
 </body>
 </html>