Bring consistency to templates, update structure to use new base

This commit is contained in:
Raymond Wanyoike 2016-11-06 22:34:37 +03:00
commit d2b298f147
12 changed files with 150 additions and 136 deletions

View file

@ -1,15 +1,18 @@
{% extends "base.html" %}
{% block title %}
{{ SITENAME }} — Archives
Archives {{ super() }}
{% endblock %}
{% block page_header %}
Archives
{% endblock %}
{% block content %}
<h1>Archives</h1>
<dl class="list dl-horizontal">
{% for article in dates %}
<dt>{{ article.locale_date }}</dt>
<dd><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></dd>
{% endfor %}
</dl>
<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>
{% endblock %}

View file

@ -1,56 +1,45 @@
{% extends "base.html" %}
{% block head %}
{{ super() }}
{% if article.author %}
<meta name="author" content="{{ article.author }}">
{% endif %}
{% if article.summary %}
<meta name="description" content="{{ article.summary|striptags }}">
{% endif %}
<meta name="tags" contents="{% for tag in article.tags %}{{ tag }}, {% endfor %}">
{{ super() }}
{% if article.summary %}
<meta name="description" content="{{ article.summary|striptags }}">
{% endif %}
{% endblock %}
{% block title %}
{{ SITENAME }} &mdash; {{ article.title|striptags }}
{{ article.title|striptags }} {{ super() }}
{% endblock %}
{% block page_header %}
{{ article.title }}
{% endblock %}
{% block content %}
<div class="post full-post">
<h1 class="post-title">
<a href="/{{ article.url }}" title="Permalink to {{ article.title|striptags }}">{{ article.title }}</a>
</h1>
<div class="article">
<div class="article-header">
<ul class="list-inline">
<li class="post-date">
<a class="text-muted" href="/{{ article.url }}" title="{{ article.date.isoformat() }}">{{ article.locale_date }}</a>
</li>
<li class="muted">&middot;</li>
<li class="post-category">
<a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a>
</li>
{% if article.tags %}
<li class="muted">&middot;</li>
<li>
{% for tag in article.tags %}
<a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a>{% if not loop.last %}, {% endif %}
{% endfor %}
</li>
{% endif %}
<li class="text-muted" title="{{ article.date.isoformat() }}">{{ article.locale_date }}</li>
<li>&middot;</li>
<li><a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a></li>
{% if article.author and SHOW_ARTICLE_AUTHOR %}
<li class="muted">&middot;</li>
<li>
<address class="post-author">
By <a href="{{ SITEURL }}/{{ article.author.url }}">{{ article.author }}</a>
</address>
</li>
<li>&middot;</li>
<li>By <a href="{{ SITEURL }}/{{ article.author.url }}">{{ article.author }}</a></li>
{% endif %}
{% if article.tags %}
<li>&middot;</li>
<li>
{% for tag in article.tags %}
<a href="{{ SITEURL }}/{{ tag.url }}">#{{ tag }}</a>{% if not loop.last %}, {% endif %}
{% endfor %}
</li>
{% endif %}
</ul>
<div class="post-content">
{{ article.content }}
</div>
</div>
<hr class="separator">
<div class="col-md-8 col-md-offset-2">
{% include 'include/disqus_comments.html' %}
<div class="article-main">
{{ article.content }}
</div>
</div>
<hr>
{% include 'include/comments.html' %}
{% endblock %}

View file

@ -1,9 +1,9 @@
{% extends "index.html" %}
{% block title %}
{{ SITENAME }} &mdash; Articles by {{ author }}
{{ author }} Articles &mdash; {{ SITENAME }}
{% endblock %}
{% block page_title %}
<h1>Articles by {{ author }}</h1>
{% block page_header %}
{{ author }} Articles
{% endblock %}

View file

@ -1,14 +1,17 @@
{% extends "base.html" %}
{% block title %}
{{ SITENAME }} &mdash; Authors
Authors {{ super() }}
{% endblock %}
{% block page_header %}
Authors
{% endblock %}
{% block content %}
<h1>Authors on {{ SITENAME }}</h1>
<ul class="list-unstyled">
{% for author, articles in authors|sort %}
<li><a href="{{ SITEURL }}/{{ author.url }}">{{ author }}</a> ({{ articles|count }})</li>
{% endfor %}
</ul>
<ul class="list-unstyled">
{% for author, articles in authors|sort %}
<li><a href="{{ SITEURL }}/{{ author.url }}">{{ author }}</a> ({{ articles|count }})</li>
{% endfor %}
</ul>
{% endblock %}

View file

@ -1,14 +1,17 @@
{% extends "base.html" %}
{% block title %}
{{ SITENAME }} &mdash; Categories
Categories {{ super() }}
{% endblock %}
{% block page_header %}
Categories
{% endblock %}
{% block content %}
<h1>Categories on {{ SITENAME }}</h1>
<ul class="list-unstyled">
{% for category, articles in categories %}
<li><a href="{{ SITEURL }}/{{ category.url }}">{{ category }}</a></li>
{% endfor %}
</ul>
<ul class="list-unstyled">
{% for category, articles in categories %}
<li><a href="{{ SITEURL }}/{{ category.url }}">{{ category }}</a></li>
{% endfor %}
</ul>
{% endblock %}

View file

@ -1,9 +1,9 @@
{% extends "index.html" %}
{% block title %}
{{ SITENAME }} &mdash; Articles in the {{ category }} category
{{ category }} Articles &mdash; {{ SITENAME }}
{% endblock %}
{% block page_title %}
<h1>Articles in the {{ category }} category</h1>
{% block page_header %}
{{ category }} Articles
{% endblock %}

View file

@ -1,11 +1,15 @@
{% if DEFAULT_PAGINATION %}
<ul class="pagination">
{% if articles_page.has_previous() %}
<li><a href="{{ SITEURL }}/{{ articles_previous_page.url }}">&laquo;</a></li>
{% endif %}
<li class="disabled"><a href="#">Page {{ articles_page.number }} / {{ articles_paginator.num_pages }}</a></li>
{% if articles_page.has_next() %}
<li><a href="{{ SITEURL }}/{{ articles_next_page.url }}">&raquo;</a></li>
{% endif %}
</ul>
<ul class="pagination">
{% if articles_page.has_previous() %}
<li><a href="{{ SITEURL }}/{{ articles_previous_page.url }}">&laquo;</a></li>
{% else %}
<li class="disabled"><span>&laquo;<span></li>
{% endif %}
<li><span>{{ articles_page.number }} of {{ articles_paginator.num_pages }}</span></li>
{% if articles_page.has_next() %}
<li><a href="{{ SITEURL }}/{{ articles_next_page.url }}">&raquo;</a></li>
{% else %}
<li class="disabled"><span>&raquo;<span></li>
{% endif %}
</ul>
{% endif %}

View file

@ -1,44 +1,36 @@
{% extends "base.html" %}
{% block head %}
{{ super() }}
<meta name="author" content="{{ AUTHOR }}">
<meta name="description" content="{{ META_DESCRIPTION|striptags }}">
{{ super() }}
<meta name="description" content="{{ SITE_DESCRIPTION|striptags }}">
{% endblock %}
{% block title %}
{{ SITENAME }} &mdash; {{ SITE_TAGLINE }}
{% endblock %}
{% block page_header %}
All Articles
{% endblock %}
{% block content %}
{% block page_title %}
<h1>All Articles</h1>
{% endblock %}
<div>
{% for article in articles_page.object_list %}
<div class="post mini-post">
<div class="row">
<div class="col-md-4">
<p class="post-date">
<a class="text-muted" href="/{{ article.url }}" title="{{ article.date.isoformat() }}">{{ article.locale_date }}</a>
</p>
<p class="post-category">
<a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a>
</p>
{% if article.author and SHOW_ARTICLE_AUTHOR %}
<address class="post-author">
By <a href="{{ SITEURL }}/{{ article.author.url }}">{{ article.author }}</a>
</address>
{% endif %}
</div>
<div class="col-md-8">
<h2 class="post-title">
<a href="/{{ article.url }}" title="Permalink to {{ article.title|striptags }}">{{ article.title }}</a>
</h2>
<div class="post-content">
{{ article.content|striptags|truncate(256) }}
</div>
</div>
</div>
</div>
{% endfor %}
{% for article in articles_page.object_list %}
<div class="teaser">
<div class="row">
<div class="col-sm-4 hidden-xs teaser-header">
<div class="text-muted teaser-date" title="{{ article.date.isoformat() }}">{{ article.locale_date }}</div>
<div><a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a></div>
{% if article.author and SHOW_ARTICLE_AUTHOR %}
<div>By <a href="{{ SITEURL }}/{{ article.author.url }}">{{ article.author }}</a></div>
{% endif %}
</div>
<div class="col-sm-8 teaser-main">
<h2><a href="/{{ article.url }}" title="Permalink to {{ article.title|striptags }}">{{ article.title }}</a></h2>
<p>{{ article.content|striptags|truncate(256) }}</p>
</div>
</div>
{% include 'include/pagination.html' %}
</div>
<hr>
{% endfor %}
{% include 'include/pagination.html' %}
{% endblock %}

View file

@ -1,25 +1,24 @@
{% extends "base.html" %}
{% block head %}
{{ super() }}
{% if page.author %}
<meta name="author" content="{{ page.author }}">
{% endif %}
{% if page.summary %}
<meta name="description" content="{{ page.summary|striptags }}">
{% endif %}
<meta name="tags" contents="{% for tag in page.tags %}{{ tag }}, {% endfor %}">
{{ super() }}
{% if page.summary %}
<meta name="description" content="{{ page.summary|striptags }}">
{% endif %}
{% endblock %}
{% block title %}
{{ SITENAME }} &mdash; {{ page.title|striptags }}
{{ page.title|striptags }} {{ super() }}
{% endblock %}
{% block page_header %}
{{ page.title }}
{% endblock %}
{% block content %}
<div class="page">
<h1 class="title">{{ page.title }}</h1>
<div class="content">
{{ page.content }}
</div>
<div class="page">
<div class="page-main">
{{ page.content }}
</div>
</div>
{% endblock %}

View file

@ -0,0 +1,18 @@
{% extends "base.html" %}
{% block title %}
Archives for {{ period | reverse | join(' ') }} {{ super() }}
{% endblock %}
{% block page_header %}
Archives for {{ period | reverse | join(' ') }}
{% endblock %}
{% block content %}
<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>
{% endblock %}

View file

@ -1,9 +1,9 @@
{% extends "index.html" %}
{% block title %}
{{ SITENAME }} &mdash; Articles with the {{ tag }} tag
#{{ tag }} Articles &mdash; {{ SITENAME }}
{% endblock %}
{% block page_title %}
<h1>Articles with the {{ tag }} tag</h1>
{% block page_header %}
#{{ tag }} Articles
{% endblock %}

View file

@ -1,14 +1,17 @@
{% extends "base.html" %}
{% block title %}
{{ SITENAME }} &mdash; Tags
Tags {{ super() }}
{% endblock %}
{% block page_header %}
Tags
{% endblock %}
{% block content %}
<h1>Tags on {{ SITENAME }}</h1>
<ul class="list-unstyled">
{% for tag, articles in tags|sort %}
<li><a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a> ({{ articles|count }})</li>
{% endfor %}
</ul>
<ul class="list-unstyled">
{% for tag, articles in tags|sort %}
<li><a href="{{ SITEURL }}/{{ tag.url }}">#{{ tag }}</a> ({{ articles|count }})</li>
{% endfor %}
</ul>
{% endblock %}