chiark / gitweb /
theme: more compact page markup.
authorVladimír Vondruš <mosra@centrum.cz>
Sun, 10 Dec 2017 14:40:20 +0000 (15:40 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Mon, 11 Dec 2017 01:48:25 +0000 (02:48 +0100)
pelican-theme/templates/page.html

index 415e7d53afd965fbb84dcd6d82b4eb21273639e4..c50826dafed8887ab49c6ea207198f5c8b374eb6 100644 (file)
   <meta name="twitter:title" content="{{ page.title }}" />
   <meta property="og:url" content="{{ page.url|format_siteurl }}" />
   <meta name="twitter:url" content="{{ page.url|format_siteurl }}" />
+  {% if page.summary %}
   <meta property="og:description" content="{{ page.summary|striptags }}" />
   <meta name="twitter:description" content="{{ page.summary|striptags }}" />
+  {% endif %}
   {% if page.cover %}
   <meta property="og:image" content="{{ page.cover|expand_link(page) }}" />
   <meta name="twitter:card" content="summary_large_image" />
@@ -68,8 +70,8 @@
     <div class="m-row">
       <div class="m-col-l-10 m-push-l-1">
         {% if not page.landing %}
+        {% if page.breadcrumb %}
         <h1>
-          {% if page.breadcrumb %}
           <span class="m-breadcrumb">
             {% set breadcrumbs = page.breadcrumb.strip().split('\n') %}
             {% for i in breadcrumbs %}
             <a href="{{ url|expand_link(page) }}">{{ title }}</a> &raquo;
             {% endfor %}
           </span>
-          {% endif %}
           {{ page.title }}
         </h1>
+        {% else %}
+        <h1>{{ page.title }}</h1>
+        {% endif %}
         {% endif %}
+        {% if page.content %}
 <!-- content -->
 {{ page.content|trim }}
 <!-- /content -->
+        {% endif %}
       </div>
     </div>
   </div>