chiark / gitweb /
theme: nice defaults if M_BLOG_{NAME,URL} / M_SITE_LOGO_TEXT not defined.
authorVladimír Vondruš <mosra@centrum.cz>
Sat, 9 Dec 2017 21:40:05 +0000 (22:40 +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
pelican-theme/templates/base_blog.html

index 66c9c53bb5b896fd95cb32344815ceedc7ac406f..0cef2845e91aedbfdacb920d6296d67a73c07a97 100644 (file)
@@ -115,7 +115,9 @@ of the website with pages is treated differently from the "blog" part with
 articles and there are two additional configuration options :py:`M_BLOG_URL` and
 :py:`M_BLOG_NAME` that control how various parts of the theme link to the blog
 and how blog pages are named in the :html:`<title>` element. The :py:`M_BLOG_URL`
-can be either absolute or relative to :py:`SITEURL`.
+can be either absolute or relative to :py:`SITEURL`. If :py:`M_BLOG_NAME` /
+:py:`M_BLOG_URL` are not set, the theme assumes they are the same as
+:py:`SITENAME` / :py:`SITEURL`.
 
 .. code:: py
 
@@ -130,8 +132,9 @@ can be either absolute or relative to :py:`SITEURL`.
 
 :py:`M_SITE_LOGO` is an image file that will be used as a brand logo on left
 side of the navbar, :py:`M_SITE_LOGO_TEXT` is brand logo text. Specifying just
-one of these does the expected thing. The brand logo/text is a link that leads
-to :py:`SITTEURL`.
+one of these does the expected thing, if neither of them is specified, the
+theme will use :py:`SITENAME` in place of :py:`M_SITE_LOGO_TEXT`. The brand
+logo/text is a link that leads to :py:`SITTEURL`.
 
 :py:`M_LINKS_NAVBAR1` and :py:`M_LINKS_NAVBAR2` variables contain links to put
 in the top navbar. On narrow screens, the navbar is divided into two columns,
index 6078e60cfc1e3af9aec2fff80efdb295568bff7d..f7b5c0265b83770845a7b7d67a565498d5c8acb6 100644 (file)
@@ -25,7 +25,7 @@
     <div class="m-row">
       <a href="{{ SITEURL }}/" id="m-navbar-brand" class="m-col-t-9 m-col-m-none m-left-m{% if page and page.landing and page.cover and page.navbar_brand_hidden == 'True' %} m-navbar-brand-hidden{% endif %}">
         {%- if M_SITE_LOGO %}<img src="{{ M_SITE_LOGO }}" />{% endif -%}
-        {{- M_SITE_LOGO_TEXT -}}
+        {{- M_SITE_LOGO_TEXT or SITENAME -}}
       </a>
       <a id="m-navbar-show" href="#navigation" title="Show navigation" class="m-col-t-3 m-hide-m m-text-right"></a>
       <a id="m-navbar-hide" href="#" title="Hide navigation" class="m-col-t-3 m-hide-m m-text-right"></a>
index f0ad50e241a46165dd2ba22e485f6ee9411c9940..3bb8b469c795c2131f3c7974f1b43fc9229df8fa 100644 (file)
@@ -1,4 +1,5 @@
 {% set page_slug = '[blog]' %}
+{% if not M_BLOG_NAME %}{% set M_BLOG_NAME = SITENAME %}{% endif %}
 {% extends 'base.html' %}
 
 {% block title %}{{ M_BLOG_NAME }}{% endblock %}