chiark / gitweb /
theme: sane default fine print, ability to hide (parts of) the footer.
authorVladimír Vondruš <mosra@centrum.cz>
Sat, 9 Dec 2017 21:43:01 +0000 (22:43 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Mon, 11 Dec 2017 01:48:25 +0000 (02:48 +0100)
doc/pelican/theme.rst
pelican-theme/templates/base.html

index 0cef2845e91aedbfdacb920d6296d67a73c07a97..a51487b0727d39382618198fd4ec8144e2a4b86a 100644 (file)
@@ -190,7 +190,18 @@ the same way as in the `top navbar`_. A tuple entry with empty title (i.e.,
 
 Footer fine print can be specified via :py:`M_FINE_PRINT`. Contents of the
 variable are processed as :abbr:`reST <reStructuredText>`, so you can use all
-the formatting and linking capabilities in there.
+the formatting and linking capabilities in there. If :py:`M_FINE_PRINT` is not
+specified, the theme will use the following instead. Set
+:py:`M_FINE_PRINT = None` to disable rendering of the fine print completely.
+
+.. code:: py
+
+    M_FINE_PRINT = SITENAME + """. Powered by `Pelican <https://getpelican.com>`_
+        and `m.css <http://mcss.mosra.cz>`_."""
+
+If :py:`M_FINE_PRINT` is set to :py:`None` and none of :py:`M_LINKS_FOOTER1`,
+:py:`M_LINKS_FOOTER2`, :py:`M_LINKS_FOOTER3`, :py:`M_LINKS_FOOTER4` is set, the
+footer is not rendered at all.
 
 Example configuration, again matching example markup from the
 `CSS page layout <{filename}/css/page-layout.rst#footer-navigation>`__
index f7b5c0265b83770845a7b7d67a565498d5c8acb6..ef2566dfc70d1ee16467f08a1e432aff478f4c6c 100644 (file)
@@ -73,6 +73,7 @@
 {% block main %}
 {% endblock %}
 </main>
+{% if M_LINKS_FOOTER1 or M_LINKS_FOOTER2 or M_LINKS_FOOTER3 or M_LINKS_FOOTER4 or not M_FINE_PRINT is defined or M_FINE_PRINT %}
 <footer><nav>
   <div class="m-container">
     {% if M_LINKS_FOOTER1 or M_LINKS_FOOTER2 or M_LINKS_FOOTER3 or M_LINKS_FOOTER4 %}
       </div>
     </div>
     {% endif %}
+    {% if not M_FINE_PRINT is defined or M_FINE_PRINT %}
     <div class="m-row">
       <div class="m-col-l-10 m-push-l-1">
-        {% if M_FINE_PRINT %}
-        {{ M_FINE_PRINT|render_rst|indent(10) }}
-        {% endif %}
+        {{ (M_FINE_PRINT or SITENAME + ". Powered by `Pelican <https://getpelican.com>`_ and `m.css <http://mcss.mosra.cz>`_.")|render_rst|indent(8) }}
       </div>
     </div>
+    {% endif %}
   </div>
 </nav></footer>
+{% endif %}
 </body>
 </html>