From d2b298f147502dddf545d635db016a74936105e7 Mon Sep 17 00:00:00 2001 From: Raymond Wanyoike Date: Sun, 6 Nov 2016 22:34:37 +0300 Subject: [PATCH] Bring consistency to templates, update structure to use new base --- alchemy/templates/archives.html | 19 ++++--- alchemy/templates/article.html | 69 ++++++++++------------- alchemy/templates/author.html | 6 +- alchemy/templates/authors.html | 17 +++--- alchemy/templates/categories.html | 17 +++--- alchemy/templates/category.html | 6 +- alchemy/templates/include/pagination.html | 22 +++++--- alchemy/templates/index.html | 62 +++++++++----------- alchemy/templates/page.html | 27 +++++---- alchemy/templates/period_archives.html | 18 ++++++ alchemy/templates/tag.html | 6 +- alchemy/templates/tags.html | 17 +++--- 12 files changed, 150 insertions(+), 136 deletions(-) create mode 100644 alchemy/templates/period_archives.html diff --git a/alchemy/templates/archives.html b/alchemy/templates/archives.html index 686a1de..5fe6dee 100644 --- a/alchemy/templates/archives.html +++ b/alchemy/templates/archives.html @@ -1,15 +1,18 @@ {% extends "base.html" %} {% block title %} - {{ SITENAME }} — Archives +Archives {{ super() }} +{% endblock %} + +{% block page_header %} +Archives {% endblock %} {% block content %} -

Archives

-
- {% for article in dates %} -
{{ article.locale_date }}
-
{{ article.title }}
- {% endfor %} -
+
+ {% for article in dates %} +
{{ article.locale_date }}
+
{{ article.title }}
+ {% endfor %} +
{% endblock %} diff --git a/alchemy/templates/article.html b/alchemy/templates/article.html index 71de071..3d95c13 100644 --- a/alchemy/templates/article.html +++ b/alchemy/templates/article.html @@ -1,56 +1,45 @@ {% extends "base.html" %} {% block head %} - {{ super() }} - {% if article.author %} - - {% endif %} - {% if article.summary %} - - {% endif %} - +{{ super() }} +{% if article.summary %} + +{% endif %} {% endblock %} {% block title %} - {{ SITENAME }} — {{ article.title|striptags }} +{{ article.title|striptags }} {{ super() }} +{% endblock %} + +{% block page_header %} +{{ article.title }} {% endblock %} {% block content %} -
-

- {{ article.title }} -

+
+
-
- {{ article.content }} -
-
-
- {% include 'include/disqus_comments.html' %} +
+ {{ article.content }}
+
+
+{% include 'include/comments.html' %} {% endblock %} diff --git a/alchemy/templates/author.html b/alchemy/templates/author.html index f457216..a87730b 100644 --- a/alchemy/templates/author.html +++ b/alchemy/templates/author.html @@ -1,9 +1,9 @@ {% extends "index.html" %} {% block title %} - {{ SITENAME }} — Articles by {{ author }} +{{ author }} Articles — {{ SITENAME }} {% endblock %} -{% block page_title %} -

Articles by {{ author }}

+{% block page_header %} +{{ author }} Articles {% endblock %} diff --git a/alchemy/templates/authors.html b/alchemy/templates/authors.html index 220c7f4..c1c3c9f 100644 --- a/alchemy/templates/authors.html +++ b/alchemy/templates/authors.html @@ -1,14 +1,17 @@ {% extends "base.html" %} {% block title %} - {{ SITENAME }} — Authors +Authors {{ super() }} +{% endblock %} + +{% block page_header %} +Authors {% endblock %} {% block content %} -

Authors on {{ SITENAME }}

-
    - {% for author, articles in authors|sort %} -
  • {{ author }} ({{ articles|count }})
  • - {% endfor %} -
+
    + {% for author, articles in authors|sort %} +
  • {{ author }} ({{ articles|count }})
  • + {% endfor %} +
{% endblock %} diff --git a/alchemy/templates/categories.html b/alchemy/templates/categories.html index 25a5b30..06dfa6c 100644 --- a/alchemy/templates/categories.html +++ b/alchemy/templates/categories.html @@ -1,14 +1,17 @@ {% extends "base.html" %} {% block title %} - {{ SITENAME }} — Categories +Categories {{ super() }} +{% endblock %} + +{% block page_header %} +Categories {% endblock %} {% block content %} -

Categories on {{ SITENAME }}

-
    - {% for category, articles in categories %} -
  • {{ category }}
  • - {% endfor %} -
+
    + {% for category, articles in categories %} +
  • {{ category }}
  • + {% endfor %} +
{% endblock %} diff --git a/alchemy/templates/category.html b/alchemy/templates/category.html index 235459d..40c78bc 100644 --- a/alchemy/templates/category.html +++ b/alchemy/templates/category.html @@ -1,9 +1,9 @@ {% extends "index.html" %} {% block title %} - {{ SITENAME }} — Articles in the {{ category }} category +{{ category }} Articles — {{ SITENAME }} {% endblock %} -{% block page_title %} -

Articles in the {{ category }} category

+{% block page_header %} +{{ category }} Articles {% endblock %} diff --git a/alchemy/templates/include/pagination.html b/alchemy/templates/include/pagination.html index 1ca9e0b..9eb3052 100644 --- a/alchemy/templates/include/pagination.html +++ b/alchemy/templates/include/pagination.html @@ -1,11 +1,15 @@ {% if DEFAULT_PAGINATION %} - +
    + {% if articles_page.has_previous() %} +
  • «
  • + {% else %} +
  • «
  • + {% endif %} +
  • {{ articles_page.number }} of {{ articles_paginator.num_pages }}
  • + {% if articles_page.has_next() %} +
  • »
  • + {% else %} +
  • »
  • + {% endif %} +
{% endif %} diff --git a/alchemy/templates/index.html b/alchemy/templates/index.html index 222637b..cd1d519 100644 --- a/alchemy/templates/index.html +++ b/alchemy/templates/index.html @@ -1,44 +1,36 @@ {% extends "base.html" %} {% block head %} - {{ super() }} - - +{{ super() }} + +{% endblock %} + +{% block title %} +{{ SITENAME }} — {{ SITE_TAGLINE }} +{% endblock %} + +{% block page_header %} +All Articles {% endblock %} {% block content %} - {% block page_title %} -

All Articles

- {% endblock %} -
- {% for article in articles_page.object_list %} -
-
-
- - - {% if article.author and SHOW_ARTICLE_AUTHOR %} - - {% endif %} -
-
-

- {{ article.title }} -

-
- {{ article.content|striptags|truncate(256) }} -
-
-
-
- {% endfor %} +{% for article in articles_page.object_list %} +
+
+ +
+

{{ article.title }}

+

{{ article.content|striptags|truncate(256) }}

+
- {% include 'include/pagination.html' %}
+
+{% endfor %} +{% include 'include/pagination.html' %} {% endblock %} diff --git a/alchemy/templates/page.html b/alchemy/templates/page.html index 8072a9d..8b9c889 100644 --- a/alchemy/templates/page.html +++ b/alchemy/templates/page.html @@ -1,25 +1,24 @@ {% extends "base.html" %} {% block head %} - {{ super() }} - {% if page.author %} - - {% endif %} - {% if page.summary %} - - {% endif %} - +{{ super() }} +{% if page.summary %} + +{% endif %} {% endblock %} {% block title %} - {{ SITENAME }} — {{ page.title|striptags }} +{{ page.title|striptags }} {{ super() }} +{% endblock %} + +{% block page_header %} +{{ page.title }} {% endblock %} {% block content %} -
-

{{ page.title }}

-
- {{ page.content }} -
+
+
+ {{ page.content }}
+
{% endblock %} diff --git a/alchemy/templates/period_archives.html b/alchemy/templates/period_archives.html new file mode 100644 index 0000000..7c81fae --- /dev/null +++ b/alchemy/templates/period_archives.html @@ -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 %} +
+ {% for article in dates %} +
{{ article.locale_date }}
+
{{ article.title }}
+ {% endfor %} +
+{% endblock %} diff --git a/alchemy/templates/tag.html b/alchemy/templates/tag.html index 448bb91..1a1c578 100644 --- a/alchemy/templates/tag.html +++ b/alchemy/templates/tag.html @@ -1,9 +1,9 @@ {% extends "index.html" %} {% block title %} - {{ SITENAME }} — Articles with the {{ tag }} tag +#{{ tag }} Articles — {{ SITENAME }} {% endblock %} -{% block page_title %} -

Articles with the {{ tag }} tag

+{% block page_header %} +#{{ tag }} Articles {% endblock %} diff --git a/alchemy/templates/tags.html b/alchemy/templates/tags.html index dcc538d..6675fe9 100644 --- a/alchemy/templates/tags.html +++ b/alchemy/templates/tags.html @@ -1,14 +1,17 @@ {% extends "base.html" %} {% block title %} - {{ SITENAME }} — Tags +Tags {{ super() }} +{% endblock %} + +{% block page_header %} +Tags {% endblock %} {% block content %} -

Tags on {{ SITENAME }}

-
    - {% for tag, articles in tags|sort %} -
  • {{ tag }} ({{ articles|count }})
  • - {% endfor %} -
+
    + {% for tag, articles in tags|sort %} +
  • #{{ tag }} ({{ articles|count }})
  • + {% endfor %} +
{% endblock %}