From fd1a4eaba46c1def74bd6905bce15c61bb326ed5 Mon Sep 17 00:00:00 2001 From: Daan Debie Date: Mon, 27 Jan 2014 23:38:37 +0100 Subject: Updated pelican-bootstrap to v1.2 --- pelican-bootstrap3/templates/archives.html | 10 +++ pelican-bootstrap3/templates/article.html | 21 +++++- pelican-bootstrap3/templates/base.html | 80 +++++++++++----------- pelican-bootstrap3/templates/categories.html | 33 +++++++-- pelican-bootstrap3/templates/category.html | 11 ++- .../templates/includes/article_info.html | 7 +- .../templates/includes/cc-license.html | 64 +++++++++++++++++ .../templates/includes/comment_count.html | 2 +- .../templates/includes/comments.html | 9 ++- pelican-bootstrap3/templates/includes/footer.html | 28 +++++--- .../templates/includes/github-js.html | 33 +++++++++ pelican-bootstrap3/templates/includes/github.html | 39 +---------- pelican-bootstrap3/templates/includes/links.html | 13 ++++ pelican-bootstrap3/templates/includes/piwik.html | 20 ++++++ .../templates/includes/related-posts.html | 10 +++ pelican-bootstrap3/templates/includes/sidebar.html | 37 ++++++---- .../templates/includes/translations.html | 2 + pelican-bootstrap3/templates/index.html | 5 +- pelican-bootstrap3/templates/page.html | 14 +++- pelican-bootstrap3/templates/tag.html | 11 ++- pelican-bootstrap3/templates/tags.html | 34 +++++++-- 21 files changed, 361 insertions(+), 122 deletions(-) create mode 100644 pelican-bootstrap3/templates/includes/cc-license.html create mode 100644 pelican-bootstrap3/templates/includes/github-js.html create mode 100644 pelican-bootstrap3/templates/includes/links.html create mode 100644 pelican-bootstrap3/templates/includes/piwik.html create mode 100644 pelican-bootstrap3/templates/includes/related-posts.html (limited to 'pelican-bootstrap3/templates') diff --git a/pelican-bootstrap3/templates/archives.html b/pelican-bootstrap3/templates/archives.html index 927dde0..abfe51f 100644 --- a/pelican-bootstrap3/templates/archives.html +++ b/pelican-bootstrap3/templates/archives.html @@ -1,4 +1,14 @@ {% extends "base.html" %} +{% block title %}Archives - {{ SITENAME }}{% endblock %} +{% block breadcrumbs %} + {% if DISPLAY_BREADCRUMBS %} + + {% endif %} +{% endblock %} + {% block content %}

Archives for {{ SITENAME }}

diff --git a/pelican-bootstrap3/templates/article.html b/pelican-bootstrap3/templates/article.html index 5b35765..e1f7f00 100644 --- a/pelican-bootstrap3/templates/article.html +++ b/pelican-bootstrap3/templates/article.html @@ -1,5 +1,23 @@ {% extends "base.html" %} -{% block title %}{{ article.title|striptags }}{% endblock %} +{% block title %}{{ article.title|striptags }} - {{ SITENAME }}{% endblock %} + +{% block breadcrumbs %} + {% if DISPLAY_BREADCRUMBS %} + {% if DISPLAY_CATEGORY_IN_BREADCRUMBS %} + + {% else %} + + {% endif %} + {% endif %} +{% endblock %} + {% block content %}
@@ -21,6 +39,7 @@ {{ article.content }} + {% include 'includes/related-posts.html' %} {% include 'includes/addthis.html' %} {% include 'includes/comments.html' %}
diff --git a/pelican-bootstrap3/templates/base.html b/pelican-bootstrap3/templates/base.html index 580db39..9be2ecb 100644 --- a/pelican-bootstrap3/templates/base.html +++ b/pelican-bootstrap3/templates/base.html @@ -8,13 +8,17 @@ + + {% if FAVICON %} + + {% endif %} - + {# Open Graph tags #} {% if USE_OPEN_GRAPH is not defined %} {% set USE_OPEN_GRAPH = True %} {% endif %} - {% if USE_OPEN_GRAPH %} + {% if OPEN_GRAPH_FB_APP_ID %} {% endif %} @@ -35,10 +39,10 @@ {% if OPEN_GRAPH_IMAGE %} + {% endif %} {% endif %} - {% endif %} - {% endif %} + {% if BOOTSTRAP_THEME %} @@ -46,7 +50,8 @@ {% endif %} - + + {% if DOCUTIL_CSS %} {% endif %} @@ -54,8 +59,9 @@ {% endif %} - - + {% if CUSTOM_CSS %} + + {% endif %} {% if FEED_ALL_ATOM %} {% endif %} - {% include 'includes/ga.html' %} - - + +
-
- {% block content %} - {% endblock %} + {% if not HIDE_SIDEBAR %} +
+ {% else %} +
+ {% endif %} + {% block breadcrumbs %} + {% endblock %} + + {% block content %} + {% endblock %}
-
{% include 'includes/footer.html' %} + + -{% include 'includes/disqus_script.html' %} - -{% if PIWIK_SITE_ID and PIWIK_URL %} - {% if PIWIK_SSL_URL is not defined %} - {% set PIWIK_SSL_URL = PIWIK_URL %} - {% endif %} - - - -{% endif %} +{% include 'includes/github-js.html' %} +{% include 'includes/disqus_script.html' %} +{% include 'includes/ga.html' %} +{% include 'includes/piwik.html' %} diff --git a/pelican-bootstrap3/templates/categories.html b/pelican-bootstrap3/templates/categories.html index fe3d6ac..6898f97 100644 --- a/pelican-bootstrap3/templates/categories.html +++ b/pelican-bootstrap3/templates/categories.html @@ -1,13 +1,36 @@ {% extends "base.html" %} -{% block title %}{{ SITENAME }} - Categories{% endblock %} +{% block title %}Categories - {{ SITENAME }}{% endblock %} + +{% block breadcrumbs %} + {% if DISPLAY_BREADCRUMBS %} + + {% endif %} +{% endblock %} {% block content %}
-

Categories for {{ SITENAME }}

- +
+
{% endblock %} diff --git a/pelican-bootstrap3/templates/category.html b/pelican-bootstrap3/templates/category.html index 56f8e93..9cfa5ad 100644 --- a/pelican-bootstrap3/templates/category.html +++ b/pelican-bootstrap3/templates/category.html @@ -1,2 +1,11 @@ {% extends "index.html" %} -{% block title %}{{ SITENAME }} - {{ category }}{% endblock %} +{% block title %}{{ category }} - {{ SITENAME }}{% endblock %} +{% block breadcrumbs %} + {% if DISPLAY_BREADCRUMBS %} + + {% endif %} +{% endblock %} diff --git a/pelican-bootstrap3/templates/includes/article_info.html b/pelican-bootstrap3/templates/includes/article_info.html index 6610aa2..abbf807 100644 --- a/pelican-bootstrap3/templates/includes/article_info.html +++ b/pelican-bootstrap3/templates/includes/article_info.html @@ -1,12 +1,12 @@
Date - {{ article.locale_date }} + {# Uncomment if you want the author shown #} {#{% if article.author %}#} {#By#} - {#{{ article.author }}#} + {# {{ article.author }}#} {#{% endif %}#} {# Uncomment if you want to show Categories#} @@ -20,5 +20,6 @@ {% endif %} {% include 'includes/taglist.html' %} - {% include 'includes/translations.html' %} + {% import 'includes/translations.html' as translations with context %} + {{ translations.translations_for(article) }}
diff --git a/pelican-bootstrap3/templates/includes/cc-license.html b/pelican-bootstrap3/templates/includes/cc-license.html new file mode 100644 index 0000000..5c44993 --- /dev/null +++ b/pelican-bootstrap3/templates/includes/cc-license.html @@ -0,0 +1,64 @@ +{# ------------------------------------------------------------------------ #} +{# Creative Commons license mark generator for Jinja2 templates, including #} +{# Pelican-generated static sites (or blogs). #} +{# ------------------------------------------------------------------------ #} +{# To use, put this file in a location where your template can import it. #} +{# Then import into the template, for example like this: #} +{# {% from '/path/to/where/you/placed/the/file' import cc_license_mark %} #} +{# Then call as simply as {{ cc_license_mark("CC-BY") }}. #} +{# #} +{# If full attribution markup is desired in a Pelican template, the #} +{# attr_props dict can be defaulted to the following when calling the macro:#} +{# attr_props={'title':SITENAME,'name':AUTHOR,'url':SITEURL} +{# ------------------------------------------------------------------------ #} +{# Generate a license mark for Creative Commons licensed content. #} +{# Choose the license either by name (CC-BY, CC-BY-SA, CC-BY-NC-SA, or #} +{# CC-BY-NC-ND), or by its features (allow derivatives: Yes, No, ShareAlike;#} +{# allow commercial reuse: Yes, No). Name, if provided, takes precedence, #} +{# and case is ignored. #} +{# #} +{# Optional: #} +{# br_after_icon: if true put a line break after the license icon #} +{# attr_markup: if true create markup for fulll attribution #} +{# attr_props: if attr_markup, a dict with title, name, and url keys #} +{# specifying how under which title, to which creator, and #} +{# to which URL to attribute the work #} +{# The parameters all mirror the Creative Commone license chooser: #} +{# http://creativecommons.org/choose/ #} +{# ------------------------------------------------------------------------ #} +{# Copyright (c) 1994 Hilmar Lapp, hlapp@drycafe.net. #} +{# Licensed under the terms of the MIT License. #} +{# Source at http://github.com/hlapp/cc-tools. Please fork & contribute. #} +{# ------------------------------------------------------------------------ #} +{% macro cc_license_mark(cc_name, + derivatives, commercial, + br_after_icon=false, + attr_markup=false, + attr_props={}) %} + {% if cc_name %} + {% set cc_name = cc_name|lower|replace("cc-","") %} + {% else %} + {% set cc_name = "by" %} + {% set cc_title_suffix = "" %} + {% if (not commercial) or (commercial|lower == "no") %} + {% set cc_name = cc_name ~ "-nc" %} + {% set cc_title_suffix = "-NonCommercial" %} + {% endif %} + {% if derivatives|lower == "no" %} + {% set cc_name = cc_name ~ "-nd" %} + {% set cc_title_suffix = cc_title_suffix ~ "-NoDerivatives" %} + {% elif derivatives|lower == "sharealike" %} + {% set cc_name = cc_name ~ "-sa" %} + {% set cc_title_suffix = cc_title_suffix ~ "-ShareAlike" %} + {% endif %} + {% endif %} + {% set cc_title, cc_uri, cc_icon = ("Creative Commons Attribution 4.0 InternationalCCSUFFIX License","http://creativecommons.org/licenses/CCNAME/4.0/","http://i.creativecommons.org/l/CCNAME/4.0/80x15.png") %} + Creative Commons License + {% if br_after_img %}
{% endif %} + {% if attr_markup %} + "{{ attr_props['title'] }}" by {{ attr_props['name'] }} is + {% else %} + Content + {% endif %} + licensed under a {{ cc_title|replace('CCSUFFIX',cc_title_suffix) }}, except where indicated otherwise. +{% endmacro %} diff --git a/pelican-bootstrap3/templates/includes/comment_count.html b/pelican-bootstrap3/templates/includes/comment_count.html index 7ebaf20..151c501 100644 --- a/pelican-bootstrap3/templates/includes/comment_count.html +++ b/pelican-bootstrap3/templates/includes/comment_count.html @@ -1 +1 @@ -{% if DISQUS_SITENAME %}

There are comments.

{% endif %} \ No newline at end of file +{% if DISQUS_SITENAME and DISQUS_DISPLAY_COUNTS %}

There are comments.

{% endif %} \ No newline at end of file diff --git a/pelican-bootstrap3/templates/includes/comments.html b/pelican-bootstrap3/templates/includes/comments.html index b16517b..94deef4 100644 --- a/pelican-bootstrap3/templates/includes/comments.html +++ b/pelican-bootstrap3/templates/includes/comments.html @@ -6,8 +6,13 @@ + +{% endif %} \ No newline at end of file diff --git a/pelican-bootstrap3/templates/includes/github.html b/pelican-bootstrap3/templates/includes/github.html index 1d1e7f2..00ea0f3 100644 --- a/pelican-bootstrap3/templates/includes/github.html +++ b/pelican-bootstrap3/templates/includes/github.html @@ -1,46 +1,11 @@ {% if GITHUB_USER %} - {% if GITHUB_REPO_COUNT is not defined %} - {% set GITHUB_REPO_COUNT = 5 %} - {% endif %} - {% if GITHUB_SKIP_FORK is not defined %} - {% set GITHUB_SKIP_FORK = "false" %} - {% else %} - {% if GITHUB_SKIP_FORK %} - {% set GITHUB_SKIP_FORK = "true" %} - {% else %} - {% set GITHUB_SKIP_FORK = "false" %} - {% endif %} - {% endif %} - -
-
    -
  • GitHub Repos

  • +
  • GitHub Repos

    Status updating...

    {% if GITHUB_SHOW_USER_LINK is defined %} @{{ GITHUB_USER }} on GitHub {% endif %} -
- - -
+ {% endif %} \ No newline at end of file diff --git a/pelican-bootstrap3/templates/includes/links.html b/pelican-bootstrap3/templates/includes/links.html new file mode 100644 index 0000000..3286b5a --- /dev/null +++ b/pelican-bootstrap3/templates/includes/links.html @@ -0,0 +1,13 @@ +{% if LINKS %} +
  • Links

    + +
  • +{% endif %} \ No newline at end of file diff --git a/pelican-bootstrap3/templates/includes/piwik.html b/pelican-bootstrap3/templates/includes/piwik.html new file mode 100644 index 0000000..70c45c2 --- /dev/null +++ b/pelican-bootstrap3/templates/includes/piwik.html @@ -0,0 +1,20 @@ +{% if PIWIK_SITE_ID and PIWIK_URL %} + {% if PIWIK_SSL_URL is not defined %} + {% set PIWIK_SSL_URL = PIWIK_URL %} + {% endif %} + + + +{% endif %} \ No newline at end of file diff --git a/pelican-bootstrap3/templates/includes/related-posts.html b/pelican-bootstrap3/templates/includes/related-posts.html new file mode 100644 index 0000000..70a56f3 --- /dev/null +++ b/pelican-bootstrap3/templates/includes/related-posts.html @@ -0,0 +1,10 @@ +{% if article.related_posts %} + +{% endif %} diff --git a/pelican-bootstrap3/templates/includes/sidebar.html b/pelican-bootstrap3/templates/includes/sidebar.html index 9f712b4..ef0fc22 100644 --- a/pelican-bootstrap3/templates/includes/sidebar.html +++ b/pelican-bootstrap3/templates/includes/sidebar.html @@ -6,19 +6,23 @@
      {% if SOCIAL %} -
    • Social

    • - {% for name, link in SOCIAL %} +
    • Social

      + +
    • {% endif %} {% if DISPLAY_RECENT_POSTS_ON_SIDEBAR %} {% if RECENT_POST_COUNT is not defined %} {% set RECENT_POST_COUNT = 5 %} {% endif %} -
    • Recent Posts

    • +
    • Recent Posts

      + +
    • {% endif %} {% if DISPLAY_CATEGORIES_ON_SIDEBAR %} - -
    • Categories

    • +
    • Categories

      +
        {% for cat, null in categories %}
      • - {{ cat }} + {{ cat }}
      • {% endfor %} + {% endif %} {% if DISPLAY_TAGS_ON_SIDEBAR %} -
      • Tags

      • +
      • Tags

        +
          {% for tag in tag_cloud|sort(attribute='1') %}
        • {{ tag.0 }}
        • - {% endfor %} + {% endfor %} +
        +
      • {% endif %} + {% include 'includes/github.html' %} + {% include 'includes/links.html' %} +
    - {% include 'includes/github.html' %} - \ No newline at end of file + + diff --git a/pelican-bootstrap3/templates/includes/translations.html b/pelican-bootstrap3/templates/includes/translations.html index 65c5684..ea693df 100644 --- a/pelican-bootstrap3/templates/includes/translations.html +++ b/pelican-bootstrap3/templates/includes/translations.html @@ -1,6 +1,8 @@ +{% macro translations_for(article) %} {% if article.translations %} Lang {% for translation in article.translations %} {{ translation.lang }} {% endfor %} {% endif %} +{% endmacro %} \ No newline at end of file diff --git a/pelican-bootstrap3/templates/index.html b/pelican-bootstrap3/templates/index.html index ec065e0..b38c0ee 100644 --- a/pelican-bootstrap3/templates/index.html +++ b/pelican-bootstrap3/templates/index.html @@ -5,8 +5,7 @@

    {{ article.title }}

    {{ article.summary }} - {# Uncomment if you want to show comment counts #} - {#{% include 'includes/comment_count.html' %}#} + {% include 'includes/comment_count.html' %} more ...
    @@ -15,4 +14,4 @@ {% endif %} {% include 'includes/pagination.html' %} -{% endblock content %} \ No newline at end of file +{% endblock content %} diff --git a/pelican-bootstrap3/templates/page.html b/pelican-bootstrap3/templates/page.html index a53f3db..179b2d7 100644 --- a/pelican-bootstrap3/templates/page.html +++ b/pelican-bootstrap3/templates/page.html @@ -1,8 +1,20 @@ {% extends "base.html" %} -{% block title %}{{ page.title }}{% endblock %} +{% block title %}{{ page.title }} - {{ SITENAME }}{% endblock %} + +{% block breadcrumbs %} + {% if DISPLAY_BREADCRUMBS %} + + {% endif %} +{% endblock %} + {% block content %}

    {{ page.title }}

    + {% import 'includes/translations.html' as translations with context %} + {{ translations.translations_for(page) }} {% if PDF_PROCESSOR %} get the pdf diff --git a/pelican-bootstrap3/templates/tag.html b/pelican-bootstrap3/templates/tag.html index 68cdcba..9895705 100644 --- a/pelican-bootstrap3/templates/tag.html +++ b/pelican-bootstrap3/templates/tag.html @@ -1,2 +1,11 @@ {% extends "index.html" %} -{% block title %}{{ SITENAME }} - {{ tag }}{% endblock %} +{% block breadcrumbs %} + {% if DISPLAY_BREADCRUMBS %} + + {% endif %} +{% endblock %} +{% block title %}{{ tag }} - {{ SITENAME }}{% endblock %} diff --git a/pelican-bootstrap3/templates/tags.html b/pelican-bootstrap3/templates/tags.html index e2fe903..3f29a36 100644 --- a/pelican-bootstrap3/templates/tags.html +++ b/pelican-bootstrap3/templates/tags.html @@ -1,13 +1,37 @@ {% extends "base.html" %} -{% block title %}{{ SITENAME }} - Tags{% endblock %} + +{% block title %}Tags - {{ SITENAME }}{% endblock %} + +{% block breadcrumbs %} + {% if DISPLAY_BREADCRUMBS %} + + {% endif %} +{% endblock %} {% block content %}

    Tags for {{ SITENAME }}

    - + +
    -{% endblock %} \ No newline at end of file +{% endblock %} -- cgit