From 8003f162ae4fda42064e24d53fbbd4360b290236 Mon Sep 17 00:00:00 2001 From: Jeff MacKinnon Date: Wed, 31 Jul 2024 10:40:30 -0300 Subject: [PATCH] Initial Changes for v2.0a --- templates/archives.html | 12 +- templates/article.html | 203 ++++++--------- templates/articles_list_page.html | 12 - templates/author.html | 5 +- templates/authors.html | 10 +- templates/base.html | 335 +++++++++++++++---------- templates/categories.html | 10 +- templates/category.html | 10 +- templates/include/article_footer.html | 14 +- templates/include/cornerstone.html | 55 ---- templates/include/links.html | 83 +++--- templates/include/paginated_posts.html | 45 ---- templates/include/sidebar.html | 190 -------------- templates/index.html | 75 +++--- templates/page.html | 39 ++- templates/pagination.html | 17 ++ templates/period_archives.html | 12 +- templates/tag.html | 10 +- templates/tags.html | 10 +- templates/translations.html | 22 +- 20 files changed, 454 insertions(+), 715 deletions(-) delete mode 100644 templates/articles_list_page.html delete mode 100644 templates/include/cornerstone.html delete mode 100644 templates/include/paginated_posts.html delete mode 100644 templates/include/sidebar.html create mode 100644 templates/pagination.html diff --git a/templates/archives.html b/templates/archives.html index 2397e16..a61bf3c 100644 --- a/templates/archives.html +++ b/templates/archives.html @@ -1,10 +1,14 @@ {% extends "base.html" %} -{% block title %}{{ SITENAME }} - Archives{% endblock %} +{% block title %}{{ SITENAME|striptags }} - Archives{% endblock %} {% block content %} -

Archives for {{ SITENAME }}

- -{% include 'include/archive_list.html' %} +

Archives for {{ SITENAME }}

+
+ {% for article in dates %} +
{{ article.locale_date }}
+
{{ article.title }}
+ {% endfor %} +
{% endblock %} diff --git a/templates/article.html b/templates/article.html index 20b039a..9a67799 100644 --- a/templates/article.html +++ b/templates/article.html @@ -1,50 +1,29 @@ {% extends "base.html" %} - {% block html_lang %}{{ article.lang }}{% endblock %} -{% block title %}{{ SITENAME }} - {{ article.title|striptags }}{% endblock %} +{% block title %}{{ SITENAME|striptags }} - {{ article.title|striptags }}{% endblock %} {% block head %} -{% if article.status == "hidden" %} - - - -{% endif %} - {{ super() }} + {% import 'translations.html' as translations with context %} {% if translations.entry_hreflang(article) %} {{ translations.entry_hreflang(article) }} {% endif %} + {% if article.status == "hidden" %} + + + + {% endif %} + + + {% if article.description %} + + {% endif %} {% for tag in article.tags %} - + {% endfor %} - {% if article.summary %} - - {% else %} - - {% endif %} - - - {% if article.photo_image %} - - {% else %} - - {% endif %} - - {% if SOCIAL_TWIITER %} - - {% endif %} - - {% if article.summary %} - - {% else %} - - {% endif %} - {% if article.photo_image %} - - {% endif %} @@ -60,7 +39,7 @@ {% endif %} - + {% endblock %} @@ -73,41 +52,18 @@ {% block content %} -
+
-

{{ article.title }}

-
-
+

+ {{ article.title }}

{% import 'translations.html' as translations with context %} {{ translations.translations_for(article) }} - - {% if article.authors %} -

By {% for author in article.authors %} - {{ author }} - {% endfor %} -

- {% endif %} -

Published:

- {% if article.modified %} -

Updated:

- {% endif %} - - - {% if SOCIAL_SHARE is sameas true %} - - {% endif %} -
-
- + {% if article.photo_image and SHOW_TOP_IMAGE == True %} - {{ article.image_alt }} + {{ article.image_alt }} {% endif %} - {{ article.content }} {% if article.photo_gallery %} @@ -124,68 +80,73 @@ {% endif %} {% if article.series %} -
-

This post is part {{ article.series.index }} of the "{{ article.series.name }}" series:

-
    - {% for part_article in article.series.all %} -
  1. - {{ part_article.title }} -
  2. +
    +

    This post is part {{ article.series.index }} of the "{{ article.series.name }}" series:

    +
      + {% for part_article in article.series.all %} +
    1. + {{ part_article.title }} +
    2. + {% endfor %} +
    +
    + {% endif %} + + +
    +

    Published:

    + {% if article.modified %} +

    Last updated:

    + {% endif %} + {% if article.authors %} +
    + By {% for author in article.authors %} + {{ author }} {% endfor %} -
-
+ {% endif %} - -
- {% if article.category %} - - {% endif %} - {% if article.tags %} -
- Tags: - {% for tag in article.tags %} - {{ tag }} - {% endfor %} -
- {% endif %} -
- - {% if COMMENTS is sameas True %} -
-

Comments

- {{ COMMENT_EMBED }} -
+ {% if article.category %} +

+ Category: {{ article.category }} +

{% endif %} - - - {% if MASTODON_COMMENTS == True and article.mastodon_post_id is defined %} -
-

Comment on Mastodon

- {% include 'include/mastodon-comments.html' %} -
+ {% if article.tags %} +

+ Tags: + {% for tag in article.tags %} + {{ tag }} + {% endfor %} +

{% endif %} + - {% if TWITTER_COMMENTS is sameas True %} -
-

Comment on Twitter

-

To join a conversation on Twitter click here.

-
- {% endif %} +
+ {% if COMMENTS is sameas True %} +
+

Comments

+ {{ COMMENT_EMBED }} +
+ {% endif %} - -
- {% if article.photo_image and SHOW_BOTTOM_IMAGE == True %} - - {% endif %} - {% if ARTICLE_FOOTER == true %} - {% include 'include/article_footer.html' %} - {% endif %} -
- - + {% if MASTODON_COMMENTS == True and article.mastodon_post_id is defined %} +
+

Comment on Mastodon

+ {% include 'include/mastodon-comments.html' %} +
+ {% endif %} -
-{% endblock %} \ No newline at end of file + +
+ {% if article.photo_image and SHOW_BOTTOM_IMAGE == True %} + + {% endif %} + {% if ARTICLE_FOOTER == true %} + {% include 'include/article_footer.html' %} + {% endif %} + +{% endblock %} diff --git a/templates/articles_list_page.html b/templates/articles_list_page.html deleted file mode 100644 index 7af9ca8..0000000 --- a/templates/articles_list_page.html +++ /dev/null @@ -1,12 +0,0 @@ -{% extends "base.html" %} - -{% block content %} -
-
-

{% block header %}{% endblock %}

-
- - {% include 'include/paginated_posts.html' %} - -
-{% endblock content %} \ No newline at end of file diff --git a/templates/author.html b/templates/author.html index a190194..06f871d 100644 --- a/templates/author.html +++ b/templates/author.html @@ -1,8 +1,7 @@ {% extends "index.html" %} -{% block title %}{{ SITENAME }} - Articles by {{ author }}{% endblock %} +{% block title %}{{ SITENAME|striptags }} - Articles by {{ author }}{% endblock %} {% block content_title %} -

Articles by {{ author }}

+

Articles by {{ author }}

{% endblock %} - diff --git a/templates/authors.html b/templates/authors.html index 9aee5db..97a7457 100644 --- a/templates/authors.html +++ b/templates/authors.html @@ -1,12 +1,12 @@ {% extends "base.html" %} -{% block title %}{{ SITENAME }} - Authors{% endblock %} +{% block title %}{{ SITENAME|striptags }} - Authors{% endblock %} {% block content %} -

Authors on {{ SITENAME }}

+

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/templates/base.html b/templates/base.html index 1311c5b..dcb3b7d 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,143 +1,214 @@ - - {% block head %} - {% block title %}{{ SITENAME }}{% endblock title %} - {% if FAVICON %} - - {% endif %} - - - - {% if THEME_COLOUR == 1 %} - - {% elif THEME_COLOUR == 0 %} - - {% else %} - - {% endif %} - - {% if FEED_ALL_ATOM %} - - {% endif %} - {% if FEED_ALL_RSS %} - - {% endif %} - {% if FEED_ATOM %} - - {% endif %} - {% if FEED_RSS %} - - {% endif %} - {% if CATEGORY_FEED_ATOM and category %} - - {% endif %} - {% if CATEGORY_FEED_RSS and category %} - - {% endif %} - {% if TAG_FEED_ATOM and tag %} - - {% endif %} - {% if TAG_FEED_RSS and tag %} - - {% endif %} + + {% block head %} + {% block title %}{{ SITENAME|striptags }}{% endblock title %} + + + - {% if TRACKING == True %} - {% include 'include/trackingcode.html' %} - {% endif %} + - - -
- {% block content %} - {% endblock %} -
+ {% if SITESUBTITLE %} + + {% endif %} + {% if STYLESHEET_URL %} + + {% endif %} + {% if FEED_ALL_ATOM %} + + {% endif %} + {% if FEED_ALL_RSS %} + + {% endif %} + {% if FEED_ATOM %} + + {% endif %} + {% if FEED_RSS %} + + {% endif %} + {% if CATEGORY_FEED_ATOM and category %} + + {% endif %} + {% if CATEGORY_FEED_RSS and category %} + + {% endif %} + {% if TAG_FEED_ATOM and tag %} + + {% endif %} + {% if TAG_FEED_RSS and tag %} + + {% endif %} - + {% if TRACKING == True %} + {% include 'include/trackingcode.html' %} + {% endif %} + + {% endblock head %} + {% block somemorehead %} + {% endblock somemorehead %} - - {% include 'include/sidebar.html' %} + {% if USE_LIGHTBOX == True %} + {% if (article and article.photo_gallery) or (articles_page and articles_page.object_list[0].photo_gallery) %} + + {% endif %} + {% endif %} + + + + + + +
+
+

{{ SITENAME }}

{% if SITESUBTITLE %}

{{ SITESUBTITLE }}

{% endif %}
+ {% if BIO_IMAGE %} + + {% endif %} + +
+
+ {% block content %} + {% endblock %} +
+ +
+ {% if LINKS %} + + {% endif %} + + {% if SOCIAL %} + + {% endif %} + + {% if FEED_ALL_ATOM %} + + {% endif %} +
+

© Jeff Mackinnon. All rights reserved.
+ + {% if POWEREDBY == True %}Proudly powered by Pelican, which takes great advantage of Python.{% endif %} +

+ {% if SITELICENSE %} + {{ SITELICENSE }} + {% endif %} +
+
+ + {% if USE_LIGHTBOX == True %} + {% if (article and article.photo_gallery) or (articles_page and articles_page.object_list[0].photo_gallery) %} + + + + + + + {% endif %} + {% endif %}
- - - - - - - -{% if IMAGETRACKINGCODE %} -{{ IMAGETRACKINGCODE }} -{% endif %} - -{% if USE_LIGHTBOX == True %} -{% if (article and article.photo_gallery) or (articles_page and articles_page.object_list[0].photo_gallery) %} - - - - - - -{% endif %} -{% endif %} - + diff --git a/templates/categories.html b/templates/categories.html index 7999de4..c723f8a 100644 --- a/templates/categories.html +++ b/templates/categories.html @@ -1,12 +1,12 @@ {% extends "base.html" %} -{% block title %}{{ SITENAME }} - Categories{% endblock %} +{% block title %}{{ SITENAME|striptags }} - Categories{% endblock %} {% block content %} -

Categories on {{ SITENAME }}

+

Categories on {{ SITENAME }}

    - {% for category, articles in categories|sort %} -
  • {{ category }} ({{ articles|count }})
  • - {% endfor %} + {% for category, articles in categories|sort %} +
  • {{ category }} ({{ articles|count }})
  • + {% endfor %}
{% endblock %} diff --git a/templates/category.html b/templates/category.html index 8ced1fa..bfad391 100644 --- a/templates/category.html +++ b/templates/category.html @@ -1,9 +1,7 @@ -{% extends "articles_list_page.html" %} +{% extends "index.html" %} -{% block title %}{{ category }}{% endblock %} +{% block title %}{{ SITENAME|striptags }} - {{ category }} category{% endblock %} -{% block meta_description %} - +{% block content_title %} +

Articles in the {{ category }} category

{% endblock %} - -{% block header %}All posts in category: {{ category }}{% endblock %} \ No newline at end of file diff --git a/templates/include/article_footer.html b/templates/include/article_footer.html index eb43c09..21b3006 100644 --- a/templates/include/article_footer.html +++ b/templates/include/article_footer.html @@ -1,15 +1,5 @@ \ No newline at end of file diff --git a/templates/include/cornerstone.html b/templates/include/cornerstone.html deleted file mode 100644 index 978ffae..0000000 --- a/templates/include/cornerstone.html +++ /dev/null @@ -1,55 +0,0 @@ - - -
-

Cornerstone Content

-
-
-
-
-

Electrical Safety

-
- -
Electrical safety is a nebulous thing, but we define it as the set of systems designed to lower the risks associated with the electrical hazards of shock, arc flash and arc blast, to an acceptable level. In our day-to-day life this is handled for us
-
- -
-
- -
-
-

Solar Design

-
- -

This page we will focus on PV solar, however concepts like solar angles, radiation vs irradiation, etc will be helpful regardless of type.

- - Before getting into the details like off-grid vs grid connected, power draw, VOC, etc; I want to introduce some of the basic concepts starting with solar angles.

-
- -
-
- - - - - - - -
- - diff --git a/templates/include/links.html b/templates/include/links.html index 182c4ad..1ac1ae6 100644 --- a/templates/include/links.html +++ b/templates/include/links.html @@ -8,19 +8,47 @@ {% endif %} - - {% if THEME_COLOUR == 1 %} - - {% elif THEME_COLOUR == 0 %} - - {% else %} - - {% endif %} {% if TRACKING == True %} {% include 'include/trackingcode.html' %} {% endif %} {% endblock head %} + @@ -30,35 +58,26 @@ {% import 'translations.html' as translations with context %} {{ translations.translations_for(page) }} - + {% if BIO_IMAGE %} + + {% endif %} + diff --git a/templates/include/paginated_posts.html b/templates/include/paginated_posts.html deleted file mode 100644 index 1d489c4..0000000 --- a/templates/include/paginated_posts.html +++ /dev/null @@ -1,45 +0,0 @@ -
- {% for article in articles_page.object_list %} -
- {% if INCLUDE_IMAGE == True %} - {% if article.photo_image %} - - {% endif %} - {% endif %} - {% if (article.category != MICROBLOG ) %} - {% if INCLUDE_TITLE != False %} -
-

{{ article.title }}

-
- {% endif %} - {% endif %} - {% if (article.category != MICROBLOG)%} - {% if INCLUDE_SUMMARY != False %} -
{{ article.summary }}
- {% if INCLUDE_CATEGORY == True %} - {% if article.category %} -
- Posted in: {{ article.category }} -
- {% endif %} - {% endif %} - {% endif %} - {% if MOREBUTTON == True %} -
- -
- {% endif %} - - {% endif %} -
- {% endfor %} - -
- -
- {% if articles_page.has_other_pages() %} - {% include 'include/pagination.html' %} - {% endif %} -
\ No newline at end of file diff --git a/templates/include/sidebar.html b/templates/include/sidebar.html deleted file mode 100644 index 481f757..0000000 --- a/templates/include/sidebar.html +++ /dev/null @@ -1,190 +0,0 @@ - diff --git a/templates/index.html b/templates/index.html index 2f67915..acebb49 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,54 +1,37 @@ {% extends "base.html" %} {% block content %} -{% if MINIMAL == True %} -{% include 'include/minimal_homepage.html' %} + {% block content_title %} +

All articles

+ {% endblock %} -{% else%} -{% if BANNER == True %} - - -{% endif %} + {% endif %} + {{ article.summary }} +
+ + + {% endfor %} -{% if CORNERSTONE_CONTENT == True %} - -
- {% include 'include/cornerstone.html' %} -
-
-
-{% endif %} + {% if articles_page.has_other_pages() %} + {% include 'pagination.html' %} + {% endif %} -{% if NEWSLETTER %} - -{% endif %} - -
-{% block content_title %} -
-

Articles

-
-{% endblock %} -{% include 'include/paginated_posts.html' %} -
-{% endif %} {% endblock content %} diff --git a/templates/page.html b/templates/page.html index 1d5b9ad..ff5577b 100644 --- a/templates/page.html +++ b/templates/page.html @@ -5,13 +5,13 @@ {% extends "base.html" %} {% block html_lang %}{{ page.lang }}{% endblock %} -{% block title %}{{ SITENAME }} - {{ page.title|striptags }}{%endblock%} +{% block title %}{{ SITENAME|striptags }} - {{ page.title|striptags }}{%endblock%} {% block head %} {% if page.status == "hidden" %} - - - + + + {% endif %} {{ super() }} @@ -23,35 +23,32 @@ - + {% endblock %} - {% block somemorehead %} - {% if page.specialcss %} +{% if page.specialcss %} - {% endif %} - +{% endif %} {% endblock somemorehead %} -
-{% block content %} -
-

{{ page.title }}

+{% block content %} +
+
+

{{ page.title }}

+
{% import 'translations.html' as translations with context %} {{ translations.translations_for(page) }} -
-
- {{ page.content }} {% if page.modified %} -
-

Last updated: {{ page.locale_modified }}

-
+
+

+ Last updated: {{ page.locale_modified }} +

+
{% endif %} -
-
+ {% endblock %} {% endif %} diff --git a/templates/pagination.html b/templates/pagination.html new file mode 100644 index 0000000..9511fdb --- /dev/null +++ b/templates/pagination.html @@ -0,0 +1,17 @@ +{% if DEFAULT_PAGINATION %} + {% set first_page = articles_paginator.page(1) %} + {% set last_page = articles_paginator.page(articles_paginator.num_pages) %} + +{% endif %} diff --git a/templates/period_archives.html b/templates/period_archives.html index 239be5f..181f493 100644 --- a/templates/period_archives.html +++ b/templates/period_archives.html @@ -1,10 +1,14 @@ {% extends "base.html" %} -{% block title %}{{ SITENAME }} - {{ period | reverse | join(' ') }} archives{% endblock %} +{% block title %}{{ SITENAME|striptags }} - {{ period | reverse | join(' ') }} archives{% endblock %} {% block content %} -

Archives for {{ period | reverse | join(' ') }}

- -{% include 'include/archive_list.html' %} +

Archives for {{ period | reverse | join(' ') }}

+
+ {% for article in dates %} +
{{ article.locale_date }}
+
{{ article.title }}
+ {% endfor %} +
{% endblock %} diff --git a/templates/tag.html b/templates/tag.html index 398d71a..be21778 100644 --- a/templates/tag.html +++ b/templates/tag.html @@ -1,9 +1,7 @@ -{% extends "articles_list_page.html" %} +{% extends "index.html" %} -{% block title %}{{ SITENAME }} - {{ tag }} tag{% endblock %} +{% block title %}{{ SITENAME|striptags }} - {{ tag }} tag{% endblock %} -{% block meta_description %} - +{% block content_title %} +

Articles tagged with {{ tag }}

{% endblock %} - -{% block header %}All posts tagged: {{ tag }}{% endblock %} \ No newline at end of file diff --git a/templates/tags.html b/templates/tags.html index b90b0ac..b21e5b5 100644 --- a/templates/tags.html +++ b/templates/tags.html @@ -1,12 +1,12 @@ {% extends "base.html" %} -{% block title %}{{ SITENAME }} - Tags{% endblock %} +{% block title %}{{ SITENAME|striptags }} - Tags{% endblock %} {% block content %} -

Tags for {{ SITENAME }}

+

Tags for {{ SITENAME }}

{% endblock %} diff --git a/templates/translations.html b/templates/translations.html index f0e2478..eed0703 100644 --- a/templates/translations.html +++ b/templates/translations.html @@ -1,16 +1,16 @@ {% macro translations_for(article) %} -{% if article.translations %} -Translations: -{% for translation in article.translations %} -{{ translation.lang }} -{% endfor %} -{% endif %} + {% if article.translations %} + Translations: + {% for translation in article.translations %} + {{ translation.lang }} + {% endfor %} + {% endif %} {% endmacro %} {% macro entry_hreflang(entry) %} -{% if entry.translations %} - {% for translation in entry.translations %} - - {% endfor %} -{% endif %} + {% if entry.translations %} + {% for translation in entry.translations %} + + {% endfor %} + {% endif %} {% endmacro %}