diff options
| author | 2014-06-13 21:51:02 -0300 | |
|---|---|---|
| committer | 2014-06-13 21:51:02 -0300 | |
| commit | 58c4878526dec5510f23c812274686787d8724ba (patch) | |
| tree | 5f2374bc17adb10e15f7e5b4576595d9cc2ef17e /nikola/data/themes/base-jinja | |
| parent | fa50632a9d87c3989566fed3e49c160a132e0d14 (diff) | |
Imported Upstream version 7.0.1upstream/7.0.1
Diffstat (limited to 'nikola/data/themes/base-jinja')
35 files changed, 998 insertions, 0 deletions
diff --git a/nikola/data/themes/base-jinja/AUTHORS.txt b/nikola/data/themes/base-jinja/AUTHORS.txt new file mode 100644 index 0000000..043d497 --- /dev/null +++ b/nikola/data/themes/base-jinja/AUTHORS.txt @@ -0,0 +1 @@ +Roberto Alsina <https://github.com/ralsina> diff --git a/nikola/data/themes/base-jinja/README.md b/nikola/data/themes/base-jinja/README.md new file mode 100644 index 0000000..5d1da94 --- /dev/null +++ b/nikola/data/themes/base-jinja/README.md @@ -0,0 +1,4 @@ +This theme has almost no styling, it's meant as a basis from which other +themes can be developed. + +Therefore, most "advanced" features, such as slides or galleries, are broken. diff --git a/nikola/data/themes/base-jinja/bundles b/nikola/data/themes/base-jinja/bundles new file mode 100644 index 0000000..4760181 --- /dev/null +++ b/nikola/data/themes/base-jinja/bundles @@ -0,0 +1,2 @@ +assets/css/all.css=rst.css,code.css,theme.css +assets/css/all-nocdn.css=rst.css,code.css,theme.css diff --git a/nikola/data/themes/base-jinja/engine b/nikola/data/themes/base-jinja/engine new file mode 100644 index 0000000..6f04b30 --- /dev/null +++ b/nikola/data/themes/base-jinja/engine @@ -0,0 +1 @@ +jinja diff --git a/nikola/data/themes/base-jinja/parent b/nikola/data/themes/base-jinja/parent new file mode 100644 index 0000000..df967b9 --- /dev/null +++ b/nikola/data/themes/base-jinja/parent @@ -0,0 +1 @@ +base diff --git a/nikola/data/themes/base-jinja/templates/annotation_helper.tmpl b/nikola/data/themes/base-jinja/templates/annotation_helper.tmpl new file mode 100644 index 0000000..86d09b2 --- /dev/null +++ b/nikola/data/themes/base-jinja/templates/annotation_helper.tmpl @@ -0,0 +1,16 @@ +{% macro css() %} + <link rel="stylesheet" href="http://assets.annotateit.org/annotator/v1.2.5/annotator.min.css"> +{% endmacro %} + +{% macro code() %} + <script src="http://code.jquery.com/jquery-migrate-1.2.1.js"></script> + <script src="http://assets.annotateit.org/annotator/v1.2.7/annotator-full.js"></script> + <script> + jQuery(function ($) { + $('body').annotator().annotator('setupPlugins', {}, { + // Disable filter bar + Filter: false + }); + }); + </script> +{% endmacro %} diff --git a/nikola/data/themes/base-jinja/templates/base.tmpl b/nikola/data/themes/base-jinja/templates/base.tmpl new file mode 100644 index 0000000..2b15177 --- /dev/null +++ b/nikola/data/themes/base-jinja/templates/base.tmpl @@ -0,0 +1,25 @@ +{# -*- coding: utf-8 -*- #} +{% import 'base_helper.tmpl' as base with context %} +{% import 'base_header.tmpl' as header with context %} +{% import 'base_footer.tmpl' as footer with context %} +{% import 'annotation_helper.tmpl' as annotations with context %} +{{ set_locale(lang) }} +{{ base.html_headstart() }} +{% block extra_head %} +{# Leave this block alone. #} +{% endblock %} +{{ template_hooks['extra_head']() }} +</head> +<body> + <div id="container"> + {{ header.html_header() }} + <main id="content"> + {% block content %}{% endblock %} + </main> + {{ footer.html_footer() }} + </div> + {{ body_end }} + {{ template_hooks['body_end']() }} + {{ base.late_load_js() }} +</body> +</html> diff --git a/nikola/data/themes/base-jinja/templates/base_footer.tmpl b/nikola/data/themes/base-jinja/templates/base_footer.tmpl new file mode 100644 index 0000000..7fcf616 --- /dev/null +++ b/nikola/data/themes/base-jinja/templates/base_footer.tmpl @@ -0,0 +1,11 @@ +{# -*- coding: utf-8 -*- #} +{% import 'base_helper.tmpl' as base with context %} + +{% macro html_footer() %} + {% if content_footer %} + <footer id="footer" role="contentinfo"> + <p>{{ content_footer }}</p> + {{ template_hooks['page_footer']() }} + </footer> + {% endif %} +{% endmacro %} diff --git a/nikola/data/themes/base-jinja/templates/base_header.tmpl b/nikola/data/themes/base-jinja/templates/base_header.tmpl new file mode 100644 index 0000000..1001db3 --- /dev/null +++ b/nikola/data/themes/base-jinja/templates/base_header.tmpl @@ -0,0 +1,66 @@ +{# -*- coding: utf-8 -*- #} +{% import 'base_helper.tmpl' as base with context %} + +{% macro html_header() %} + <header id="header" role="banner"> + {{ html_site_title() }} + {{ html_translation_header() }} + {{ html_navigation_links() }} + {% if search_form %} + <div class="searchform" role="search"> + {{ search_form }} + </div> + {% endif %} + </header> + {{ template_hooks['page_header']() }} +{% endmacro %} + +{% macro html_site_title() %} + <h1 id="brand"><a href="{{ abs_link('/') }}" title="{{ blog_title }}" rel="home"> + {% if logo_url %} + <img src="{{ logo_url }}" alt="{{ blog_title }}" id="logo"> + {% endif %} + + {% if show_blog_title %} + <span id="blog-title">{{ blog_title }}</span> + {% endif %} + </a></h1> +{% endmacro %} + +{% macro html_navigation_links() %} + <nav id="menu" role="navigation"> + <ul> + {% for url, text in navigation_links[lang] %} + {% if url is mapping %} + <li> {{ text }} + <ul> + {% for suburl, text in url %} + {% if rel_link(permalink, suburl) == "#" %} + <li class="active"><a href="{{ permalink }}">{{ text }}</a></li> + {% else %} + <li><a href="{{ suburl }}">{{ text }}</a></li> + {% endif %} + {% endfor %} + </ul> + {% else %} + {% if rel_link(permalink, url) == "#" %} + <li class="active"><a href="{{ permalink }}">{{ text }}</a></li> + {% else %} + <li><a href="{{ url }}">{{ text }}</a></li> + {% endif %} + {% endif %} + {% endfor %} + {{ template_hooks['menu']() }} + {{ template_hooks['menu_alt']() }} + </ul> + </nav> +{% endmacro %} + +{% macro html_translation_header() %} + {% if translations|length > 1 %} + <div id="toptranslations"> + <h2>{{ messages("Languages:") }}</h2> + {{ base.html_translations() }} + </div> + {% endif %} +{% endmacro %} diff --git a/nikola/data/themes/base-jinja/templates/base_helper.tmpl b/nikola/data/themes/base-jinja/templates/base_helper.tmpl new file mode 100644 index 0000000..2dda87b --- /dev/null +++ b/nikola/data/themes/base-jinja/templates/base_helper.tmpl @@ -0,0 +1,103 @@ +{# -*- coding: utf-8 -*- #} + +{% macro html_headstart() %} +<!DOCTYPE html> +<html + +{% if use_open_graph or (twitter_card and twitter_card['use_twitter_cards']) or (comment_system == 'facebook') %} +prefix=' +{% if use_open_graph or (twitter_card and twitter_card['use_twitter_cards']) %} +og: http://ogp.me/ns# +{% endif %} +{% if use_open_graph %} +article: http://ogp.me/ns/article# +{% endif %} +{% if comment_system == 'facebook' %} +fb: http://ogp.me/ns/fb# +{% endif %} +' +{% endif %} + +{% if is_rtl %} +dir="rtl" +{% endif %} + +lang="{{ lang }}"> + <head> + <meta charset="utf-8"> + {% if description %} + <meta name="description" content="{{ description }}"> + {% endif %} + <meta name="viewport" content="width=device-width"> + <title>{{ title|e }} | {{ blog_title|e }}</title> + + {{ html_stylesheets() }} + {{ html_feedlinks() }} + {% if permalink %} + <link rel="canonical" href="{{ abs_link(permalink) }}"> + {% endif %} + + {% if favicons %} + {% for name, file, size in favicons %} + <link rel="{{ name }}" href="{{ file }}" sizes="{{ size }}"/> + {% endfor %} + {% endif %} + + {% if comment_system == 'facebook' %} + <meta property="fb:app_id" content="{{ comment_system_id }}"> + {% endif %} + + {{ mathjax_config }} + {% if use_cdn %} + <!--[if lt IE 9]><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]--> + {% else %} + <!--[if lt IE 9]><script src="/assets/js/html5.js"></script><![endif]--> + {% endif %} + + {{ extra_head_data }} +{% endmacro %} + +{% macro late_load_js() %} + {{ social_buttons_code }} +{% endmacro %} + +{% macro html_stylesheets() %} + {% if use_bundles %} + {% if use_cdn %} + <link href="/assets/css/all.css" rel="stylesheet" type="text/css"> + {% else %} + <link href="/assets/css/all-nocdn.css" rel="stylesheet" type="text/css"> + {% endif %} + {% else %} + <link href="/assets/css/rst.css" rel="stylesheet" type="text/css"> + <link href="/assets/css/code.css" rel="stylesheet" type="text/css"> + <link href="/assets/css/theme.css" rel="stylesheet" type="text/css"> + {% if has_custom_css %} + <link href="/assets/css/custom.css" rel="stylesheet" type="text/css"> + {% endif %} + {% endif %} +{% endmacro %} + +{% macro html_feedlinks() %} + {% if rss_link %} + {{ rss_link }} + {% elif generate_rss %} + {% if translations|length > 1 %} + {% for language in translations %} + <link rel="alternate" type="application/rss+xml" title="RSS ({{ language }})" href="{{ _link('rss', None, language) }}"> + {% endfor %} + {% else %} + <link rel="alternate" type="application/rss+xml" title="RSS" href="{{ _link('rss', None) }}"> + {% endif %} + {% endif %} +{% endmacro %} + +{% macro html_translations() %} + <ul class="translations"> + {% for langname in translations.keys() %} + {% if langname != lang %} + <li><a href="{{ _link("index", None, langname) }}" rel="alternate" hreflang="{{ langname }}">{{ messages("LANGUAGE", langname) }}</a></li> + {% endif %} + {% endfor %} + </ul> +{% endmacro %} diff --git a/nikola/data/themes/base-jinja/templates/comments_helper.tmpl b/nikola/data/themes/base-jinja/templates/comments_helper.tmpl new file mode 100644 index 0000000..aba7294 --- /dev/null +++ b/nikola/data/themes/base-jinja/templates/comments_helper.tmpl @@ -0,0 +1,63 @@ +{# -*- coding: utf-8 -*- #} + +{% import 'comments_helper_disqus.tmpl' as disqus with context %} +{% import 'comments_helper_livefyre.tmpl' as livefyre with context %} +{% import 'comments_helper_intensedebate.tmpl' as intensedebate with context %} +{% import 'comments_helper_muut.tmpl' as muut with context %} +{% import 'comments_helper_googleplus.tmpl' as googleplus with context %} +{% import 'comments_helper_facebook.tmpl' as facebook with context %} +{% import 'comments_helper_isso.tmpl' as isso with context %} + +{% macro comment_form(url, title, identifier) %} + {% if comment_system == 'disqus' %} + {{ disqus.comment_form(url, title, identifier) }} + {% elif comment_system == 'livefyre' %} + {{ livefyre.comment_form(url, title, identifier) }} + {% elif comment_system == 'intensedebate' %} + {{ intensedebate.comment_form(url, title, identifier) }} + {% elif comment_system == 'muut' %} + {{ muut.comment_form(url, title, identifier) }} + {% elif comment_system == 'googleplus' %} + {{ googleplus.comment_form(url, title, identifier) }} + {% elif comment_system == 'facebook' %} + {{ facebook.comment_form(url, title, identifier) }} + {% elif comment_system == 'isso' %} + {{ isso.comment_form(url, title, identifier) }} + {% endif %} +{% endmacro %} + +{% macro comment_link(link, identifier) %} + {% if comment_system == 'disqus' %} + {{ disqus.comment_link(link, identifier) }} + {% elif comment_system == 'livefyre' %} + {{ livefyre.comment_link(link, identifier) }} + {% elif comment_system == 'intensedebate' %} + {{ intensedebate.comment_link(link, identifier) }} + {% elif comment_system == 'muut' %} + {{ muut.comment_link(link, identifier) }} + {% elif comment_system == 'googleplus' %} + {{ googleplus.comment_link(link, identifier) }} + {% elif comment_system == 'facebook' %} + {{ facebook.comment_link(link, identifier) }} + {% elif comment_system == 'isso' %} + {{ isso.comment_link(link, identifier) }} + {% endif %} +{% endmacro %} + +{% macro comment_link_script() %} + {% if comment_system == 'disqus' %} + {{ disqus.comment_link_script() }} + {% elif comment_system == 'livefyre' %} + {{ livefyre.comment_link_script() }} + {% elif comment_system == 'intensedebate' %} + {{ intensedebate.comment_link_script() }} + {% elif comment_system == 'muut' %} + {{ muut.comment_link_script() }} + {% elif comment_system == 'googleplus' %} + {{ googleplus.comment_link_script() }} + {% elif comment_system == 'facebook' %} + {{ facebook.comment_link_script() }} + {% elif comment_system == 'isso' %} + {{ isso.comment_link_script() }} + {% endif %} +{% endmacro %} diff --git a/nikola/data/themes/base-jinja/templates/comments_helper_disqus.tmpl b/nikola/data/themes/base-jinja/templates/comments_helper_disqus.tmpl new file mode 100644 index 0000000..8288bd4 --- /dev/null +++ b/nikola/data/themes/base-jinja/templates/comments_helper_disqus.tmpl @@ -0,0 +1,44 @@ +{# -*- coding: utf-8 -*- #} +<%! + import json + translations = { + 'es': 'es_ES', + } +%> + +{% macro comment_form(url, title, identifier) %} + {% if comment_system_id %} + <div id="disqus_thread"></div> + <script> + var disqus_shortname ="{{ comment_system_id }}", + {% if url %} + disqus_url="{{ url }}", + {% endif %} + disqus_title={{ title|tojson }}, + disqus_identifier="{{ identifier }}", + disqus_config = function () { + this.language = "{{ translations.get(lang, lang) }}"; + }; + (function() { + var dsq = document.createElement('script'); dsq.async = true; + dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js'; + (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); + })(); + </script> + <noscript>Please enable JavaScript to view the <a href="//disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript> + <a href="//disqus.com" class="dsq-brlink" rel="nofollow">Comments powered by <span class="logo-disqus">Disqus</span></a> + {% endif %} +{% endmacro %} + +{% macro comment_link(link, identifier) %} + {% if comment_system_id %} + <a href="{{ link }}#disqus_thread" data-disqus-identifier="{{ identifier }}">Comments</a> + {% endif %} +{% endmacro %} + + +{% macro comment_link_script() %} + {% if comment_system_id %} + <script>var disqus_shortname="{{ comment_system_id }}";(function(){var a=document.createElement("script");a.async=true;a.src="//"+disqus_shortname+".disqus.com/count.js";(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(a)}());</script> + {% endif %} +{% endmacro %} diff --git a/nikola/data/themes/base-jinja/templates/comments_helper_facebook.tmpl b/nikola/data/themes/base-jinja/templates/comments_helper_facebook.tmpl new file mode 100644 index 0000000..21dac2a --- /dev/null +++ b/nikola/data/themes/base-jinja/templates/comments_helper_facebook.tmpl @@ -0,0 +1,62 @@ +{# -*- coding: utf-8 -*- #} +{% macro comment_form(url, title, identifier) %} +<div id="fb-root"></div> +<script> + window.fbAsyncInit = function() { + // init the FB JS SDK + FB.init({ + appId : '{{ comment_system_id }}', + status : true, + xfbml : true + }); + + }; + + // Load the SDK asynchronously + (function(d, s, id){ + var js, fjs = d.getElementsByTagName(s)[0]; + if (d.getElementById(id)) {return;} + js = d.createElement(s); js.id = id; + js.src = "//connect.facebook.net/en_US/all.js"; + fjs.parentNode.insertBefore(js, fjs); + }(document, 'script', 'facebook-jssdk')); +</script> + +<div class="fb-comments" data-href="{{ url }}" data-width="470"></div> +{% endmacro %} + +{% macro comment_link(link, identifier) %} +<span class="fb-comments-count" data-url="{{ link }}"> +{% endmacro %} + +{% macro comment_link_script() %} +<div id="fb-root"></div> +<script> + // thank lxml for this + $('.fb-comments-count').each(function(i, obj) { + var url = obj.attributes['data-url'].value; + // change here if you dislike the default way of displaying + // this + obj.innerHTML = '<fb:comments-count href="' + url + '"></fb:comments-count> comments'; + }); + + window.fbAsyncInit = function() { + // init the FB JS SDK + FB.init({ + appId : '{{ comment_system_id }}', + status : true, + xfbml : true + }); + + }; + + // Load the SDK asynchronously + (function(d, s, id){ + var js, fjs = d.getElementsByTagName(s)[0]; + if (d.getElementById(id)) {return;} + js = d.createElement(s); js.id = id; + js.src = "//connect.facebook.net/en_US/all.js"; + fjs.parentNode.insertBefore(js, fjs); + }(document, 'script', 'facebook-jssdk')); +</script> +{% endmacro %} diff --git a/nikola/data/themes/base-jinja/templates/comments_helper_googleplus.tmpl b/nikola/data/themes/base-jinja/templates/comments_helper_googleplus.tmpl new file mode 100644 index 0000000..cf153e0 --- /dev/null +++ b/nikola/data/themes/base-jinja/templates/comments_helper_googleplus.tmpl @@ -0,0 +1,17 @@ +{# -*- coding: utf-8 -*- #} +{% macro comment_form(url, title, identifier) %} +<script src="https://apis.google.com/js/plusone.js"></script> +<div class="g-comments" + data-href="{{ url }}" + data-first_party_property="BLOGGER" + data-view_type="FILTERED_POSTMOD"> +</div> +{% endmacro %} + +{% macro comment_link(link, identifier) %} +<div class="g-commentcount" data-href="{{ link }}"></div> +<script src="https://apis.google.com/js/plusone.js"></script> +{% endmacro %} + +{% macro comment_link_script() %} +{% endmacro %} diff --git a/nikola/data/themes/base-jinja/templates/comments_helper_intensedebate.tmpl b/nikola/data/themes/base-jinja/templates/comments_helper_intensedebate.tmpl new file mode 100644 index 0000000..042409b --- /dev/null +++ b/nikola/data/themes/base-jinja/templates/comments_helper_intensedebate.tmpl @@ -0,0 +1,25 @@ +{# -*- coding: utf-8 -*- #} +{% macro comment_form(url, title, identifier) %} +<script> +var idcomments_acct = '{{ comment_system_id }}'; +var idcomments_post_id = "{{ identifier }}"; +var idcomments_post_url = "{{ url }}"; +</script> +<span id="IDCommentsPostTitle" style="display:none"></span> +<script src='http://www.intensedebate.com/js/genericCommentWrapperV2.js'></script> +</script> +{% endmacro %} + +{% macro comment_link(link, identifier) %} +<a href="{link}" onclick="this.href='{{ link }}'; this.target='_self';"><span class='IDCommentsReplace' style='display:none'>{{ identifier }}</span> +<script> +var idcomments_acct = '{{ comment_system_id }}'; +var idcomments_post_id = "{{ identifier }}"; +var idcomments_post_url = "{{ link }}"; +</script> +<script src="http://www.intensedebate.com/js/genericLinkWrapperV2.js"></script> +</a> +{% endmacro %} + +{% macro comment_link_script() %} +{% endmacro %} diff --git a/nikola/data/themes/base-jinja/templates/comments_helper_isso.tmpl b/nikola/data/themes/base-jinja/templates/comments_helper_isso.tmpl new file mode 100644 index 0000000..22a9595 --- /dev/null +++ b/nikola/data/themes/base-jinja/templates/comments_helper_isso.tmpl @@ -0,0 +1,20 @@ +{# -*- coding: utf-8 -*- #} +{% macro comment_form(url, title, identifier) %} + {% if comment_system_id %} + <div data-title="{{ title|urlencode }}" id="isso-thread"></div> + <script src="{{ comment_system_id }}js/embed.min.js" data-isso="{{ comment_system_id }}"></script> + {% endif %} +{% endmacro %} + +{% macro comment_link(link, identifier) %} + {% if comment_system_id %} + <a href="{{ link }}#isso-thread">Comments</a> + {% endif %} +{% endmacro %} + + +{% macro comment_link_script() %} + {% if comment_system_id %} + <script src="{{ comment_system_id }}js/count.min.js" data-isso="{{ comment_system_id }}"></script> + {% endif %} +{% endmacro %} diff --git a/nikola/data/themes/base-jinja/templates/comments_helper_livefyre.tmpl b/nikola/data/themes/base-jinja/templates/comments_helper_livefyre.tmpl new file mode 100644 index 0000000..5b01fbf --- /dev/null +++ b/nikola/data/themes/base-jinja/templates/comments_helper_livefyre.tmpl @@ -0,0 +1,33 @@ +{# -*- coding: utf-8 -*- #} +{% macro comment_form(url, title, identifier) %} +<div id="livefyre-comments"></div> +<script src="http://zor.livefyre.com/wjs/v3.0/javascripts/livefyre.js"></script> +<script> +(function () { + var articleId = "{{ identifier }}"; + fyre.conv.load({}, [{ + el: 'livefyre-comments', + network: "livefyre.com", + siteId: "{{ comment_system_id }}", + articleId: articleId, + signed: false, + collectionMeta: { + articleId: articleId, + url: fyre.conv.load.makeCollectionUrl(), + } + }], function() {}); +}()); +</script> +{% endmacro %} + +{% macro comment_link(link, identifier) %} + <a href="{{ link }}"> + <span class="livefyre-commentcount" data-lf-site-id="{{ comment_system_id }}" data-lf-article-id="{{ identifier }}"> + 0 Comments + </span> +{% endmacro %} + + +{% macro comment_link_script() %} +<script src="http://zor.livefyre.com/wjs/v1.0/javascripts/CommentCount.js"></script> +{% endmacro %} diff --git a/nikola/data/themes/base-jinja/templates/comments_helper_mustache.tmpl b/nikola/data/themes/base-jinja/templates/comments_helper_mustache.tmpl new file mode 100644 index 0000000..8912e19 --- /dev/null +++ b/nikola/data/themes/base-jinja/templates/comments_helper_mustache.tmpl @@ -0,0 +1,5 @@ +{# -*- coding: utf-8 -*- #} +{% import 'comments_helper.tmpl' as comments with context %} +{% if not post.meta('nocomments') %} + {{ comments.comment_form(post.permalink(absolute=True), post.title(), post.base_path) }} +{% endif %} diff --git a/nikola/data/themes/base-jinja/templates/comments_helper_muut.tmpl b/nikola/data/themes/base-jinja/templates/comments_helper_muut.tmpl new file mode 100644 index 0000000..79ae523 --- /dev/null +++ b/nikola/data/themes/base-jinja/templates/comments_helper_muut.tmpl @@ -0,0 +1,13 @@ +{# -*- coding: utf-8 -*- #} + +{% macro comment_form(url, title, identifier) %} + <a class="muut" href="https://muut.com/i/{{ comment_system_id }}/{{ identifier }}">{{ comment_system_id }} forums</a> +{% endmacro %} + +{% macro comment_link(link, identifier) %} +{% endmacro %} + + +{% macro comment_link_script() %} +<script src="//cdn.muut.com/1/moot.min.js"></script> +{% endmacro %} diff --git a/nikola/data/themes/base-jinja/templates/crumbs.tmpl b/nikola/data/themes/base-jinja/templates/crumbs.tmpl new file mode 100644 index 0000000..eede9c2 --- /dev/null +++ b/nikola/data/themes/base-jinja/templates/crumbs.tmpl @@ -0,0 +1,13 @@ +{# -*- coding: utf-8 -*- #} + +{% macro bar(crumbs) %} +{% if crumbs %} +<nav class="breadcrumbs"> +<ul class="breadcrumb"> + {% for link, text in crumbs %} + <li><a href="{{ link }}">{{ text }}</a></li> + {% endfor %} +</ul> +</nav> +{% endif %} +{% endmacro %} diff --git a/nikola/data/themes/base-jinja/templates/gallery.tmpl b/nikola/data/themes/base-jinja/templates/gallery.tmpl new file mode 100644 index 0000000..86eea12 --- /dev/null +++ b/nikola/data/themes/base-jinja/templates/gallery.tmpl @@ -0,0 +1,36 @@ +{# -*- coding: utf-8 -*- #} +{% extends 'base.tmpl' %} +{% import 'comments_helper.tmpl' as comments with context %} +{% import 'crumbs.tmpl' as ui with context %} +{% block sourcelink %}{% endblock %} + +{% block content %} + {{ ui.bar(crumbs) }} + {% if title %} + <h1>{{ title }}</h1> + {% endif %} + {% if post %} + <p> + {{ post.text() }} + </p> + {% endif %} + {% if folders %} + <ul> + {% for folder, ftitle in folders %} + <li><a href="{{ folder }}"><i + class="icon-folder-open"></i> {{ ftitle }}</a></li> + {% endfor %} + </ul> + {% endif %} + {% if photo_array %} + <ul class="thumbnails"> + {% for image in photo_array %} + <li><a href="{{ image['url'] }}" class="thumbnail image-reference" title="{{ image['title'] }}"> + <img src="{{ image['url_thumb'] }}" alt="{{ image['title'] }}" /></a> + {% endfor %} + </ul> + {% endif %} +{% if site_has_comments and enable_comments %} + {{ comments.comment_form(None, permalink, title) }} +{% endif %} +{% endblock %} diff --git a/nikola/data/themes/base-jinja/templates/index.tmpl b/nikola/data/themes/base-jinja/templates/index.tmpl new file mode 100644 index 0000000..206fc34 --- /dev/null +++ b/nikola/data/themes/base-jinja/templates/index.tmpl @@ -0,0 +1,34 @@ +{# -*- coding: utf-8 -*- #} +{% import 'index_helper.tmpl' as helper with context %} +{% import 'comments_helper.tmpl' as comments with context %} +{% extends 'base.tmpl' %} + +{% block content %} +<div class="postindex"> +{% for post in posts %} + <article class="h-entry post-{{ post.meta('type') }}"> + <header> + <h1 class="p-name entry-title"><a href="{{ post.permalink() }}" class="u-url">{{ post.title() }}</h1></a> + <div class="metadata"> + <p class="byline author vcard"><span class="byline-name fn">{{ post.author() }}</span></p> + <p class="dateline"><a href="{{ post.permalink() }}" rel="bookmark"><time class="published dt-published" datetime="{{ post.date.isoformat() }}" itemprop="datePublished" title="{{ messages("Publication date") }}">{{ post.formatted_date(date_format) }}</time></a></p> + {% if not post.meta('nocomments') and site_has_comments %} + <p class="commentline">{{ comments.comment_link(post.permalink(), post._base_path) }} + {% endif %} + </div> + </header> + {% if index_teasers %} + <div class="p-summary entry-summary"> + {{ post.text(teaser_only=True) }} + {% else %} + <div class="e-content entry-content"> + {{ post.text(teaser_only=False) }} + {% endif %} + </div> + </article> +{% endfor %} +</div> +{{ helper.html_pager() }} +{{ comments.comment_link_script() }} +{{ helper.mathjax_script(posts) }} +{% endblock %} diff --git a/nikola/data/themes/base-jinja/templates/index_helper.tmpl b/nikola/data/themes/base-jinja/templates/index_helper.tmpl new file mode 100644 index 0000000..2f9e8ea --- /dev/null +++ b/nikola/data/themes/base-jinja/templates/index_helper.tmpl @@ -0,0 +1,27 @@ +{# -*- coding: utf-8 -*- #} +{% macro html_pager() %} + {% if prevlink or nextlink %} + <nav class="postindexpager"> + <ul class="pager"> + {% if prevlink %} + <li class="previous"> + <a href="{{ prevlink }}" rel="prev">{{ messages("Newer posts") }}</a> + </li> + {% endif %} + {% if nextlink %} + <li class="next"> + <a href="{{ nextlink }}" rel="next">{{ messages("Older posts") }}</a> + </li> + {% endif %} + </ul> + </nav> + {% endif %} +{% endmacro %} + +{% macro mathjax_script(posts) %} + {% if posts|selectattr("is_mathjax")|list %} + <script type="text/x-mathjax-config"> + MathJax.Hub.Config({tex2jax: {inlineMath: [['$latex ','$'], ['\\(','\\)']]}});</script> + <script src="/assets/js/mathjax.js"></script> + {% endif %} +{% endmacro %} diff --git a/nikola/data/themes/base-jinja/templates/list.tmpl b/nikola/data/themes/base-jinja/templates/list.tmpl new file mode 100644 index 0000000..e442864 --- /dev/null +++ b/nikola/data/themes/base-jinja/templates/list.tmpl @@ -0,0 +1,19 @@ +{# -*- coding: utf-8 -*- #} +{% extends 'base.tmpl' %} + +{% block content %} +<article class="listpage"> + <header> + <h1>{{ title }}</h1> + </header> + {% if items %} + <ul class="postlist"> + {% for text, link in items %} + <li><a href="{{ link }}">{{ text }}</a> + {% endfor %} + </ul> + {% else %} + <p>{{ messages("Nothing found.") }}</p> + {% endif %} +</article> +{% endblock %} diff --git a/nikola/data/themes/base-jinja/templates/list_post.tmpl b/nikola/data/themes/base-jinja/templates/list_post.tmpl new file mode 100644 index 0000000..b90f237 --- /dev/null +++ b/nikola/data/themes/base-jinja/templates/list_post.tmpl @@ -0,0 +1,19 @@ +{# -*- coding: utf-8 -*- #} +{% extends 'base.tmpl' %} + +{% block content %} +<article class="listpage"> + <header> + <h1>{{ title }}</h1> + </header> + {% if posts %} + <ul class="postlist"> + {% for post in posts %} + <li><a href="{{ post.permalink() }}" class="listtitle">{{ post.title() }}</a> <time class="listdate" datetime="{{ post.date.isoformat() }}" title="{{ messages("Publication date") }}">{{ post.formatted_date(date_format) }}</time></li> + {% endfor %} + </ul> + {% else %} + <p>{{ messages("No posts found.") }}</p> + {% endif %} +</article> +{% endblock %} diff --git a/nikola/data/themes/base-jinja/templates/listing.tmpl b/nikola/data/themes/base-jinja/templates/listing.tmpl new file mode 100644 index 0000000..ccbc5ba --- /dev/null +++ b/nikola/data/themes/base-jinja/templates/listing.tmpl @@ -0,0 +1,23 @@ +{# -*- coding: utf-8 -*- #} +{% extends 'base.tmpl' %} +{% import 'crumbs.tmpl' as ui with context %} +{% block content %} +{{ ui.bar(crumbs) }} +{% if folders or files %} +<ul> +{% for name in folders %} + <li><a href="{{ name }}"><i class="icon-folder-open"></i> {{ name }}</a> +{% endfor %} +{% for name in files %} + <li><a href="{{ name }}.html"><i class="icon-file"></i> {{ name }}</a> +{% endfor %} +</ul> +{% endif %} +{% if code %} + {{ code }} +{% endif %} +{% if source_link %} + <p class="sourceline"><a href="{{ source_link }}" id="sourcelink">{{ messages("Source") }}</a></p> +{% endif %} +{% endblock %} + diff --git a/nikola/data/themes/base-jinja/templates/post.tmpl b/nikola/data/themes/base-jinja/templates/post.tmpl new file mode 100644 index 0000000..75c7690 --- /dev/null +++ b/nikola/data/themes/base-jinja/templates/post.tmpl @@ -0,0 +1,39 @@ +{# -*- coding: utf-8 -*- #} +{% import 'post_helper.tmpl' as helper with context %} +{% import 'post_header.tmpl' as pheader with context %} +{% import 'comments_helper.tmpl' as comments with context %} +{% extends 'base.tmpl' %} + +{% block extra_head %} + {{ super() }} + {% if post.meta('keywords') %} + <meta name="keywords" content="{{ post.meta('keywords')|e }}"> + {% endif %} + <meta name="author" content="{{ post.author() }}"> + {{ helper.open_graph_metadata(post) }} + {{ helper.twitter_card_information(post) }} + {{ helper.meta_translations(post) }} +{% endblock %} + +{% block content %} +<article class="post-{{ post.meta('type') }} h-entry hentry postpage" itemscope="itemscope" itemtype="http://schema.org/Article"> + {{ pheader.html_post_header() }} + <div class="e-content entry-content" itemprop="articleBody text"> + {{ post.text() }} + </div> + <aside class="postpromonav"> + <nav> + {{ helper.html_tags(post) }} + {{ helper.html_pager(post) }} + </nav> + </aside> + {% if not post.meta('nocomments') and site_has_comments %} + <section class="comments"> + <h2>{{ messages("Comments") }}</h2> + {{ comments.comment_form(post.permalink(absolute=True), post.title(), post._base_path) }} + </section> + {% endif %} + {{ helper.mathjax_script(post) }} +</article> +{{ comments.comment_link_script() }} +{% endblock %} diff --git a/nikola/data/themes/base-jinja/templates/post_header.tmpl b/nikola/data/themes/base-jinja/templates/post_header.tmpl new file mode 100644 index 0000000..0ed40b9 --- /dev/null +++ b/nikola/data/themes/base-jinja/templates/post_header.tmpl @@ -0,0 +1,49 @@ +{# -*- coding: utf-8 -*- #} +{% import 'post_helper.tmpl' as helper with context %} +{% import 'comments_helper.tmpl' as comments with context %} + +{% macro html_title() %} +{% if title and not post.meta('hidetitle') %} + <h1 class="p-name entry-title" itemprop="headline name"><a href="{{ post.permalink() }}" class="u-url">{{ title|e }}</a></h1> +{% endif %} +{% endmacro %} + +{% macro html_translations(post) %} + {% if translations|length > 1 %} + <div class="metadata posttranslations translations"> + <h3 class="posttranslations-intro">{{ messages("Also available in:") }}</h3> + {% for langname in translations.keys() %} + {% if langname != lang and post.is_translation_available(langname) %} + <p><a href="{{ post.permalink(langname) }}" rel="alternate" hreflang="{{ langname }}">{{ messages("LANGUAGE", langname) }}</a></p> + {% endif %} + {% endfor %} + </div> + {% endif %} +{% endmacro %} + +{% macro html_sourcelink() %} + {% if show_sourcelink %} + <p class="sourceline"><a href="{{ post.source_link() }}" id="sourcelink">{{ messages("Source") }}</a></p> + {% endif %} +{% endmacro %} + +{% macro html_post_header() %} + <header> + {{ html_title() }} + <div class="metadata"> + <p class="byline author vcard"><span class="byline-name fn">{{ post.author() }}</span></p> + <p class="dateline"><a href="{{ post.permalink() }}" rel="bookmark"><time class="published dt-published" datetime="{{ post.date.isoformat() }}" itemprop="datePublished" title="{{ messages("Publication date") }}">{{ post.formatted_date(date_format) }}</time></a></p> + {% if not post.meta('nocomments') and site_has_comments %} + <p class="commentline">{{ comments.comment_link(post.permalink(), post._base_path) }} + {% endif %} + {{ html_sourcelink() }} + {% if post.meta('link') %} + <p><a href='{{ post.meta('link') }}'>{{ messages("Original site") }}</a></p> + {% endif %} + {% if post.description() %} + <meta name="description" itemprop="description" content="{{ post.description() }}"> + {% endif %} + </div> + {{ html_translations(post) }} + </header> +{% endmacro %} diff --git a/nikola/data/themes/base-jinja/templates/post_helper.tmpl b/nikola/data/themes/base-jinja/templates/post_helper.tmpl new file mode 100644 index 0000000..c695e57 --- /dev/null +++ b/nikola/data/themes/base-jinja/templates/post_helper.tmpl @@ -0,0 +1,76 @@ +{# -*- coding: utf-8 -*- #} + +{% macro meta_translations(post) %} + {% if translations|length > 1 %} + {% for langname in translations.keys() %} + {% if langname != lang and post.is_translation_available(langname) %} + <link rel="alternate" hreflang="{{ langname }}" href="{{ post.permalink(langname) }}"> + {% endif %} + {% endfor %} + {% endif %} +{% endmacro %} + +{% macro html_tags(post) %} + {% if post.tags %} + <ul itemprop="keywords" class="tags"> + {% for tag in post.tags %} + <li><a class="tag p-category" href="{{ _link('tag', tag) }}" rel="tag">{{ tag }}</a></li> + {% endfor %} + </ul> + {% endif %} +{% endmacro %} + +{% macro html_pager(post) %} + {% if post.prev_post or post.next_post %} + <ul class="pager"> + {% if post.prev_post %} + <li class="previous"> + <a href="{{ post.prev_post.permalink() }}" rel="prev" title="{{ post.prev_post.title() }}">{{ messages("Previous post") }}</a> + </li> + {% endif %} + {% if post.next_post %} + <li class="next"> + <a href="{{ post.next_post.permalink() }}" rel="next" title="{{ post.next_post.title() }}">{{ messages("Next post") }}</a> + </li> + {% endif %} + </ul> + {% endif %} +{% endmacro %} + +{% macro open_graph_metadata(post) %} + {% if use_open_graph %} + <meta name="og:title" content="{{ post.title()[:70]|e }}"> + <meta name="og:url" content="{{ abs_link(permalink) }}"> + {% if post.description() %} + <meta name="og:description" content="{{ post.description()[:200]|e }}"> + {% else %} + <meta name="og:description" content="{{ post.text(strip_html=True)[:200]|e }}"> + {% endif %} + <meta name="og:site_name" content="{{ blog_title|e }}"> + <meta name="og:type" content="article"> + {% endif %} +{% endmacro %} + +{% macro twitter_card_information(post) %} + {% if twitter_card and twitter_card['use_twitter_cards'] %} + <meta name="twitter:card" content="{{ twitter_card.get('card', 'summary')|e }}"> + {% if 'site:id' in twitter_card %} + <meta name="twitter:site:id" content="{{ twitter_card['site:id'] }}"> + {% elif 'site' in twitter_card %} + <meta name="twitter:site" content="{{ twitter_card['site'] }}"> + {% endif %} + {% if 'creator:id' in twitter_card %} + <meta name="twitter:creator:id" content="{{ twitter_card['creator:id'] }}"> + {% elif 'creator' in twitter_card %} + <meta name="twitter:creator" content="{{ twitter_card['creator'] }}"> + {% endif %} + {% endif %} +{% endmacro %} + +{% macro mathjax_script(post) %} + {% if post.is_mathjax %} + <script type="text/x-mathjax-config"> + MathJax.Hub.Config({tex2jax: {inlineMath: [['$latex ','$'], ['\\(','\\)']]}});</script> + <script src="/assets/js/mathjax.js"></script> + {% endif %} +{% endmacro %} diff --git a/nikola/data/themes/base-jinja/templates/post_list_directive.tmpl b/nikola/data/themes/base-jinja/templates/post_list_directive.tmpl new file mode 100644 index 0000000..ceaec3f --- /dev/null +++ b/nikola/data/themes/base-jinja/templates/post_list_directive.tmpl @@ -0,0 +1,18 @@ +{# -*- coding: utf-8 -*- #} +{% block content %} +<!-- Begin post-list {{ post_list_id }} --> +<div id="{{ post_list_id }}" class="post-list"> + {% if posts %} + <ul class="post-list"> + {% for post in posts %} + <li class="post-list-item"> + {{ post.formatted_date(date_format) }} + + <a href="{{ post.permalink(lang) }}">{{ post.title(lang) }}</a> + </li> + {% endfor %} + </ul> + {% endif %} +</div> +<!-- End post-list {{ post_list_id }} --> +{% endblock %} diff --git a/nikola/data/themes/base-jinja/templates/slides.tmpl b/nikola/data/themes/base-jinja/templates/slides.tmpl new file mode 100644 index 0000000..0ae8fe8 --- /dev/null +++ b/nikola/data/themes/base-jinja/templates/slides.tmpl @@ -0,0 +1,24 @@ +{% block content %} +<div id="{{ carousel_id }}" class="carousel slide"> + <ol class="carousel-indicators"> + {% for i in range(slides_content|length) %} + {% if i == 0 %} + <li data-target="#{{ carousel_id }}" data-slide-to="{{ i }}" class="active"></li> + {% else %} + <li data-target="#{{ carousel_id }}" data-slide-to="{{ i }}"></li> + {% endif %} + {% endfor %} + </ol> + <div class="carousel-inner"> + {% for i, image in enumerate(slides_content) %} + {% if i == 0 %} + <div class="item active"><img src="{{ image }}" alt="" style="margin: 0 auto 0 auto;"></div> + {% else %} + <div class="item"><img src="{{ image }}" alt="" style="margin: 0 auto 0 auto;"></div> + {% endif %} + {% endfor %} + </div> + <a class="left carousel-control" href="#{{ carousel_id }}" data-slide="prev">‹</a> + <a class="right carousel-control" href="#{{ carousel_id }}" data-slide="next">›</a> +</div> +{% endblock %} diff --git a/nikola/data/themes/base-jinja/templates/story.tmpl b/nikola/data/themes/base-jinja/templates/story.tmpl new file mode 100644 index 0000000..99caaee --- /dev/null +++ b/nikola/data/themes/base-jinja/templates/story.tmpl @@ -0,0 +1,37 @@ +{# -*- coding: utf-8 -*- #} +{% import 'post_helper.tmpl' as helper with context %} +{% import 'post_header.tmpl' as pheader with context %} +{% import 'comments_helper.tmpl' as comments with context %} +{% extends 'post.tmpl' %} + +{% block extra_head %} + {{ super() }} + {% if post.meta('keywords') %} + <meta name="keywords" content="{{ post.meta('keywords')|e }}"> + {% endif %} + <meta name="author" content="{{ post.author() }}"> + {{ helper.open_graph_metadata(post) }} + {{ helper.twitter_card_information(post) }} + {{ helper.meta_translations(post) }} + {% if post.description() %} + <meta name="description" itemprop="description" content="{{ post.description() }}"> + {% endif %} +{% endblock %} + +{% block content %} +<article class="storypage" itemscope="itemscope" itemtype="http://schema.org/Article"> + <header> + {{ pheader.html_title() }} + {{ pheader.html_translations(post) }} + </header> + <div itemprop="articleBody text"> + {{ post.text() }} + </div> + {% if site_has_comments and enable_comments and not post.meta('nocomments') %} + <section class="comments"> + <h2>{{ messages("Comments") }}</h2> + {{ comments.comment_form(post.permalink(absolute=True), post.title(), post.base_path) }} + </section> + {% endif %} +</article> +{% endblock %} diff --git a/nikola/data/themes/base-jinja/templates/tag.tmpl b/nikola/data/themes/base-jinja/templates/tag.tmpl new file mode 100644 index 0000000..84f9e68 --- /dev/null +++ b/nikola/data/themes/base-jinja/templates/tag.tmpl @@ -0,0 +1,40 @@ +{# -*- coding: utf-8 -*- #} +{% extends 'list_post.tmpl' %} + +{% block extra_head %} + {{ super() }} + {% if translations|length > 1 and generate_rss %} + {% for language in translations %} + <link rel="alternate" type="application/rss+xml" type="application/rss+xml" title="RSS for {{ kind }} {{ tag }} ({{ language }})" href="{{ _link(kind + "_rss", tag, language) }}"> + {% endfor %} + {% elif generate_rss %} + <link rel="alternate" type="application/rss+xml" type="application/rss+xml" title="RSS for {{ kind }} {{ tag }}" href="{{ _link(kind + "_rss", tag) }}"> + {% endif %} +{% endblock %} + + +{% block content %} +<article class="tagpage"> + <header> + <h1>{{ title }}</h1> + <div class="metadata"> + {% if translations|length > 1 and generate_rss %} + {% for language in translations %} + <p class="feedlink"> + <a href="{{ _link(kind + "_rss", tag, language) }}" hreflang="{{ language }}" type="application/rss+xml">{{ messages('RSS feed', language) }} ({{ language }})</a> + </p> + {% endfor %} + {% elif generate_rss %} + <p class="feedlink"><a href="{{ _link(kind + "_rss", tag) }}" type="application/rss+xml">{{ messages('RSS feed') }}</a></p> + {% endif %} + </div> + </header> + {% if posts %} + <ul class="postlist"> + {% for post in posts %} + <li><a href="{{ post.permalink() }}" class="listtitle">{{ post.title() }}</a> <time class="listdate" datetime="{{ post.date.isoformat() }}" title="{{ messages("Publication date") }}">{{ post.formatted_date(date_format) }}</time></li> + {% endfor %} + </ul> + {% endif %} +</article> +{% endblock %} diff --git a/nikola/data/themes/base-jinja/templates/tagindex.tmpl b/nikola/data/themes/base-jinja/templates/tagindex.tmpl new file mode 100644 index 0000000..af0a992 --- /dev/null +++ b/nikola/data/themes/base-jinja/templates/tagindex.tmpl @@ -0,0 +1,2 @@ +{# -*- coding: utf-8 -*- #} +{% extends 'index.tmpl' %} diff --git a/nikola/data/themes/base-jinja/templates/tags.tmpl b/nikola/data/themes/base-jinja/templates/tags.tmpl new file mode 100644 index 0000000..7bcb7b2 --- /dev/null +++ b/nikola/data/themes/base-jinja/templates/tags.tmpl @@ -0,0 +1,30 @@ +{# -*- coding: utf-8 -*- #} +{% extends 'base.tmpl' %} + +{% block content %} +<article class="tagindex"> + <header> + <h1>{{ title }}</h1> + </header> + {% if cat_items %} + <h2>{{ messages("Categories") }}</h2> + <ul class="postlist"> + {% for text, link in cat_items %} + {% if text %} + <li><a class="reference" href="{{ link }}">{{ text }}</a></li> + {% endif %} + {% endfor %} + </ul> + {% if items %} + <h2>{{ messages("Tags") }}</h2> + {% endif %} + {% endif %} + {% if items %} + <ul class="postlist"> + {% for text, link in items %} + <li><a class="reference listtitle" href="{{ link }}">{{ text }}</a></li> + {% endfor %} + </ul> + {% endif %} +</article> +{% endblock %} |
