diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/analytics.html | 26 | ||||
-rw-r--r-- | templates/archives.html | 13 | ||||
-rw-r--r-- | templates/article.html | 53 | ||||
-rw-r--r-- | templates/article_infos.html | 23 | ||||
-rw-r--r-- | templates/author.html | 2 | ||||
-rw-r--r-- | templates/authors.html | 16 | ||||
-rw-r--r-- | templates/base.html | 83 | ||||
-rw-r--r-- | templates/categories.html | 16 | ||||
-rw-r--r-- | templates/category.html | 2 | ||||
-rw-r--r-- | templates/comments.html | 1 | ||||
-rw-r--r-- | templates/disqus_script.html | 11 | ||||
-rw-r--r-- | templates/github.html | 9 | ||||
-rw-r--r-- | templates/index.html | 65 | ||||
-rw-r--r-- | templates/page.html | 19 | ||||
-rw-r--r-- | templates/period_archives.html | 13 | ||||
-rw-r--r-- | templates/tag.html | 2 | ||||
-rw-r--r-- | templates/taglist.html | 1 | ||||
-rw-r--r-- | templates/tags.html | 16 | ||||
-rw-r--r-- | templates/translations.html | 16 | ||||
-rw-r--r-- | templates/twitter.html | 3 |
20 files changed, 390 insertions, 0 deletions
diff --git a/templates/analytics.html b/templates/analytics.html new file mode 100644 index 0000000..071c77f --- /dev/null +++ b/templates/analytics.html @@ -0,0 +1,26 @@ +{% if GOOGLE_ANALYTICS %} + <script type="text/javascript"> + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) + })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); + + ga('create', '{{GOOGLE_ANALYTICS}}', '{{GA_COOKIE_DOMAIN if GA_COOKIE_DOMAIN else 'auto'}}'); + ga('send', 'pageview'); + </script> +{% endif %} +{% if GAUGES %} + <script type="text/javascript"> + var _gauges = _gauges || []; + (function() { + var t = document.createElement('script'); + t.type = 'text/javascript'; + t.async = true; + t.id = 'gauges-tracker'; + t.setAttribute('data-site-id', '{{GAUGES}}'); + t.src = '//secure.gaug.es/track.js'; + var s = document.getElementsByTagName('script')[0]; + s.parentNode.insertBefore(t, s); + })(); + </script> +{% endif %} diff --git a/templates/archives.html b/templates/archives.html new file mode 100644 index 0000000..f678494 --- /dev/null +++ b/templates/archives.html @@ -0,0 +1,13 @@ +{% extends "base.html" %} +{% block content %} +<section id="content" class="body"> +<h1>Archives for {{ SITENAME }}</h1> + +<dl> +{% for article in dates %} + <dt>{{ article.locale_date }}</dt> + <dd><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></dd> +{% endfor %} +</dl> +</section> +{% endblock %} diff --git a/templates/article.html b/templates/article.html new file mode 100644 index 0000000..6abcb09 --- /dev/null +++ b/templates/article.html @@ -0,0 +1,53 @@ +{% extends "base.html" %} +{% block html_lang %}{{ article.lang }}{% endblock %} +{% block head -%} + {{ super() -}} + {% if article.summary %} + <meta name="description" content="{{ article.summary | striptags | safe | truncate(150) }}" /> + {% endif %} +{% endblock %} + +{% block title %}{{ article.title|striptags }}{% endblock %} + +{% block extra_head %} +{% import 'translations.html' as translations with context %} +{% if translations.entry_hreflang(article) %} + {{ translations.entry_hreflang(article) }} +{% endif %} +{% endblock %} + +{% block content %} +<section id="content" class="body"> + <article> + <header> + <h1 class="entry-title"> + <a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" + title="Permalink to {{ article.title|striptags }}">{{ article.title }}</a></h1> + {% include 'twitter.html' %} + </header> + + <div class="entry-content"> + {% include 'article_infos.html' %} + {{ article.content }} + </div><!-- /.entry-content --> + {% if DISQUS_SITENAME and SITEURL and article.status != "draft" %} + <div class="comments"> + <h2>Comments !</h2> + <div id="disqus_thread"></div> + <script type="text/javascript"> + var disqus_shortname = '{{ DISQUS_SITENAME }}'; + var disqus_identifier = '{{ article.url }}'; + var disqus_url = '{{ SITEURL }}/{{ article.url }}'; + (function() { + var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; + dsq.src = '//{{ DISQUS_SITENAME }}.disqus.com/embed.js'; + (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); + })(); + </script> + <noscript>Please enable JavaScript to view the comments.</noscript> + </div> + {% endif %} + + </article> +</section> +{% endblock %} diff --git a/templates/article_infos.html b/templates/article_infos.html new file mode 100644 index 0000000..172ad85 --- /dev/null +++ b/templates/article_infos.html @@ -0,0 +1,23 @@ +<footer class="post-info"> + <abbr class="published" title="{{ article.date.isoformat() }}"> + Published: {{ article.locale_date }} + </abbr> + {% if article.modified %} + <br /> + <abbr class="modified" title="{{ article.modified.isoformat() }}"> + Updated: {{ article.locale_modified }} + </abbr> + {% endif %} + + {% if article.authors %} + <address class="vcard author"> + By {% for author in article.authors %} + <a class="url fn" href="{{ SITEURL }}/{{ author.url }}">{{ author }}</a> + {% endfor %} + </address> + {% endif %} +<p>In <a href="{{ SITEURL }}/{{ article.category.url }}">{{ article.category }}</a>.</p> +{% include 'taglist.html' %} +{% import 'translations.html' as translations with context %} +{{ translations.translations_for(article) }} +</footer><!-- /.post-info --> diff --git a/templates/author.html b/templates/author.html new file mode 100644 index 0000000..0b37290 --- /dev/null +++ b/templates/author.html @@ -0,0 +1,2 @@ +{% extends "index.html" %} +{% block title %}{{ SITENAME }} - {{ author }}{% endblock %} diff --git a/templates/authors.html b/templates/authors.html new file mode 100644 index 0000000..e61a332 --- /dev/null +++ b/templates/authors.html @@ -0,0 +1,16 @@ +{% extends "base.html" %} + +{% block title %}{{ SITENAME }} - Authors{% endblock %} + +{% block content %} + +<section id="content" class="body"> + <h1>Authors on {{ SITENAME }}</h1> + <ul> + {% for author, articles in authors|sort %} + <li><a href="{{ SITEURL }}/{{ author.url }}">{{ author }}</a> ({{ articles|count }})</li> + {% endfor %} + </ul> +</section> + +{% endblock %} diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..2b30289 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,83 @@ +<!DOCTYPE html> +<html lang="{% block html_lang %}{{ DEFAULT_LANG }}{% endblock html_lang %}"> +<head> + {% block head %} + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <meta name="generator" content="Pelican" /> + <title>{% block title %}{{ SITENAME }}{%endblock%}</title> + <link rel="stylesheet" href="{{ SITEURL }}/{{ THEME_STATIC_DIR }}/css/{{ CSS_FILE }}" /> + {% if FEED_ALL_ATOM %} + <link href="{{ FEED_DOMAIN }}/{% if FEED_ALL_ATOM_URL %}{{ FEED_ALL_ATOM_URL }}{% else %}{{ FEED_ALL_ATOM }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Atom Feed" /> + {% endif %} + {% if FEED_ALL_RSS %} + <link href="{{ FEED_DOMAIN }}/{% if FEED_ALL_RSS_URL %}{{ FEED_ALL_RSS_URL }}{% else %}{{ FEED_ALL_RSS }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} RSS Feed" /> + {% endif %} + {% block extra_head %}{% endblock extra_head %} + {% endblock head %} +</head> + +<body id="index" class="home"> +{% include 'github.html' %} + <header id="banner" class="body"> + <h1><a href="{{ SITEURL }}/">{{ SITENAME }}{% if SITESUBTITLE %} <strong>{{ SITESUBTITLE }}</strong>{% endif %}</a></h1> + <nav><ul> + {% for title, link in MENUITEMS %} + <li><a href="{{ link }}">{{ title }}</a></li> + {% endfor %} + {% if DISPLAY_PAGES_ON_MENU -%} + {% for pg in pages %} + <li{% if pg == page %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ pg.url }}">{{ pg.title }}</a></li> + {% endfor %} + {% endif %} + {% if DISPLAY_CATEGORIES_ON_MENU -%} + {% for cat, null in categories %} + <li{% if cat == category %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ cat.url }}">{{ cat }}</a></li> + {% endfor %} + {% endif %} + </ul></nav> + </header><!-- /#banner --> + {% block content %} + {% endblock %} + <section id="extras" class="body"> + {% if LINKS %} + <div class="blogroll"> + <h2>{{ LINKS_WIDGET_NAME | default('links') }}</h2> + <ul> + {% for name, link in LINKS %} + <li><a href="{{ link }}">{{ name }}</a></li> + {% endfor %} + </ul> + </div><!-- /.blogroll --> + {% endif %} + {% if SOCIAL or FEED_ALL_ATOM or FEED_ALL_RSS %} + <div class="social"> + <h2>{{ SOCIAL_WIDGET_NAME | default('social') }}</h2> + <ul> + {% if FEED_ALL_ATOM %} + <li><a href="{{ FEED_DOMAIN }}/{% if FEED_ALL_ATOM_URL %}{{ FEED_ALL_ATOM_URL }}{% else %}{{ FEED_ALL_ATOM }}{% endif %}" type="application/atom+xml" rel="alternate">atom feed</a></li> + {% endif %} + {% if FEED_ALL_RSS %} + <li><a href="{{ FEED_DOMAIN }}/{% if FEED_ALL_RSS_URL %}{{ FEED_ALL_RSS_URL }}{% else %}{{ FEED_ALL_RSS }}{% endif %}" type="application/rss+xml" rel="alternate">rss feed</a></li> + {% endif %} + + {% for name, link in SOCIAL %} + <li><a href="{{ link }}">{{ name }}</a></li> + {% endfor %} + </ul> + </div><!-- /.social --> + {% endif %} + </section><!-- /#extras --> + + <footer id="contentinfo" class="body"> + <address id="about" class="vcard body"> + Proudly powered by <a href="https://getpelican.com/">Pelican</a>, which takes great advantage of <a href="https://www.python.org/">Python</a>. + </address><!-- /#about --> + + <p>The theme is by <a href="https://www.smashingmagazine.com/2009/08/designing-a-html-5-layout-from-scratch/">Smashing Magazine</a>, thanks!</p> + </footer><!-- /#contentinfo --> + +{% include 'analytics.html' %} +{% include 'disqus_script.html' %} +</body> +</html> diff --git a/templates/categories.html b/templates/categories.html new file mode 100644 index 0000000..07f6290 --- /dev/null +++ b/templates/categories.html @@ -0,0 +1,16 @@ +{% extends "base.html" %} + +{% block title %}{{ SITENAME }} - Categories{% endblock %} + +{% block content %} + +<section id="content" class="body"> + <h1>Categories for {{ SITENAME }}</h1> + <ul> + {% for category, articles in categories|sort %} + <li><a href="{{ SITEURL }}/{{ category.url }}">{{ category }}</a> ({{ articles|count }})</li> + {% endfor %} + </ul> +</section> + +{% endblock %} diff --git a/templates/category.html b/templates/category.html new file mode 100644 index 0000000..56f8e93 --- /dev/null +++ b/templates/category.html @@ -0,0 +1,2 @@ +{% extends "index.html" %} +{% block title %}{{ SITENAME }} - {{ category }}{% endblock %} diff --git a/templates/comments.html b/templates/comments.html new file mode 100644 index 0000000..bb033c0 --- /dev/null +++ b/templates/comments.html @@ -0,0 +1 @@ +{% if DISQUS_SITENAME %}<p>There are <a href="{{ SITEURL }}/{{ article.url }}#disqus_thread">comments</a>.</p>{% endif %} diff --git a/templates/disqus_script.html b/templates/disqus_script.html new file mode 100644 index 0000000..23ec532 --- /dev/null +++ b/templates/disqus_script.html @@ -0,0 +1,11 @@ +{% if DISQUS_SITENAME %} +<script type="text/javascript"> + var disqus_shortname = '{{ DISQUS_SITENAME }}'; + (function () { + var s = document.createElement('script'); s.async = true; + s.type = 'text/javascript'; + s.src = 'https://' + disqus_shortname + '.disqus.com/count.js'; + (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); + }()); +</script> +{% endif %} diff --git a/templates/github.html b/templates/github.html new file mode 100644 index 0000000..ccc401f --- /dev/null +++ b/templates/github.html @@ -0,0 +1,9 @@ +{% if GITHUB_URL %} +<a href="{{ GITHUB_URL }}"> +{% if GITHUB_POSITION != "left" %} +<img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub" /> +{% else %} +<img style="position: absolute; top: 0; left: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_left_white_ffffff.png" alt="Fork me on GitHub" /> +{% endif %} +</a> +{% endif %} diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..14e9c14 --- /dev/null +++ b/templates/index.html @@ -0,0 +1,65 @@ +{% extends "base.html" %} +{% block content_title %}{% endblock %} +{% block content %} +{% if articles %} + {% for article in articles_page.object_list %} + + {# First item #} + {% if loop.first and not articles_page.has_previous() %} + <aside id="featured" class="body"> + <article> + <h1 class="entry-title"><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></h1> + {% include 'article_infos.html' %}{{ article.content }}{% include 'comments.html' %} + </article> + </aside><!-- /#featured --> + {% if loop.length > 1 %} + <section id="content" class="body"> + <h1>Other articles</h1> + <hr /> + <ol id="posts-list" class="hfeed"> + {% endif %} + {# other items #} + {% else %} + {% if loop.first %} + <section id="content" class="body"> + <ol id="posts-list" class="hfeed" start="{{ articles_paginator.per_page -1 }}"> + {% endif %} + <li><article class="hentry"> + <header> + <h1><a href="{{ SITEURL }}/{{ article.url }}" rel="bookmark" + title="Permalink to {{ article.title|striptags }}">{{ article.title }}</a></h1> + </header> + + <div class="entry-content"> + {% include 'article_infos.html' %} + {{ article.summary }} + <a class="readmore" href="{{ SITEURL }}/{{ article.url }}">read more</a> + {% include 'comments.html' %} + </div><!-- /.entry-content --> + </article></li> + {% endif %} + {% if loop.last %} + {% if loop.length > 1 or articles_page.has_other_pages() %} + </ol><!-- /#posts-list --> + {% if articles_page.has_other_pages() %} + {% include 'pagination.html' %} + {% endif %} + </section><!-- /#content --> + {% endif %} + {% endif %} + {% endfor %} +{% else %} +<section id="content" class="body"> + {% if pages %} + <h2>Pages</h2> + <ul> + {% for page in pages %} + <li><a href="{{ SITEURL }}/{{ page.url }}">{{ page.title }}</a></li> + {% endfor %} + </ul> + {% else %} + <p>This site currently has no content.</p> + {% endif %} +</section> +{% endif %} +{% endblock content %} diff --git a/templates/page.html b/templates/page.html new file mode 100644 index 0000000..428c47f --- /dev/null +++ b/templates/page.html @@ -0,0 +1,19 @@ +{% extends "base.html" %} +{% block html_lang %}{{ page.lang }}{% endblock %} +{% block title %}{{ page.title|striptags }}{% endblock %} + +{% block extra_head %} +{% import 'translations.html' as translations with context %} +{% if translations.entry_hreflang(page) %} + {{ translations.entry_hreflang(page) }} +{% endif %} +{% endblock %} + +{% block content %} +<section id="content" class="body"> + <h1 class="entry-title">{{ page.title }}</h1> + {% import 'translations.html' as translations with context %} + {{ translations.translations_for(page) }} + {{ page.content }} +</section> +{% endblock %} diff --git a/templates/period_archives.html b/templates/period_archives.html new file mode 100644 index 0000000..252e002 --- /dev/null +++ b/templates/period_archives.html @@ -0,0 +1,13 @@ +{% extends "base.html" %} +{% block content %} +<section id="content" class="body"> +<h1>Archives for {{ period | reverse | join(' ') }}</h1> + +<dl> +{% for article in dates %} + <dt>{{ article.locale_date }}</dt> + <dd><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></dd> +{% endfor %} +</dl> +</section> +{% endblock %} diff --git a/templates/tag.html b/templates/tag.html new file mode 100644 index 0000000..68cdcba --- /dev/null +++ b/templates/tag.html @@ -0,0 +1,2 @@ +{% extends "index.html" %} +{% block title %}{{ SITENAME }} - {{ tag }}{% endblock %} diff --git a/templates/taglist.html b/templates/taglist.html new file mode 100644 index 0000000..58f3557 --- /dev/null +++ b/templates/taglist.html @@ -0,0 +1 @@ +{% if article.tags %}<p>tags: {% for tag in article.tags %}<a href="{{ SITEURL }}/{{ tag.url }}">{{ tag | escape }}</a> {% endfor %}</p>{% endif %} diff --git a/templates/tags.html b/templates/tags.html new file mode 100644 index 0000000..fb09955 --- /dev/null +++ b/templates/tags.html @@ -0,0 +1,16 @@ +{% extends "base.html" %} + +{% block title %}{{ SITENAME }} - Tags{% endblock %} + +{% block content %} + +<section id="content" class="body"> + <h1>Tags for {{ SITENAME }}</h1> + <ul> + {% for tag, articles in tags|sort %} + <li><a href="{{ SITEURL }}/{{ tag.url }}">{{ tag }}</a> ({{ articles|count }})</li> + {% endfor %} + </ul> +</section> + +{% endblock %} diff --git a/templates/translations.html b/templates/translations.html new file mode 100644 index 0000000..1eec7c4 --- /dev/null +++ b/templates/translations.html @@ -0,0 +1,16 @@ +{% macro translations_for(article) %} +{% if article.translations %} +Translations: + {% for translation in article.translations %} + <a href="{{ SITEURL }}/{{ translation.url }}" hreflang="{{ translation.lang }}">{{ translation.lang }}</a> + {% endfor %} +{% endif %} +{% endmacro %} + +{% macro entry_hreflang(entry) %} +{% if entry.translations %} + {% for translation in entry.translations %} + <link rel="alternate" hreflang="{{ translation.lang }}" href="{{ SITEURL }}/{{ translation.url }}"> + {% endfor %} +{% endif %} +{% endmacro %} diff --git a/templates/twitter.html b/templates/twitter.html new file mode 100644 index 0000000..bf78c32 --- /dev/null +++ b/templates/twitter.html @@ -0,0 +1,3 @@ +{% if TWITTER_USERNAME %} +<a href="https://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="{{TWITTER_USERNAME}}">Tweet</a><script type="text/javascript" src="https://platform.twitter.com/widgets.js"></script> +{% endif %} |