chiark / gitweb /
theme: various updates.
authorVladimír Vondruš <mosra@centrum.cz>
Mon, 11 Sep 2017 11:19:54 +0000 (13:19 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Tue, 12 Sep 2017 10:06:26 +0000 (12:06 +0200)
Fixed code indentation on a bunch of places, got rid of TAGCLOUD_LEVELS
as the style had it hardcoded anyway, adapted to padding changes in the
CSS style.

pelican-theme/templates/article.html
pelican-theme/templates/base.html
pelican-theme/templates/base_blog.html
pelican-theme/templates/page.html

index 890bae7cd61fa55d2aff2be4858c7b3fa660b992..0f9aac3c219dbb47d3f45f7919594040b6058f1e 100644 (file)
 {% endblock %}
 
 {% block content %}
-    {% if article.cover %}
-    <article class="m-jumbo {{ article.class }}">
-      <header>
-        <div class="m-jumbo-image" style="background-image: url('{{ article|expand_link('cover') }}');">
-          <div class="m-jumbo-cover">
-            <div class="m-container">
-              <div class="m-row">
-                <div class="m-col-t-6 m-col-s-5 m-push-s-1 m-text-left">{{ article.locale_date }}</div>
-                <div class="m-col-t-6 m-col-s-5 m-push-s-1 m-text-right">{% for author in article.authors %}<a href="{{ author.url }}">{{ author }}</a>{% endfor %}</div>
-              </div>
-              <div class="m-row">
-                <div class="m-col-t-12 m-col-s-10 m-push-s-1 m-col-m-8 m-push-m-2">
-                  {% set title = article.title.split(' — ') %}
-                  <h1><a href="{{ article.url }}" rel="bookmark"
-        title="Permalink to {{ article.title|striptags }}">
+  {% if article.cover %}
+  <article class="m-jumbo{% if article.class %} {{ article.class }}{%endif%}">
+    <header>
+      <div class="m-jumbo-image" style="background-image: url('{{ article|expand_link('cover') }}');">
+        <div class="m-jumbo-cover">
+          <div class="m-container">
+            <div class="m-row">
+              <div class="m-col-t-6 m-col-s-5 m-push-s-1 m-text-left">{{ article.locale_date }}</div>
+              <div class="m-col-t-6 m-col-s-5 m-push-s-1 m-text-right">{% for author in article.authors %}<a href="{{ author.url }}">{{ author }}</a>{% endfor %}</div>
+            </div>
+            <div class="m-row">
+              <div class="m-col-t-12 m-col-s-10 m-push-s-1 m-col-m-8 m-push-m-2">
+                {% set title = article.title.split(' — ') %}
+                <h1><a href="{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title|striptags }}">
                   {{ title[0] }}
-                  </a></h1>
-                  {% if title|length >= 2 %}<h2>{{ title[1] }}</h2>{% endif %}
-                </div>
+                </a></h1>
+                {% if title|length >= 2 %}
+                <h2>{{ title[1] }}</h2>
+                {% endif %}
               </div>
             </div>
           </div>
         </div>
-        <div class="m-container">
-          <div class="m-row">
-            <div class="m-col-m-10 m-push-m-1 m-nopady">
-              {{ article.summary }}
-            </div>
-          </div>
-        </div>
-      </header>
-      <div class="m-container m-nopady" id="m-container-inflatable">
+      </div>
+      <div class="m-container">
         <div class="m-row">
           <div class="m-col-m-10 m-push-m-1 m-nopady">
+            {{ article.summary|indent(12) }}
+          </div>
+        </div>
+      </div>
+    </header>
+    <div class="m-container" id="m-container-inflatable">
+      <div class="m-row">
+        <div class="m-col-m-10 m-push-m-1 m-nopady">
 <!-- content -->
-{{ article.content }}
+{{ article.content -}}
 <!-- /content -->
-          </div>
         </div>
       </div>
-      <footer class="m-container">
-        <div class="m-row">
-          <div class="m-col-m-10 m-push-m-1 m-nopady">
-            <p>Posted {% if article.authors %}by {% for author in article.authors %}<a href="{{ author.url }}">{{ author }}</a>{% endfor %}{% endif %} on <time datetime="{{ article.date.isoformat() }}">{{ article.locale_date }}</time> in <a href="{{ article.category.url }} ">{{ article.category }}</a>.{% if article.tags %} Tags: {% for tag in article.tags %}<a href="{{ tag.url }}">{{ tag }}</a>{% if not loop.last %}, {% endif %}{% endfor %}.{% endif %}</p>
-          </div>
+    </div>
+    <footer class="m-container">
+      <div class="m-row">
+        <div class="m-col-m-10 m-push-m-1 m-nopadb">
+          <p>Posted {% if article.authors %}by {% for author in article.authors %}<a href="{{ author.url }}">{{ author }}</a>{% endfor %}{% endif %} on <time datetime="{{ article.date.isoformat() }}">{{ article.locale_date }}</time> in <a href="{{ article.category.url }} ">{{ article.category }}</a>.{% if article.tags %} Tags: {% for tag in article.tags %}<a href="{{ tag.url }}">{{ tag }}</a>{% if not loop.last %}, {% endif %}{% endfor %}.{% endif %}</p>
         </div>
-      </footer>
-    </article>
-    {% else %}
-    <article class="m-col-m-10">
+      </div>
+    </footer>
+  </article>
+  {% else %}
+    <article class="m-col-m-10 m-nopadb">
       {% macro header() %}{% include "article_header.html" %}{% endmacro %}
       {{ header()|indent(6) }}
       <div class="m-clearfix-l"></div>
 <!-- content -->
-{{ article.content }}
+{{ article.content -}}
 <!-- /content -->
       {% macro footer() %}{% include "article_footer.html" %}{% endmacro %}
       {{ footer()|indent(6) }}
index 1c4b039ded79e1d3e7dea52253ff375c79b742fc..c76c005933a42829b4eb2a45acfda544dc54deae 100644 (file)
@@ -37,7 +37,7 @@
                 {% if sub %}
                 <ol>
                   {% for title, link in sub %}
-                    <li><a href="{{ link }}">{{ title }}</a></li>
+                  <li><a href="{{ link }}">{{ title }}</a></li>
                   {% endfor %}
                 </ol>
                 {% endif %}
index c421ac4d3d9b7cae85371765e6118442808cd16b..b0500088bf8aa6b353f75b97cdc03631e7c77425 100644 (file)
 {% block content %}
 {% endblock %}
 {% if article and article.cover %}
-<nav class="m-navpanel m-container">
-  <div class="m-row">
-    <div class="m-col-m-5 m-push-m-1 m-col-s-6">
-      <h3>Cate&shy;gories</h3>
-      <ol class="m-block-bar-m">
-        {% for cat, null in categories %}
-        <li><a href="{{ cat.url }}">{{ cat }}</a></li>
-        {% endfor %}
-      </ol>
-    </div>
-    <div class="m-col-m-5 m-push-m-1 m-col-s-6">
-      <h3>Tag cloud</h3>
-      <ul class="m-tagcloud">
-        {% set max_articles_per_tag = tags|map(attribute='1')|map('length')|sort|last %}
-        {% for tag, articles in tags|sort(attribute='0') %}
-        <li class="m-tag-{{ (TAG_CLOUD_LEVELS*(articles|length)/max_articles_per_tag)|round(0, 'ceil')|int }} "><a href="{{ tag.url }}">{{ tag }}</a></li>
-        {% endfor %}
-      </ul>
+  <nav class="m-navpanel m-container">
+    <div class="m-row">
+      <div class="m-col-m-5 m-push-m-1 m-col-s-6">
+        <h3>Cate&shy;gories</h3>
+        <ol class="m-block-bar-m">
+          {% for cat, null in categories %}
+          <li><a href="{{ cat.url }}">{{ cat }}</a></li>
+          {% endfor %}
+        </ol>
+      </div>
+      <div class="m-col-m-5 m-push-m-1 m-col-s-6">
+        <h3>Tag cloud</h3>
+        <ul class="m-tagcloud">
+          {% set max_articles_per_tag = tags|map(attribute='1')|map('length')|sort|last %}
+          {% for tag, articles in tags|sort(attribute='0') %}
+          <li class="m-tag-{{ (5*(articles|length)/max_articles_per_tag)|round(0, 'ceil')|int }} "><a href="{{ tag.url }}">{{ tag }}</a></li>
+          {% endfor %}
+        </ul>
+      </div>
     </div>
-  </div>
-</nav>
+  </nav>
 {% else %}
     <nav class="m-navpanel m-col-m-2">
       <h3>Cate&shy;gories</h3>
@@ -45,7 +45,7 @@
       <ul class="m-tagcloud">
         {% set max_articles_per_tag = tags|map(attribute='1')|map('length')|sort|last %}
         {% for tag, articles in tags|sort(attribute='0') %}
-        <li class="m-tag-{{ (TAG_CLOUD_LEVELS*(articles|length)/max_articles_per_tag)|round(0, 'ceil')|int }} "><a href="{{ tag.url }}">{{ tag }}</a></li>
+        <li class="m-tag-{{ (5*(articles|length)/max_articles_per_tag)|round(0, 'ceil')|int }} "><a href="{{ tag.url }}">{{ tag }}</a></li>
         {% endfor %}
       </ul>
     </nav>
index 87000ff29b26852adbb44ef47a2d16bd122efb84..a8af6fd8690ee5bcd80818bf7979d712b7ad97ee 100644 (file)
@@ -16,7 +16,7 @@
     <div class="m-col-l-10 m-push-l-1">
       <h1>{{ page.title }}</h1>
 <!-- content -->
-{{ page.content }}
+{{ page.content -}}
 <!-- /content -->
     </div>
   </div>