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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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