From b60a72e1892d7ac4a0a142c953a87931aed4c96b Mon Sep 17 00:00:00 2001 From: Age Manning Date: Mon, 9 Jul 2018 03:14:41 +1000 Subject: [PATCH] =?UTF-8?q?example=20correction=20that=20prevents=20author?= =?UTF-8?q?'s=20cover=20images=20from=20being=20ove=E2=80=A6=20(#28)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * example correction that prevents author's cover images from being overwritten by inherited code in index.html * article, author, category and tag extends to base.html instead of index.html --- templates/article.html | 5 +++-- templates/author.html | 15 ++++++++++++--- templates/category.html | 11 ++++++++++- templates/tag.html | 12 +++++++++++- 4 files changed, 36 insertions(+), 7 deletions(-) diff --git a/templates/article.html b/templates/article.html index 6236920..70befdf 100644 --- a/templates/article.html +++ b/templates/article.html @@ -1,4 +1,5 @@ {% extends "base.html" %} + {% block title %}{{ article.title }}{% endblock %} {# #} @@ -14,14 +15,14 @@ {% else %} {% set selected_cover = SITEURL+"/"+article.og_image %} {% endif %} +{% elif article.color %} + {% set selected_color = article.color %} {% elif HEADER_COVER %} {% if HEADER_COVER|lower|truncate(4, True, '') == "http" %} {% set selected_cover = HEADER_COVER %} {% else %} {% set selected_cover = SITEURL+"/"+HEADER_COVER %} {% endif %} -{% elif article.color %} - {% set selected_color = article.color %} {% elif HEADER_COLOR %} {% set selected_color = HEADER_COLOR %} {% endif %} diff --git a/templates/author.html b/templates/author.html index f657821..d423016 100644 --- a/templates/author.html +++ b/templates/author.html @@ -1,4 +1,6 @@ -{% extends "index.html" %} +{% extends "base.html" %} + +{% block title %}{{ SITENAME }} - Articles by {{ author_name }}{% endblock %} {% set author_name = author.name | title %} @@ -32,8 +34,6 @@ {% set selected_color = HEADER_COLOR %} {% endif %} -{% block title %}{{ SITENAME }} - Articles by {{ author_name }}{% endblock %} - {% block opengraph %} {{ super() }} @@ -114,3 +114,12 @@ {% endif %} {% endblock header %} + +{% block content %} + +
+
+ {% include "partials/loop.html" %} +
+
+{% endblock content %} \ No newline at end of file diff --git a/templates/category.html b/templates/category.html index 44f7cd5..5cc43a5 100644 --- a/templates/category.html +++ b/templates/category.html @@ -1,4 +1,4 @@ -{% extends "index.html" %} +{% extends "base.html" %} {% block title %}{{ SITENAME }} - Articles in the {{ category }} category{% endblock %} @@ -51,3 +51,12 @@ {% endblock header %} + +{% block content %} + +
+
+ {% include "partials/loop.html" %} +
+
+{% endblock content %} \ No newline at end of file diff --git a/templates/tag.html b/templates/tag.html index 7f5778a..d036ac4 100644 --- a/templates/tag.html +++ b/templates/tag.html @@ -1,4 +1,5 @@ -{% extends "index.html" %} +{% extends "base.html" %} + {% block title %}{{ SITENAME }} - Tag {{ tag }}{% endblock %} {# #} @@ -50,3 +51,12 @@ {% endblock header %} + +{% block content %} + +
+
+ {% include "partials/loop.html" %} +
+
+{% endblock content %} \ No newline at end of file