diff options
Diffstat (limited to 'nikola/data/themes/base/templates')
| -rw-r--r-- | nikola/data/themes/base/templates/base.tmpl | 2 | ||||
| -rw-r--r-- | nikola/data/themes/base/templates/base_helper.tmpl | 9 | ||||
| -rw-r--r-- | nikola/data/themes/base/templates/comments_helper.tmpl | 14 | ||||
| -rw-r--r-- | nikola/data/themes/base/templates/disqus_helper.tmpl | 22 | ||||
| -rw-r--r-- | nikola/data/themes/base/templates/gallery.tmpl | 8 | ||||
| -rw-r--r-- | nikola/data/themes/base/templates/index.tmpl | 6 | ||||
| -rwxr-xr-x[-rw-r--r--] | nikola/data/themes/base/templates/index_helper.tmpl | 32 | ||||
| -rw-r--r-- | nikola/data/themes/base/templates/isso_helper.tmpl | 20 | ||||
| -rw-r--r-- | nikola/data/themes/base/templates/post.tmpl | 7 | ||||
| -rwxr-xr-x[-rw-r--r--] | nikola/data/themes/base/templates/post_helper.tmpl | 51 | ||||
| -rw-r--r-- | nikola/data/themes/base/templates/tagindex.tmpl | 2 |
11 files changed, 116 insertions, 57 deletions
diff --git a/nikola/data/themes/base/templates/base.tmpl b/nikola/data/themes/base/templates/base.tmpl index 31c1747..7c6cc35 100644 --- a/nikola/data/themes/base/templates/base.tmpl +++ b/nikola/data/themes/base/templates/base.tmpl @@ -21,7 +21,7 @@ lang="${lang}"> <%block name="belowtitle"> %if len(translations) > 1: <small> - ${(messages("Also available in"))}: + ${messages("Also available in:")} ${base.html_translations()} </small> %endif diff --git a/nikola/data/themes/base/templates/base_helper.tmpl b/nikola/data/themes/base/templates/base_helper.tmpl index ac1dea3..880a998 100644 --- a/nikola/data/themes/base/templates/base_helper.tmpl +++ b/nikola/data/themes/base/templates/base_helper.tmpl @@ -21,6 +21,7 @@ <link href="/assets/css/custom.css" rel="stylesheet" type="text/css"> %endif %endif + <link rel="canonical" href="${abs_link(permalink)}"> <!--[if lt IE 9]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script> <![endif]--> @@ -49,7 +50,7 @@ </%def> <%def name="html_social()"> - ${social_buttons_code} + ${social_buttons_code} </%def> <!--FIXME: remove in v7 --> @@ -64,7 +65,7 @@ <ul> %for suburl, text in url: % if rel_link(permalink, suburl) == "#": - <li class="active"><a href="${suburl}">${text}</a> + <li class="active"><a href="${permalink}">${text}</a> %else: <li><a href="${suburl}">${text}</a> %endif @@ -72,7 +73,7 @@ </ul> % else: % if rel_link(permalink, url) == "#": - <li class="active"><a href="${url}">${text}</a> + <li class="active"><a href="${permalink}">${text}</a> %else: <li><a href="${url}">${text}</a> %endif @@ -84,7 +85,7 @@ <%def name="html_translations()"> %for langname in translations.keys(): %if langname != lang: - <a href="${_link("index", None, langname)}">${messages("LANGUAGE", langname)}</a> + <a href="${_link("index", None, langname)}" rel="alternate" hreflang="${langname}">${messages("LANGUAGE", langname)}</a> %endif %endfor </%def> diff --git a/nikola/data/themes/base/templates/comments_helper.tmpl b/nikola/data/themes/base/templates/comments_helper.tmpl index e74a146..d3a2704 100644 --- a/nikola/data/themes/base/templates/comments_helper.tmpl +++ b/nikola/data/themes/base/templates/comments_helper.tmpl @@ -5,6 +5,8 @@ <%namespace name="intensedebate" file="intensedebate_helper.tmpl"/> <%namespace name="moot" file="moot_helper.tmpl"/> <%namespace name="googleplus" file="googleplus_helper.tmpl"/> +<%namespace name="facebook" file="facebook_helper.tmpl"/> +<%namespace name="isso" file="isso_helper.tmpl"/> <%def name="comment_form(url, title, identifier)"> %if comment_system == 'disqus': @@ -17,6 +19,10 @@ ${moot.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 </%def> @@ -31,6 +37,10 @@ ${moot.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 </%def> @@ -45,5 +55,9 @@ ${moot.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 </%def> diff --git a/nikola/data/themes/base/templates/disqus_helper.tmpl b/nikola/data/themes/base/templates/disqus_helper.tmpl index 211f27a..74187b0 100644 --- a/nikola/data/themes/base/templates/disqus_helper.tmpl +++ b/nikola/data/themes/base/templates/disqus_helper.tmpl @@ -9,24 +9,24 @@ <%def name="comment_form(url, title, identifier)"> %if comment_system_id: <div id="disqus_thread"></div> - <script type="text/javascript"> - var disqus_shortname ="${comment_system_id}"; + <script> + var disqus_shortname ="${comment_system_id}", %if url: - var disqus_url="${url}"; + disqus_url="${url}", %endif - var disqus_title=${json.dumps(title)}; - var disqus_identifier="${identifier}"; - var disqus_config = function () { + disqus_title=${json.dumps(title)}, + disqus_identifier="${identifier}", + disqus_config = function () { this.language = "${translations.get(lang, lang)}"; }; (function() { - var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; - dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js'; + 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="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> - <a href="http://disqus.com" class="dsq-brlink">Comments powered by <span class="logo-disqus">Disqus</span></a> + <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript> + <a href="http://disqus.com" class="dsq-brlink" rel="nofollow">Comments powered by <span class="logo-disqus">Disqus</span></a> %endif </%def> @@ -40,7 +40,7 @@ <%def name="comment_link_script()"> %if comment_system_id: - <script type="text/javascript">var disqus_shortname="${comment_system_id}";(function(){var a=document.createElement("script");a.async=true;a.type="text/javascript";a.src="http://"+disqus_shortname+".disqus.com/count.js";(document.getElementsByTagName("HEAD")[0]||document.getElementsByTagName("BODY")[0]).appendChild(a)}());</script> + <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 </%def> diff --git a/nikola/data/themes/base/templates/gallery.tmpl b/nikola/data/themes/base/templates/gallery.tmpl index be9cc6f..e4eab27 100644 --- a/nikola/data/themes/base/templates/gallery.tmpl +++ b/nikola/data/themes/base/templates/gallery.tmpl @@ -6,14 +6,18 @@ <%block name="content"> ${ui.bar(crumbs)} + %if title: + <h1>${title}</h1> + %endif %if text: <p> ${text} </p> %endif <ul> - % for folder in folders: - <li><a href="${folder}"><i class="icon-folder-open"></i> ${folder}</a></li> + % for folder, ftitle in folders: + <li><a href="${folder}"><i + class="icon-folder-open"></i> ${ftitle}</a></li> % endfor </ul> <ul class="thumbnails"> diff --git a/nikola/data/themes/base/templates/index.tmpl b/nikola/data/themes/base/templates/index.tmpl index 6de79e2..1a280b0 100644 --- a/nikola/data/themes/base/templates/index.tmpl +++ b/nikola/data/themes/base/templates/index.tmpl @@ -4,10 +4,10 @@ <%inherit file="base.tmpl"/> <%block name="content"> % for post in posts: - <div class="postbox h-entry"> + <article class="postbox h-entry post-${post.meta('type')}"> <h1 class="p-name"><a href="${post.permalink()}" class="u-url">${post.title()}</a> <small> - ${messages("Posted")}: <time class="published dt-published" datetime="${post.date.isoformat()}">${post.formatted_date(date_format)}</time> + ${messages("Posted:")} <time class="published dt-published" datetime="${post.date.isoformat()}">${post.formatted_date(date_format)}</time> </small></h1> <hr> %if index_teasers: @@ -21,7 +21,7 @@ % if not post.meta('nocomments'): ${comments.comment_link(post.permalink(), post._base_path)} % endif - </div> + </article> % endfor ${helper.html_pager()} ${comments.comment_link_script()} diff --git a/nikola/data/themes/base/templates/index_helper.tmpl b/nikola/data/themes/base/templates/index_helper.tmpl index a914846..56f5127 100644..100755 --- a/nikola/data/themes/base/templates/index_helper.tmpl +++ b/nikola/data/themes/base/templates/index_helper.tmpl @@ -1,23 +1,25 @@ ## -*- coding: utf-8 -*- <%def name="html_pager()"> -<div> -<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> -</div> + %if prevlink or nextlink: + <div> + <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> + </div> + %endif </%def> <%def name="mathjax_script(posts)"> %if any(post.is_mathjax for post in posts): - <script src="/assets/js/mathjax.js" type="text/javascript"></script> + <script src="/assets/js/mathjax.js"></script> %endif </%def> diff --git a/nikola/data/themes/base/templates/isso_helper.tmpl b/nikola/data/themes/base/templates/isso_helper.tmpl new file mode 100644 index 0000000..8dc95f5 --- /dev/null +++ b/nikola/data/themes/base/templates/isso_helper.tmpl @@ -0,0 +1,20 @@ +## -*- coding: utf-8 -*- +<%def name="comment_form(url, title, identifier)"> + %if comment_system_id: + <div data-title="${title|u}" id="isso-thread"></div> + <script src="${comment_system_id}js/embed.min.js" data-isso="${comment_system_id}"></script> + %endif +</%def> + +<%def name="comment_link(link, identifier)"> + %if comment_system_id: + <a href="${link}#isso-thread">Comments</a> + %endif +</%def> + + +<%def name="comment_link_script()"> + %if comment_system_id: + <script src="${comment_system_id}js/count.min.js" data-isso="${comment_system_id}"></script> + %endif +</%def> diff --git a/nikola/data/themes/base/templates/post.tmpl b/nikola/data/themes/base/templates/post.tmpl index fd6316d..981fd97 100644 --- a/nikola/data/themes/base/templates/post.tmpl +++ b/nikola/data/themes/base/templates/post.tmpl @@ -7,14 +7,15 @@ ${helper.twitter_card_information(post)} % if post.meta('keywords'): <meta name="keywords" content="${post.meta('keywords')|h}"> % endif +${helper.meta_translations(post)} </%block> <%block name="content"> - <div class="postbox"> + <article class="postbox post-${post.meta('type')}"> <div class="h-entry" itemscope="itemscope" itemtype="http://schema.org/Article"> ${helper.html_title()} <hr> <small> - ${messages("Posted")}: <time class="published dt-published" datetime="${post.date.isoformat()}" itemprop="datePublished">${post.formatted_date(date_format)}</time> + ${messages("Posted:")} <time class="published dt-published" datetime="${post.date.isoformat()}" itemprop="datePublished">${post.formatted_date(date_format)}</time> ${helper.html_translations(post)} ${helper.html_tags(post)} | @@ -37,5 +38,5 @@ ${helper.twitter_card_information(post)} ${comments.comment_form(post.permalink(absolute=True), post.title(), post._base_path)} % endif ${helper.mathjax_script(post)} - </div> + </article> </%block> diff --git a/nikola/data/themes/base/templates/post_helper.tmpl b/nikola/data/themes/base/templates/post_helper.tmpl index f6b0535..69784ea 100644..100755 --- a/nikola/data/themes/base/templates/post_helper.tmpl +++ b/nikola/data/themes/base/templates/post_helper.tmpl @@ -12,37 +12,52 @@ %for langname in translations.keys(): %if langname != lang and post.is_translation_available(langname): | - <a href="${post.permalink(langname)}">${messages("Read in English", langname)}</a> + <a href="${post.permalink(langname)}" rel="alternate" hreflang="${langname}">${messages("Read in English", langname)}</a> %endif %endfor %endif </%def> +<%def name="meta_translations(post)"> + %if len(translations) > 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 +</%def> + +<%def name="html_list_tags(post)" buffered="True"> + <span itemprop="keywords"> + %for tag in post.tags: + <a class="tag p-category" href="${_link('tag', tag)}"><span class="badge badge-info">${tag}</span></a> + %endfor + </span> +</%def> <%def name="html_tags(post)"> %if post.tags: - | ${messages("More posts about")} - <span itemprop="keywords"> - %for tag in post.tags: - <a class="tag p-category" href="${_link('tag', tag)}"><span class="badge badge-info">${tag}</span></a> - %endfor - </span> + | + ${formatmsg(messages("More posts about %s"), html_list_tags(post))} %endif </%def> <%def name="html_pager(post)"> - <ul class="pager"> - %if post.prev_post: - <li class="previous"> - <a href="${post.prev_post.permalink()}" rel="prev">← ${messages("Previous post")}</a> - </li> - %endif - %if post.next_post: - <li class="next"> - <a href="${post.next_post.permalink()}" rel="next">${messages("Next post")} →</a> - </li> + %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">← ${messages("Previous post")}</a> + </li> + %endif + %if post.next_post: + <li class="next"> + <a href="${post.next_post.permalink()}" rel="next">${messages("Next post")} →</a> + </li> + %endif + </ul> %endif - </ul> </%def> <%def name="twitter_card_information(post)"> diff --git a/nikola/data/themes/base/templates/tagindex.tmpl b/nikola/data/themes/base/templates/tagindex.tmpl new file mode 100644 index 0000000..9dda70a --- /dev/null +++ b/nikola/data/themes/base/templates/tagindex.tmpl @@ -0,0 +1,2 @@ +## -*- coding: utf-8 -*- +<%inherit file="index.tmpl"/> |
