Indent jinja code blocks, allow editors to collapse regions

main
Raymond Wanyoike 2017-11-21 11:17:33 +03:00
parent 4aee394acb
commit 75a023e04c
16 changed files with 253 additions and 249 deletions

View File

@ -1,18 +1,18 @@
{% extends "base.html" %}
{% block title %}
Archives {{ super() }}
Archives {{ super() }}
{% endblock %}
{% block page_header %}
Archives
Archives
{% endblock %}
{% block content %}
<dl class="row">
<dl class="row">
{% for article in dates %}
<dt class="col-sm-4">{{ article.locale_date }}</dt>
<dd class="col-sm-8"><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></dd>
{% endfor %}
</dl>
</dl>
{% endblock %}

View File

@ -1,20 +1,20 @@
{% extends "base.html" %}
{% block head %}
{{ super() }}
<meta name="description" content="{{ article.summary|striptags }}">
{{ super() }}
<meta name="description" content="{{ article.summary|striptags }}">
{% endblock %}
{% block title %}
{{ article.title|striptags }} {{ super() }}
{{ article.title|striptags }} {{ super() }}
{% endblock %}
{% block page_header %}
{{ article.title }}
{{ article.title }}
{% endblock %}
{% block content %}
<article class="article">
<article class="article">
<header>
<ul class="list-inline">
<li class="list-inline-item text-muted" title="{{ article.date.isoformat() }}">
@ -46,6 +46,6 @@
<div class="content">
{{ article.content }}
</div>
</article>
{% include 'include/comments.html' %}
</article>
{% include 'include/comments.html' %}
{% endblock %}

View File

@ -1,9 +1,9 @@
{% extends "index.html" %}
{% block title %}
{{ author }} Articles | {{ SITENAME }}
{{ author }} Articles | {{ SITENAME }}
{% endblock %}
{% block page_header %}
{{ author }} Articles
{{ author }} Articles
{% endblock %}

View File

@ -1,20 +1,20 @@
{% extends "base.html" %}
{% block title %}
Authors {{ super() }}
Authors {{ super() }}
{% endblock %}
{% block page_header %}
Authors
Authors
{% endblock %}
{% block content %}
<table class="table table-bordered table-striped table-hover">
<table class="table table-bordered table-striped">
{% for author, articles in authors|sort %}
<tr>
<td><a href="{{ SITEURL }}/{{ author.url }}">{{ author }}</a></td>
<td>{{ articles|count }}</td>
</tr>
{% endfor %}
</table>
</table>
{% endblock %}

View File

@ -1,20 +1,20 @@
{% extends "base.html" %}
{% block title %}
Categories {{ super() }}
Categories {{ super() }}
{% endblock %}
{% block page_header %}
Categories
Categories
{% endblock %}
{% block content %}
<table class="table table-bordered table-striped table-hover">
<table class="table table-bordered table-striped">
{% for category, articles in categories|sort %}
<tr>
<td><a href="{{ SITEURL }}/{{ category.url }}">{{ category }}</a></td>
<td>{{ articles|count }}</td>
</tr>
{% endfor %}
</table>
</table>
{% endblock %}

View File

@ -1,9 +1,9 @@
{% extends "index.html" %}
{% block title %}
{{ category }} Articles | {{ SITENAME }}
{{ category }} Articles | {{ SITENAME }}
{% endblock %}
{% block page_header %}
{{ category }} Articles
{{ category }} Articles
{% endblock %}

View File

@ -1,5 +1,5 @@
{% if GOOGLE_ANALYTICS %}
<script>
<script>
(function(i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function() {
@ -13,10 +13,11 @@
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
ga('create', '{{ GOOGLE_ANALYTICS }}', 'auto');
ga('send', 'pageview');
</script>
</script>
{% endif %}
{% if GAUGES %}
<script>
<script>
var _gauges = _gauges || [];
(function() {
var t = document.createElement('script');
@ -28,10 +29,11 @@
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(t, s);
})();
</script>
</script>
{% endif %}
{% if PIWIK_URL and PIWIK_SITE_ID %}
<script>
<script>
var _paq = _paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
@ -47,5 +49,5 @@
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(g, s);
})();
</script>
</script>
{% endif %}

View File

@ -1,7 +1,7 @@
{% if DISQUS_SITENAME %}
<hr>
<div id="disqus_thread"></div>
<script>
<hr>
<div id="disqus_thread"></div>
<script>
var disqus_config = function() {
this.page.url = '{{ SITEURL }}/{{ output_file }}';
this.page.identifier = '{{ article.slug }}';
@ -13,8 +13,8 @@
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<noscript class="text-muted">
</script>
<noscript class="text-muted">
Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a>
</noscript>
</noscript>
{% endif %}

View File

@ -1,6 +1,6 @@
{% if articles_paginator.num_pages > 1 %}
<hr>
<ul class="pagination">
<hr>
<ul class="pagination">
{% if articles_page.has_previous() %}
<li class="page-item">
<a class="page-link" href="{{ SITEURL }}/{{ articles_previous_page.url }}">
@ -20,5 +20,5 @@
</a>
</li>
{% endif %}
</ul>
</ul>
{% endif %}

View File

@ -1,23 +1,23 @@
{% extends "base.html" %}
{% block head %}
{{ super() }}
{% if DESCRIPTION %}
<meta name="description" content="{{ DESCRIPTION|striptags }}">
{% endif %}
{{ super() }}
{% if DESCRIPTION %}
<meta name="description" content="{{ DESCRIPTION|striptags }}">
{% endif %}
{% endblock %}
{% block title %}
{{ SITENAME }} | {{ SITESUBTITLE }}
{{ SITENAME }} | {{ SITESUBTITLE }}
{% endblock %}
{% block page_header %}
Articles
Articles
{% endblock %}
{% block content %}
{% for article in articles_page.object_list %}
<article class="row teaser">
{% for article in articles_page.object_list %}
<article class="row teaser">
<header class="col-sm-4 text-muted">
<ul>
<li title="{{ article.date.isoformat() }}">
@ -39,15 +39,17 @@ Articles
</ul>
</header>
<div class="col-sm-8">
<h4 class="title"><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></h4>
<h4 class="title">
<a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a>
</h4>
<div class="content">
{{ article.summary|striptags }}
</div>
</div>
</article>
{% if not loop.last %}
<hr>
{% endif %}
{% endfor %}
{% include 'include/pagination.html' %}
</article>
{% if not loop.last %}
<hr>
{% endif %}
{% endfor %}
{% include 'include/pagination.html' %}
{% endblock %}

View File

@ -1,22 +1,22 @@
{% extends "base.html" %}
{% block head %}
{{ super() }}
<meta name="description" content="{{ page.summary|striptags }}">
{{ super() }}
<meta name="description" content="{{ page.summary|striptags }}">
{% endblock %}
{% block title %}
{{ page.title|striptags }} {{ super() }}
{{ page.title|striptags }} {{ super() }}
{% endblock %}
{% block page_header %}
{{ page.title }}
{{ page.title }}
{% endblock %}
{% block content %}
<article class="article">
<article class="article">
<div class="content">
{{ page.content }}
</div>
</article>
</article>
{% endblock %}

View File

@ -1,18 +1,18 @@
{% extends "base.html" %}
{% block title %}
Archives for {{ period | reverse | join(' ') }} {{ super() }}
Archives for {{ period | reverse | join(' ') }} {{ super() }}
{% endblock %}
{% block page_header %}
Archives for {{ period | reverse | join(' ') }}
Archives for {{ period | reverse | join(' ') }}
{% endblock %}
{% block content %}
<dl class="dl-horizontal">
<dl class="dl-horizontal">
{% for article in dates %}
<dt>{{ article.locale_date }}</dt>
<dd><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></dd>
{% endfor %}
</dl>
</dl>
{% endblock %}

View File

@ -1,9 +1,9 @@
{% extends "index.html" %}
{% block title %}
#{{ tag }} Articles | {{ SITENAME }}
#{{ tag }} Articles | {{ SITENAME }}
{% endblock %}
{% block page_header %}
#{{ tag }} Articles
#{{ tag }} Articles
{% endblock %}

View File

@ -1,20 +1,20 @@
{% extends "base.html" %}
{% block title %}
Tags {{ super() }}
Tags {{ super() }}
{% endblock %}
{% block page_header %}
Tags
Tags
{% endblock %}
{% block content %}
<table class="table table-bordered table-striped table-hover">
<table class="table table-bordered table-striped">
{% for tag, articles in tags|sort %}
<tr>
<td><a href="{{ SITEURL }}/{{ tag.url }}">#{{ tag }}</a></td>
<td>{{ articles|count }}</td>
</tr>
{% endfor %}
</table>
</table>
{% endblock %}