chiark / gitweb /
pelican-theme: I thought the M_HTML_HEADER option was there always.
authorVladimír Vondruš <mosra@centrum.cz>
Wed, 2 Oct 2019 17:26:15 +0000 (19:26 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Wed, 2 Oct 2019 17:26:15 +0000 (19:26 +0200)
But apparently not.

doc/themes/pelican.rst
pelican-theme/templates/base.html
pelican-theme/test/layout/features.html
pelican-theme/test/layout/guest-post-howto.html
pelican-theme/test/layout/index.html
pelican-theme/test/layout/showcase-requirements.html
pelican-theme/test/test_layout.py

index 929abeed7b6c921e31967aa0e6d7321a2c2f0c5e..9e51b4bdbcf8f7113e392aebd795589005673fe1 100644 (file)
@@ -220,6 +220,9 @@ neither is specified no :html:`<link>` tag is rendered. Example configuration:
     M_FAVICON = ('favicon.ico', 'image/x-ico')
     M_BLOG_FAVICON = ('favicon-blog.png', 'image/png')
 
+Arbitrary HTML content can be added at the end of the :html:`<head>` via the
+:py:`M_HTML_HEADER` option.
+
 `Top navbar`_
 -------------
 
index 789d31a248292be2d89e27dea4a9f3058c38fdca..9c602e40ff361571cb776cf55ee96fdf5a797408 100644 (file)
@@ -38,6 +38,9 @@
   {% endif %}
   {% block extra %}
   {% endblock extra %}
+  {% if M_HTML_HEADER %}
+  {{ M_HTML_HEADER|rtrim|indent(2) }}
+  {% endif %}
 </head>
 <body>
 <header><nav id="navigation"{% if page and page.landing and page.cover %} class="m-navbar-landing"{% elif (page and page.cover) or (article and article.cover) %} class="m-navbar-cover"{% endif %}>
index e199ece5aba717b17ec7c95713d3ad0837f8c903..578b190be19a2603bb8e7d75a34aef0315f82ca2 100644 (file)
@@ -14,6 +14,9 @@
   <meta property="og:url" content="features.html" />
   <meta name="twitter:card" content="summary" />
   <meta property="og:type" content="page" />
+  <!-- this is extra in the header -->
+    <!-- and more, indented -->
+  <!-- yes. -->
 </head>
 <body>
 <header><nav id="navigation">
index 38ceca106757cd3048639bf19820d89b0add0919..ba171bba5a383fb10d4f4a047ae41600e7842751 100644 (file)
@@ -14,6 +14,9 @@
   <meta property="og:url" content="guest-post-howto.html" />
   <meta name="twitter:card" content="summary" />
   <meta property="og:type" content="page" />
+  <!-- this is extra in the header -->
+    <!-- and more, indented -->
+  <!-- yes. -->
 </head>
 <body>
 <header><nav id="navigation">
index 75681f18814ba2c0a7d0a9bb6b8aa908ad3ddfb9..de1798a7380a63c65cb12850c51f079b3c06c43c 100644 (file)
@@ -13,6 +13,9 @@
   <meta property="og:url" content="./" />
   <meta name="twitter:card" content="summary" />
   <meta property="og:type" content="website" />
+  <!-- this is extra in the header -->
+    <!-- and more, indented -->
+  <!-- yes. -->
 </head>
 <body>
 <header><nav id="navigation">
index 50bd555b9d74b55e860cf59bda1a65dce8aded05..4c9aa6d3e5861777bc91e5600225e92e031f9117 100644 (file)
@@ -14,6 +14,9 @@
   <meta property="og:url" content="showcase-requirements.html" />
   <meta name="twitter:card" content="summary" />
   <meta property="og:type" content="page" />
+  <!-- this is extra in the header -->
+    <!-- and more, indented -->
+  <!-- yes. -->
 </head>
 <body>
 <header><nav id="navigation">
index 2abc9da6641e65c3450ab5fdc7e20dad4cdeebbc..2a9813f26054e383dec1527ea0a635b76f701753 100644 (file)
@@ -65,6 +65,9 @@ class Layout(BaseTestCase):
                    ('', ''),
                    ('GitHub', 'https://github.com/your-brand')],
             # multiline to test indentation
+            'M_HTML_HEADER': """<!-- this is extra in the header -->
+  <!-- and more, indented -->
+<!-- yes. -->""",
             'M_FINE_PRINT': """
 Your Brand. Copyright © `You <mailto:you@your.brand>`_, 2017.
 All rights reserved.