From 8c9a23e374b107d44008be0d671299b3fa0b2f4d Mon Sep 17 00:00:00 2001 From: Raymond Wanyoike Date: Sun, 6 Nov 2016 22:32:20 +0300 Subject: [PATCH] Simplify jinja2 base template, support more options, brew alchemy - Support new realfavicongenerator.net packages (https://realfavicongenerator.net/blog/new-favicon-package-less-is-more/) - Support all possible Pelican feed links - Add recommended HEAD elements (https://github.com/joshbuchea/HEAD) - Use minified css assets - Link to boostrap, clean-blog and font-awesome stylesheets - Add theme options, better options names --- alchemy/templates/base.html | 166 +++++++++++++++++++++----- alchemy/templates/include/footer.html | 10 -- alchemy/templates/include/header.html | 61 ---------- 3 files changed, 133 insertions(+), 104 deletions(-) delete mode 100644 alchemy/templates/include/footer.html delete mode 100644 alchemy/templates/include/header.html diff --git a/alchemy/templates/base.html b/alchemy/templates/base.html index 6d05c87..c441a36 100644 --- a/alchemy/templates/base.html +++ b/alchemy/templates/base.html @@ -3,50 +3,150 @@ {% block head %} - - - - + + + - {% block title %}{{ SITE_SUBTEXT }}{% endblock title %} + {% block title %}— {{ SITENAME }}{% endblock %} + - {% if EXTRA_FAVICON %} - - - - - - {% 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 SHOW_FAVICONS %} + + + + {% endif %} - {% if FEED_ATOM %} - - {% endif %} - {% if FEED_RSS %} - - {% endif %} + + + + - - - - - {% include "include/google_analytics.html" %} + + + {% endblock %} - {% include "include/header.html" %} -
- {% block content %}{% endblock %} +
+
+
+
+ {% if SITE_IMAGE %} + + {% endif %} +
+
+

{{ SITENAME }}

+

{{ SITE_TAGLINE }}

+
+ {% if HEADER_LINKS or SHOW_HEADER_PAGES or EMAIL_ADDRESS or FACEBOOK_ADDRESS or GITHUB_ADDRESS or GOOGLE_ADDRESS or TWITTER_ADDRESS %} +
    + {% if HEADER_LINKS %} + {% for title, link in HEADER_LINKS %} +
  • {{ title }}
  • + {% endfor %} + {% endif %} + {% if SHOW_HEADER_PAGES %} + {% for p in PAGES %} + {% if loop.first %} +
  • |
  • + {% endif %} +
  • {{ p.title }}
  • + {% endfor %} + {% endif %} + {% if EMAIL_ADDRESS or FACEBOOK_ADDRESS or GITHUB_ADDRESS or GOOGLE_ADDRESS or TWITTER_ADDRESS %} +
  • |
  • + {% endif %} + {% if EMAIL_ADDRESS %} +
  • + {% endif %} + {% if FACEBOOK_ADDRESS %} +
  • + {% endif %} + {% if FEED_ALL_ATOM %} +
  • + {% endif %} + {% if GITHUB_ADDRESS %} +
  • + {% endif %} + {% if GOOGLE_ADDRESS %} +
  • + {% endif %} + {% if TWITTER_ADDRESS %} +
  • + {% endif %} +
+ {% endif %} +
+
+
- {% include "include/footer.html" %} - - +
+
+ + {% block content %}{% endblock %} +
+
+ + diff --git a/alchemy/templates/include/footer.html b/alchemy/templates/include/footer.html deleted file mode 100644 index 0bde482..0000000 --- a/alchemy/templates/include/footer.html +++ /dev/null @@ -1,10 +0,0 @@ - diff --git a/alchemy/templates/include/header.html b/alchemy/templates/include/header.html deleted file mode 100644 index 01e51e5..0000000 --- a/alchemy/templates/include/header.html +++ /dev/null @@ -1,61 +0,0 @@ -
-
- {% if PROFILE_IMAGE %} -
- -
- {% endif %} -
-

- {{ SITENAME }} -

-

{{ SITE_SUBTEXT }}

-
    - {% for title, link in MENU_ITEMS %} -
  • {{ title }}
  • - {% endfor %} - {% if PAGES_ON_MENU %} - {% for p in PAGES %} - {% if loop.first %} -
  • |
  • - {% endif %} -
  • {{ p.title }}
  • - {% if loop.last %} -
  • |
  • - {% endif %} - {% endfor %} - {% endif %} - {% if CATEGORIES_ON_MENU %} -
  • Categories
  • -
  • |
  • - {% endif %} - {% if TAGS_ON_MENU %} -
  • Tags
  • -
  • |
  • - {% endif %} - {% if ARCHIVES_ON_MENU %} -
  • Archives
  • -
  • |
  • - {% endif %} - {% if EMAIL_ADDRESS %} -
  • - {% endif %} - {% if GITHUB_ADDRESS %} -
  • - {% endif %} - {% if SO_ADDRESS %} -
  • - {% endif %} - {% if TWITTER_ADDRESS %} -
  • - {% endif %} - {% if FB_ADDRESS %} -
  • - {% endif %} - {% if FEED_ATOM or FEED_RSS %} -
  • - {% endif %} -
-
-
-