diff options
Diffstat (limited to 'nikola/data/themes')
43 files changed, 515 insertions, 286 deletions
diff --git a/nikola/data/themes/default/assets/css/rst.css b/nikola/data/themes/default/assets/css/rst.css index 1f0edcb..cf73111 100644 --- a/nikola/data/themes/default/assets/css/rst.css +++ b/nikola/data/themes/default/assets/css/rst.css @@ -1,8 +1,6 @@ /* -:Author: David Goodger -:Contact: goodger@users.sourceforge.net -:Date: $Date: 2005-12-18 01:56:14 +0100 (Sun, 18 Dec 2005) $ -:Revision: $Revision: 4224 $ +:Author: David Goodger (goodger@python.org) +:Id: $Id: html4css1.css 7514 2012-09-14 14:27:12Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. @@ -35,11 +33,15 @@ a.toc-backref { color: black } blockquote.epigraph { - margin: 2em 1em ; } + margin: 2em 5em ; } dl.docutils dd { margin-bottom: 0.5em } +object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] { + overflow: hidden; +} + /* Uncomment (and remove this text!) to get bold-faced definition list terms dl.docutils dt { font-weight: bold } @@ -54,16 +56,9 @@ div.abstract p.topic-title { div.admonition, div.attention, div.caution, div.danger, div.error, div.hint, div.important, div.note, div.tip, div.warning { - padding: 8px 35px 8px 14px; - margin-bottom: 18px; - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); - background-color: #d9edf7; - color: #3a87ad; - border: 1px solid #bce8f1; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; -} + margin: 2em ; + border: medium outset ; + padding: 1em } div.admonition p.admonition-title, div.hint p.admonition-title, div.important p.admonition-title, div.note p.admonition-title, @@ -73,7 +68,7 @@ div.tip p.admonition-title { div.attention p.admonition-title, div.caution p.admonition-title, div.danger p.admonition-title, div.error p.admonition-title, -div.warning p.admonition-title { +div.warning p.admonition-title, .code .error { color: red ; font-weight: bold ; font-family: sans-serif } @@ -97,7 +92,6 @@ div.dedication p.topic-title { font-style: normal } div.figure { - text-align: center; margin-left: 2em ; margin-right: 2em } @@ -116,7 +110,7 @@ div.line-block div.line-block { margin-left: 1.5em } div.sidebar { - margin-left: 1em ; + margin: 0 0 0.5em 1em ; border: medium outset ; padding: 1em ; background-color: #ffffee ; @@ -135,21 +129,11 @@ div.system-messages h1 { color: red } div.system-message { - padding: 8px 35px 8px 14px; - margin-bottom: 18px; - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); - border: 1px solid #eed3d7; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - padding: 1em; - background-color: #f2dede; - color: #b94a48; - -} + border: medium outset ; + padding: 1em } div.system-message p.system-message-title { - color: inherit ; + color: red ; font-weight: bold } div.topic { @@ -168,11 +152,38 @@ h2.subtitle { hr.docutils { width: 75% } -img.align-left { - clear: left } +img.align-left, .figure.align-left, object.align-left { + clear: left ; + float: left ; + margin-right: 1em } -img.align-right { - clear: right } +img.align-right, .figure.align-right, object.align-right { + clear: right ; + float: right ; + margin-left: 1em } + +img.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left } + +.align-center { + clear: both ; + text-align: center } + +.align-right { + text-align: right } + +/* reset inner alignment in figures */ +div.align-right { + text-align: inherit } + +/* div.align-center * { */ +/* text-align: left } */ ol.simple, ul.simple { margin-bottom: 1em } @@ -227,16 +238,20 @@ p.topic-title { pre.address { margin-bottom: 0 ; margin-top: 0 ; - font-family: serif ; - font-size: 100% } + font: inherit } -pre.literal-block, pre.doctest-block { - margin: 0 0 0 0 ; - background-color: #eeeeee; - padding: 1em; - overflow: auto; -/* font-family: "Courier New", Courier, monospace;*/ -} +pre.literal-block, pre.doctest-block, pre.math, pre.code { + margin-left: 2em ; + margin-right: 2em } + +pre.code .ln { color: grey; } /* line numbers */ +pre.code, code { background-color: #eeeeee } +pre.code .comment, code .comment { color: #5C6576 } +pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } +pre.code .literal.string, code .literal.string { color: #0C5404 } +pre.code .name.builtin, code .name.builtin { color: #352B84 } +pre.code .deleted, code .deleted { background-color: #DEB0A1} +pre.code .inserted, code .inserted { background-color: #A3D289} span.classifier { font-family: sans-serif ; @@ -293,23 +308,5 @@ h1 tt.docutils, h2 tt.docutils, h3 tt.docutils, h4 tt.docutils, h5 tt.docutils, h6 tt.docutils { font-size: 100% } -tt.docutils { - background-color: #eeeeee } - ul.auto-toc { list-style-type: none } - -#blog-title { - font-size: 34pt; - /*margin:0 0.3em -14px;*/ - background-color: #FFF; - font-family: "courier"; - text-align: right; - margin-top: 20px; - margin-bottom: 10px; -} - -img { - margin-top: 12px; - margin-bottom: 12px; -} diff --git a/nikola/data/themes/default/bundles b/nikola/data/themes/default/bundles index ea9fba9..8fe858b 100644 --- a/nikola/data/themes/default/bundles +++ b/nikola/data/themes/default/bundles @@ -1,2 +1,2 @@ -assets/css/all.css=bootstrap.css,bootstrap-responsive.css,rst.css,code.css,colorbox.css,slides.js,theme.css,custom.css -assets/js/all.js=jquery-1.7.2.min.js,jquery.colorbox-min.js,slides.min.jquery.js +assets/css/all.css=bootstrap.css,bootstrap-responsive.css,rst.css,code.css,colorbox.css,slides.css,theme.css,custom.css +assets/js/all.js=bootstrap.min.js,jquery-1.7.2.min.js,jquery.colorbox-min.js,slides.min.jquery.js diff --git a/nikola/data/themes/default/messages/messages_ca.py b/nikola/data/themes/default/messages/messages_ca.py new file mode 100644 index 0000000..8e7186f --- /dev/null +++ b/nikola/data/themes/default/messages/messages_ca.py @@ -0,0 +1,22 @@ +# -*- encoding:utf-8 -*- +from __future__ import unicode_literals + +MESSAGES = { + "LANGUAGE": "Català", + "Posts for year %s": "Entrades de l'any %s", + "Archive": "Arxiu", + "Posts about %s": "Entrades sobre %s", + "Tags": "Etiquetes", + "Also available in": "També disponibles en", + "More posts about": "Més entrades sobre", + "Posted": "Publicat", + "Original site": "Lloc original", + "Read in English": "Llegeix-ho en català", + "Older posts": "Entrades anteriors", + "Newer posts": "Entrades posteriors", + "Previous post": "Entrada anterior", + "Next post": "Entrada següent", + "old posts page %d": "entrades antigues pàgina %d", + "Read more": "Llegeix-ne més", + "Source": "Codi", +} diff --git a/nikola/data/themes/default/messages/messages_de.py b/nikola/data/themes/default/messages/messages_de.py index cafbcbb..5da3b2b 100644 --- a/nikola/data/themes/default/messages/messages_de.py +++ b/nikola/data/themes/default/messages/messages_de.py @@ -3,20 +3,20 @@ from __future__ import unicode_literals MESSAGES = { "LANGUAGE": "Deutsch", - "Posts for year %s": "Einträge aus dem Jahr %s", + "Posts for year %s": "Einträge aus dem Jahr %s", "Archive": "Archiv", - "Posts about %s": "Einträge über %s", + "Posts about %s": "Einträge über %s", "Tags": "Tags", - "Also available in": "Auch verfügbar in", - "More posts about": "Weitere Einträge über", - "Posted": "Veröffentlicht", + "Also available in": "Auch verfügbar in", + "More posts about": "Weitere Einträge über", + "Posted": "Veröffentlicht", "Original site": "Original-Seite", "Read in English": "Auf Deutsch lesen", - "Older posts": "Ältere Einträge", - "Newer posts": "Neuere Einträge", + "Older posts": "Ältere Einträge", + "Newer posts": "Neuere Einträge", "Previous post": "Vorheriger Eintrag", - "Next post": "Nächster Eintrag", + "Next post": "Nächster Eintrag", "Source": "Source", "Read more": "Weiterlesen", - "old posts page %d": "Vorherige Einträge %d" + "old posts page %d": "Vorherige Einträge %d" } diff --git a/nikola/data/themes/default/messages/messages_en.py b/nikola/data/themes/default/messages/messages_en.py index 6d39047..9fc77ef 100644 --- a/nikola/data/themes/default/messages/messages_en.py +++ b/nikola/data/themes/default/messages/messages_en.py @@ -1,27 +1,22 @@ +# -*- encoding:utf-8 -*- from __future__ import unicode_literals -MESSAGES = [ - "Posts for year %s", - "Archive", - "Posts about %s", - "Tags", - "Also available in", - "More posts about", - "Posted", - "Original site", - "Read in English", - "Newer posts", - "Older posts", - "Previous post", - "Next post", - "old posts page %d", - "Read more", - "Source", -] - -# In english things are not translated -msg_dict = {} -for msg in MESSAGES: - msg_dict[msg] = msg -MESSAGES = msg_dict -MESSAGES["LANGUAGE"] = "English" +MESSAGES = { + "LANGUAGE": "English", + "Posts for year %s": "Posts for year %s", + "Archive": "Archive", + "Posts about %s": "Posts about %s", + "Tags": "Tags", + "Also available in": "Also available in", + "More posts about": "More posts about", + "Posted": "Posted", + "Original site": "Original site", + "Read in English": "Read in English", + "Newer posts": "Newer posts", + "Older posts": "Older posts", + "Previous post": "Previous post", + "Next post": "Next post", + "old posts page %d": "old posts page %d", + "Read more": "Read more", + "Source": "Source", +} diff --git a/nikola/data/themes/default/messages/messages_fr.py b/nikola/data/themes/default/messages/messages_fr.py index 776147b..74eecb8 100644 --- a/nikola/data/themes/default/messages/messages_fr.py +++ b/nikola/data/themes/default/messages/messages_fr.py @@ -14,5 +14,8 @@ MESSAGES = { "Read in English": "Lire en français", "Newer posts": "Billets récents", "Older posts": "Anciens billets", + "Previous post": "Previous post", + "Next post": "Next post", + "Read more": "Read more", "Source": "Source", } diff --git a/nikola/data/themes/default/messages/messages_gr.py b/nikola/data/themes/default/messages/messages_gr.py index 5965bc3..c6135f3 100644 --- a/nikola/data/themes/default/messages/messages_gr.py +++ b/nikola/data/themes/default/messages/messages_gr.py @@ -17,5 +17,6 @@ MESSAGES = { "Previous post": "Προηγούμενη ανάρτηση", "Next post": "Επόμενη ανάρτηση", "old posts page %d": "σελίδα παλαιότερων αναρτήσεων %d", + "Read more": "Read more", "Source": "Source", } diff --git a/nikola/data/themes/default/messages/messages_pl.py b/nikola/data/themes/default/messages/messages_pl.py new file mode 100644 index 0000000..7172ebc --- /dev/null +++ b/nikola/data/themes/default/messages/messages_pl.py @@ -0,0 +1,22 @@ +# -*- encoding:utf-8 -*- +from __future__ import unicode_literals + +MESSAGES = { + "LANGUAGE": "polski", + "Posts for year %s": "Posty z roku %s", + "Archive": "Archiwum", + "Posts about %s": "Posty o %s", + "Tags": "Tags", + "Also available in": "Również dostępny w", + "More posts about": "Więcej postów o", + "Posted": "Opublikowany", + "Original site": "Oryginalna strona", + "Read in English": "Czytaj po polsku", + "Older posts": "Starsze posty", + "Newer posts": "Nowsze posty", + "Previous post": "Poprzedni post", + "Next post": "Następny post", + "Source": "Źródło", + "Read more": "Czytaj więcej", + "old posts page %d": "stare posty, strona %d" +} diff --git a/nikola/data/themes/default/messages/messages_zh-cn.py b/nikola/data/themes/default/messages/messages_zh-cn.py new file mode 100644 index 0000000..2f4b64e --- /dev/null +++ b/nikola/data/themes/default/messages/messages_zh-cn.py @@ -0,0 +1,22 @@ +# -*- encoding:utf-8 -*-
+from __future__ import unicode_literals
+
+MESSAGES = {
+ "LANGUAGE": "简体中文",
+ "Posts for year %s": "%s年文章",
+ "Archive": "文章存档",
+ "Posts about %s": "文章分类:%s",
+ "Tags": "标签",
+ "Also available in": "其他语言版本",
+ "More posts about": "更多相关文章:",
+ "Posted": "发表于",
+ "Original site": "原文地址",
+ "Read in English": "中文版",
+ "Older posts": "旧一篇",
+ "Newer posts": "新一篇",
+ "Previous post": "前一篇",
+ "Next post": "后一篇",
+ "old posts page %d": "旧文章页 %d",
+ "Read more": "更多",
+ "Source": "源代码",
+}
diff --git a/nikola/data/themes/default/templates/base_helper.tmpl b/nikola/data/themes/default/templates/base_helper.tmpl index 3f27f23..170dee1 100644 --- a/nikola/data/themes/default/templates/base_helper.tmpl +++ b/nikola/data/themes/default/templates/base_helper.tmpl @@ -1,3 +1,4 @@ +## -*- coding: utf-8 -*- <%def name="html_head()"> <meta charset="utf-8"> <meta name="title" content="${title} | ${blog_title}" > @@ -10,7 +11,6 @@ <script src="/assets/js/all.js" type="text/javascript"></script> %else: <link href="/assets/css/bootstrap.css" rel="stylesheet" type="text/css"> - <link href="/assets/css/bootstrap-responsive.css" rel="stylesheet" type="text/css"> <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/colorbox.css" rel="stylesheet" type="text/css"/> @@ -19,9 +19,11 @@ %if has_custom_css: <link href="/assets/css/custom.css" rel="stylesheet" type="text/css"> %endif + <link href="/assets/css/bootstrap-responsive.css" rel="stylesheet" type="text/css"> <script src="/assets/js/jquery-1.7.2.min.js" type="text/javascript"></script> <script src="/assets/js/jquery.colorbox-min.js" type="text/javascript"></script> <script src="/assets/js/slides.min.jquery.js" type="text/javascript"></script> + <script src="/assets/js/bootstrap.min.js" type="text/javascript"></script> %endif <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements --> <!--[if lt IE 9]> @@ -34,6 +36,11 @@ <link rel="alternate" type="application/rss+xml" title="RSS (${language})" href="${_link('rss', None, lang)}"> %endfor %endif + %if favicons: + %for name, file, size in favicons: + <link rel="${name}" href="${file}" sizes="${size}"/> + %endfor + %endif </%def> diff --git a/nikola/data/themes/default/templates/disqus_helper.tmpl b/nikola/data/themes/default/templates/disqus_helper.tmpl new file mode 100644 index 0000000..674e20e --- /dev/null +++ b/nikola/data/themes/default/templates/disqus_helper.tmpl @@ -0,0 +1,40 @@ +## -*- coding: utf-8 -*- +<%! + import json +%> +<%def name="html_disqus(url, title, identifier)"> + %if disqus_forum: + <div id="disqus_thread"></div> + <script type="text/javascript"> + var disqus_shortname ="${disqus_forum}"; + %if url: + var disqus_url="${url}"; + %endif + var disqus_title=${json.dumps(title)}; + var disqus_identifier="${identifier}"; + var disqus_config = function () { + this.language = "${lang}"; + }; + (function() { + var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; + dsq.src = 'http://' + 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> + %endif +</%def> + +<%def name="html_disqus_link(link, identifier)"> + <p> + %if disqus_forum: + <a href="${link}" data-disqus-identifier="${identifier}">Comments</a> + %endif +</%def> + + +<%def name="html_disqus_script()"> + %if disqus_forum: + <script type="text/javascript">var disqus_shortname="${disqus_forum}";(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> + %endif +</%def> diff --git a/nikola/data/themes/default/templates/gallery.tmpl b/nikola/data/themes/default/templates/gallery.tmpl index 37d749f..3186cc8 100644 --- a/nikola/data/themes/default/templates/gallery.tmpl +++ b/nikola/data/themes/default/templates/gallery.tmpl @@ -1,5 +1,6 @@ ## -*- coding: utf-8 -*- <%inherit file="base.tmpl"/> +<%namespace name="disqus" file="disqus_helper.tmpl"/> <%block name="sourcelink"></%block> <%block name="content"> @@ -24,4 +25,7 @@ <img src="${image[1]}" /></a></li> %endfor </ul> +%if enable_comments: + ${disqus.html_disqus(None, permalink, title)} +%endif </%block> diff --git a/nikola/data/themes/default/templates/index.tmpl b/nikola/data/themes/default/templates/index.tmpl index 03dd1f8..1a436e2 100644 --- a/nikola/data/themes/default/templates/index.tmpl +++ b/nikola/data/themes/default/templates/index.tmpl @@ -1,5 +1,6 @@ ## -*- coding: utf-8 -*- <%namespace name="helper" file="index_helper.tmpl"/> +<%namespace name="disqus" file="disqus_helper.tmpl"/> <%inherit file="base.tmpl"/> <%block name="content"> % for post in posts: @@ -10,9 +11,9 @@ </small></h1> <hr> ${post.text(lang, index_teasers)} - ${helper.html_disqus_link(post)} + ${disqus.html_disqus_link(post.permalink()+"#disqus_thread", post.base_path)} </div> % endfor ${helper.html_pager()} - ${helper.html_disqus_script()} + ${disqus.html_disqus_script()} </%block> diff --git a/nikola/data/themes/default/templates/index_helper.tmpl b/nikola/data/themes/default/templates/index_helper.tmpl index cfecdf3..114a730 100644 --- a/nikola/data/themes/default/templates/index_helper.tmpl +++ b/nikola/data/themes/default/templates/index_helper.tmpl @@ -1,3 +1,4 @@ +## -*- coding: utf-8 -*- <%def name="html_pager()"> <div> <ul class="pager"> @@ -14,18 +15,3 @@ </ul> </div> </%def> - - -<%def name="html_disqus_link(post)"> - <p> - %if disqus_forum: - <a href="${post.permalink()}#disqus_thread">Comments</a> - %endif -</%def> - - -<%def name="html_disqus_script()"> - %if disqus_forum: - <script type="text/javascript">var disqus_shortname="${disqus_forum}";(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> - %endif -</%def> diff --git a/nikola/data/themes/default/templates/post.tmpl b/nikola/data/themes/default/templates/post.tmpl index 306192d..672d4f6 100644 --- a/nikola/data/themes/default/templates/post.tmpl +++ b/nikola/data/themes/default/templates/post.tmpl @@ -1,5 +1,6 @@ ## -*- coding: utf-8 -*- <%namespace name="helper" file="post_helper.tmpl"/> +<%namespace name="disqus" file="disqus_helper.tmpl"/> <%inherit file="base.tmpl"/> <%block name="content"> <div class="postbox"> @@ -9,12 +10,12 @@ ${messages[lang]["Posted"]}: ${post.date.strftime(date_format)} ${helper.html_translations(post)} | - <a href="${post.pagenames[lang]+'.txt'}">${messages[lang]["Source"]}</a> + <a href="${post.pagenames[lang]+'.txt'}" id="sourcelink">${messages[lang]["Source"]}</a> ${helper.html_tags(post)} </small> <hr> ${post.text(lang)} ${helper.html_pager(post)} - ${helper.html_disqus(post)} + ${disqus.html_disqus(post.permalink(absolute=True), post.title(lang), post.base_path)} </div> </%block> diff --git a/nikola/data/themes/default/templates/post_helper.tmpl b/nikola/data/themes/default/templates/post_helper.tmpl index 3e874e9..ab08359 100644 --- a/nikola/data/themes/default/templates/post_helper.tmpl +++ b/nikola/data/themes/default/templates/post_helper.tmpl @@ -1,3 +1,4 @@ +## -*- coding: utf-8 -*- <%def name="html_title()"> <h1>${title}</h1> % if link: @@ -9,7 +10,7 @@ <%def name="html_translations(post)"> %if len(translations) > 1: %for langname in translations.keys(): - %if langname != lang: + %if langname != lang and post.is_translation_available(langname): | <a href="${post.permalink(langname)}">${messages[langname]["Read in English"]}</a> %endif @@ -27,17 +28,6 @@ %endif </%def> - -<%def name="html_disqus(post)"> - %if disqus_forum: - <div id="disqus_thread"></div> - <script type="text/javascript">var disqus_shortname="${disqus_forum}";var disqus_url="${post.permalink(absolute=True)}";(function(){var a=document.createElement("script");a.type="text/javascript";a.async=true;a.src="http://"+disqus_shortname+".disqus.com/embed.js";(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(a)})(); </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> - %endif -</%def> - - <%def name="html_pager(post)"> <ul class="pager"> %if post.prev_post: diff --git a/nikola/data/themes/default/templates/story.tmpl b/nikola/data/themes/default/templates/story.tmpl index deb0a46..d5c2f44 100644 --- a/nikola/data/themes/default/templates/story.tmpl +++ b/nikola/data/themes/default/templates/story.tmpl @@ -1,8 +1,12 @@ ## -*- coding: utf-8 -*- <%inherit file="post.tmpl"/> +<%namespace name="disqus" file="disqus_helper.tmpl"/> <%block name="content"> %if title: <h1>${title}</h1> %endif ${post.text(lang)} +%if enable_comments: + ${disqus.html_disqus(post.permalink(absolute=True), post.title(lang), post.base_path)} +%endif </%block> diff --git a/nikola/data/themes/jinja-default/templates/gallery.tmpl b/nikola/data/themes/jinja-default/templates/gallery.tmpl index dcd8a43..34ff439 100644 --- a/nikola/data/themes/jinja-default/templates/gallery.tmpl +++ b/nikola/data/themes/jinja-default/templates/gallery.tmpl @@ -23,5 +23,25 @@ <img src="{{image[1]}}" /></a></li> {% endfor %} </ul> + {%if enable_comments %} + {%if disqus_forum %} + <div id="disqus_thread"></div> + <script type="text/javascript"> + var disqus_shortname ="{{disqus_forum}}"; + var disqus_title={{title|tojson}}; + var disqus_identifier="{{permalink}}"; + var disqus_config = function () { + this.language = "{{lang}}"; + }; + (function() { + var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; + dsq.src = 'http://' + 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> + {% endif %} + {% endif %} + {% endblock %} diff --git a/nikola/data/themes/jinja-default/templates/index.tmpl b/nikola/data/themes/jinja-default/templates/index.tmpl index c068417..ad54c19 100644 --- a/nikola/data/themes/jinja-default/templates/index.tmpl +++ b/nikola/data/themes/jinja-default/templates/index.tmpl @@ -10,7 +10,7 @@ {{post.text(lang, index_teasers)}} <p> {% if disqus_forum %} - <a href="{{post.permalink()}}#disqus_thread">Comments</a> + <a href="{{post.permalink()}}#disqus_thread" data-disqus-identifier="{{post.base_path}}">Comments</a> {% endif %} </div> {% endfor %} diff --git a/nikola/data/themes/jinja-default/templates/post.tmpl b/nikola/data/themes/jinja-default/templates/post.tmpl index 3ce6abe..2a356c5 100644 --- a/nikola/data/themes/jinja-default/templates/post.tmpl +++ b/nikola/data/themes/jinja-default/templates/post.tmpl @@ -11,14 +11,14 @@ {% if translations|length > 1 %} {% for langname in translations.keys() %} - {% if langname != lang %} + {% if langname != lang and post.is_translation_available(langname) %} <a href="{{post.permalink(langname)}}">{{messages[langname]["Read in English"]}}</a> | {% endif %} {% endfor %} {% endif %} - <a href="{{post.pagenames[lang]+".txt"}}">{{messages[lang]["Source"]}}</a> + <a href="{{post.pagenames[lang]+".txt"}}" id="sourcelink">{{messages[lang]["Source"]}}</a> {% if post.tags %} | {{messages[lang]["More posts about"]}} {% for tag in post.tags %} @@ -42,9 +42,21 @@ </ul> {% if disqus_forum %} <div id="disqus_thread"></div> - <script type="text/javascript"> var disqus_shortname = '{{disqus_forum}}'; var disqus_url = '{{post.permalink(absolute=True)}}'; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = 'http://' + 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> + <script type="text/javascript"> + var disqus_shortname ="{{disqus_forum}}"; + var disqus_url="{{post.permalink(absolute=True)}}"; + var disqus_title={{post.title(lang)|tojson }}; + var disqus_identifier="{{post.base_path}}"; + var disqus_config = function () { + this.language = "{{lang}}"; + }; + (function() { + var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; + dsq.src = 'http://' + 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> {% endif %} </div> {% endblock %} diff --git a/nikola/data/themes/jinja-default/templates/story.tmpl b/nikola/data/themes/jinja-default/templates/story.tmpl index 411c269..ccaac91 100644 --- a/nikola/data/themes/jinja-default/templates/story.tmpl +++ b/nikola/data/themes/jinja-default/templates/story.tmpl @@ -4,4 +4,7 @@ <h1>{{title}}</h1> {% endif %} {{post.text(lang)}} +{%if enable_comments %} + {{disqus.html_disqus(post.permalink(absolute=True), post.title(lang), post.base_path)}} +{%endif%} {% endblock %} diff --git a/nikola/data/themes/monospace/assets/css/rst.css b/nikola/data/themes/monospace/assets/css/rst.css index 1f0edcb..cf73111 100644 --- a/nikola/data/themes/monospace/assets/css/rst.css +++ b/nikola/data/themes/monospace/assets/css/rst.css @@ -1,8 +1,6 @@ /* -:Author: David Goodger -:Contact: goodger@users.sourceforge.net -:Date: $Date: 2005-12-18 01:56:14 +0100 (Sun, 18 Dec 2005) $ -:Revision: $Revision: 4224 $ +:Author: David Goodger (goodger@python.org) +:Id: $Id: html4css1.css 7514 2012-09-14 14:27:12Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. @@ -35,11 +33,15 @@ a.toc-backref { color: black } blockquote.epigraph { - margin: 2em 1em ; } + margin: 2em 5em ; } dl.docutils dd { margin-bottom: 0.5em } +object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] { + overflow: hidden; +} + /* Uncomment (and remove this text!) to get bold-faced definition list terms dl.docutils dt { font-weight: bold } @@ -54,16 +56,9 @@ div.abstract p.topic-title { div.admonition, div.attention, div.caution, div.danger, div.error, div.hint, div.important, div.note, div.tip, div.warning { - padding: 8px 35px 8px 14px; - margin-bottom: 18px; - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); - background-color: #d9edf7; - color: #3a87ad; - border: 1px solid #bce8f1; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; -} + margin: 2em ; + border: medium outset ; + padding: 1em } div.admonition p.admonition-title, div.hint p.admonition-title, div.important p.admonition-title, div.note p.admonition-title, @@ -73,7 +68,7 @@ div.tip p.admonition-title { div.attention p.admonition-title, div.caution p.admonition-title, div.danger p.admonition-title, div.error p.admonition-title, -div.warning p.admonition-title { +div.warning p.admonition-title, .code .error { color: red ; font-weight: bold ; font-family: sans-serif } @@ -97,7 +92,6 @@ div.dedication p.topic-title { font-style: normal } div.figure { - text-align: center; margin-left: 2em ; margin-right: 2em } @@ -116,7 +110,7 @@ div.line-block div.line-block { margin-left: 1.5em } div.sidebar { - margin-left: 1em ; + margin: 0 0 0.5em 1em ; border: medium outset ; padding: 1em ; background-color: #ffffee ; @@ -135,21 +129,11 @@ div.system-messages h1 { color: red } div.system-message { - padding: 8px 35px 8px 14px; - margin-bottom: 18px; - text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); - border: 1px solid #eed3d7; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - padding: 1em; - background-color: #f2dede; - color: #b94a48; - -} + border: medium outset ; + padding: 1em } div.system-message p.system-message-title { - color: inherit ; + color: red ; font-weight: bold } div.topic { @@ -168,11 +152,38 @@ h2.subtitle { hr.docutils { width: 75% } -img.align-left { - clear: left } +img.align-left, .figure.align-left, object.align-left { + clear: left ; + float: left ; + margin-right: 1em } -img.align-right { - clear: right } +img.align-right, .figure.align-right, object.align-right { + clear: right ; + float: right ; + margin-left: 1em } + +img.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left } + +.align-center { + clear: both ; + text-align: center } + +.align-right { + text-align: right } + +/* reset inner alignment in figures */ +div.align-right { + text-align: inherit } + +/* div.align-center * { */ +/* text-align: left } */ ol.simple, ul.simple { margin-bottom: 1em } @@ -227,16 +238,20 @@ p.topic-title { pre.address { margin-bottom: 0 ; margin-top: 0 ; - font-family: serif ; - font-size: 100% } + font: inherit } -pre.literal-block, pre.doctest-block { - margin: 0 0 0 0 ; - background-color: #eeeeee; - padding: 1em; - overflow: auto; -/* font-family: "Courier New", Courier, monospace;*/ -} +pre.literal-block, pre.doctest-block, pre.math, pre.code { + margin-left: 2em ; + margin-right: 2em } + +pre.code .ln { color: grey; } /* line numbers */ +pre.code, code { background-color: #eeeeee } +pre.code .comment, code .comment { color: #5C6576 } +pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } +pre.code .literal.string, code .literal.string { color: #0C5404 } +pre.code .name.builtin, code .name.builtin { color: #352B84 } +pre.code .deleted, code .deleted { background-color: #DEB0A1} +pre.code .inserted, code .inserted { background-color: #A3D289} span.classifier { font-family: sans-serif ; @@ -293,23 +308,5 @@ h1 tt.docutils, h2 tt.docutils, h3 tt.docutils, h4 tt.docutils, h5 tt.docutils, h6 tt.docutils { font-size: 100% } -tt.docutils { - background-color: #eeeeee } - ul.auto-toc { list-style-type: none } - -#blog-title { - font-size: 34pt; - /*margin:0 0.3em -14px;*/ - background-color: #FFF; - font-family: "courier"; - text-align: right; - margin-top: 20px; - margin-bottom: 10px; -} - -img { - margin-top: 12px; - margin-bottom: 12px; -} diff --git a/nikola/data/themes/monospace/assets/css/theme.css b/nikola/data/themes/monospace/assets/css/theme.css index b66d7bd..b9c0cf2 100644 --- a/nikola/data/themes/monospace/assets/css/theme.css +++ b/nikola/data/themes/monospace/assets/css/theme.css @@ -11,4 +11,4 @@ body { margin:0px; padding:20px 0px; text-align:center; font-family:Monospace; c #sidebar .description { display:block; width:100%; height:auto; margin:0px 0px 10px 0px; } h1, h2, h3, h4, h5, h6, h7 { margin:0px; text-transform:uppercase; } h4, h5, h6 { font-size:14px; } -h1 { padding:0px 0px 15px; margin:0px 0px 15px 0px; } +#blog-title { margin-top: 0; line-height:48px;} diff --git a/nikola/data/themes/monospace/messages b/nikola/data/themes/monospace/messages deleted file mode 120000 index 3047ea2..0000000 --- a/nikola/data/themes/monospace/messages +++ /dev/null @@ -1 +0,0 @@ -../default/messages/
\ No newline at end of file diff --git a/nikola/data/themes/monospace/templates/base_helper.tmpl b/nikola/data/themes/monospace/templates/base_helper.tmpl index f5fe80c..170dee1 100644 --- a/nikola/data/themes/monospace/templates/base_helper.tmpl +++ b/nikola/data/themes/monospace/templates/base_helper.tmpl @@ -1,22 +1,34 @@ +## -*- coding: utf-8 -*- <%def name="html_head()"> <meta charset="utf-8"> <meta name="title" content="${title} | ${blog_title}" > <meta name="description" content="${description}" > <meta name="author" content="${blog_author}"> <title>${title} | ${blog_title}</title> + <!-- Le styles --> %if use_bundles: -<!-- CSS and JS Bundles here --> <link href="/assets/css/all.css" rel="stylesheet" type="text/css"> + <script src="/assets/js/all.js" type="text/javascript"></script> %else: -<!-- CSS and JS here --> + <link href="/assets/css/bootstrap.css" rel="stylesheet" type="text/css"> <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/colorbox.css" rel="stylesheet" type="text/css"/> + <link href="/assets/css/slides.css" rel="stylesheet" type="text/css"/> <link href="/assets/css/theme.css" rel="stylesheet" type="text/css"/> %if has_custom_css: -<!-- Custom CSS here --> <link href="/assets/css/custom.css" rel="stylesheet" type="text/css"> %endif + <link href="/assets/css/bootstrap-responsive.css" rel="stylesheet" type="text/css"> + <script src="/assets/js/jquery-1.7.2.min.js" type="text/javascript"></script> + <script src="/assets/js/jquery.colorbox-min.js" type="text/javascript"></script> + <script src="/assets/js/slides.min.jquery.js" type="text/javascript"></script> + <script src="/assets/js/bootstrap.min.js" type="text/javascript"></script> %endif + <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements --> + <!--[if lt IE 9]> + <script src="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script> + <![endif]--> %if rss_link: ${rss_link} %else: @@ -24,6 +36,11 @@ <link rel="alternate" type="application/rss+xml" title="RSS (${language})" href="${_link('rss', None, lang)}"> %endfor %endif + %if favicons: + %for name, file, size in favicons: + <link rel="${name}" href="${file}" sizes="${size}"/> + %endfor + %endif </%def> diff --git a/nikola/data/themes/monospace/templates/disqus_helper.tmpl b/nikola/data/themes/monospace/templates/disqus_helper.tmpl new file mode 100644 index 0000000..674e20e --- /dev/null +++ b/nikola/data/themes/monospace/templates/disqus_helper.tmpl @@ -0,0 +1,40 @@ +## -*- coding: utf-8 -*- +<%! + import json +%> +<%def name="html_disqus(url, title, identifier)"> + %if disqus_forum: + <div id="disqus_thread"></div> + <script type="text/javascript"> + var disqus_shortname ="${disqus_forum}"; + %if url: + var disqus_url="${url}"; + %endif + var disqus_title=${json.dumps(title)}; + var disqus_identifier="${identifier}"; + var disqus_config = function () { + this.language = "${lang}"; + }; + (function() { + var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; + dsq.src = 'http://' + 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> + %endif +</%def> + +<%def name="html_disqus_link(link, identifier)"> + <p> + %if disqus_forum: + <a href="${link}" data-disqus-identifier="${identifier}">Comments</a> + %endif +</%def> + + +<%def name="html_disqus_script()"> + %if disqus_forum: + <script type="text/javascript">var disqus_shortname="${disqus_forum}";(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> + %endif +</%def> diff --git a/nikola/data/themes/monospace/templates/gallery.tmpl b/nikola/data/themes/monospace/templates/gallery.tmpl index 37d749f..3186cc8 100644 --- a/nikola/data/themes/monospace/templates/gallery.tmpl +++ b/nikola/data/themes/monospace/templates/gallery.tmpl @@ -1,5 +1,6 @@ ## -*- coding: utf-8 -*- <%inherit file="base.tmpl"/> +<%namespace name="disqus" file="disqus_helper.tmpl"/> <%block name="sourcelink"></%block> <%block name="content"> @@ -24,4 +25,7 @@ <img src="${image[1]}" /></a></li> %endfor </ul> +%if enable_comments: + ${disqus.html_disqus(None, permalink, title)} +%endif </%block> diff --git a/nikola/data/themes/monospace/templates/index.tmpl b/nikola/data/themes/monospace/templates/index.tmpl index bbf5529..ee57d26 100644 --- a/nikola/data/themes/monospace/templates/index.tmpl +++ b/nikola/data/themes/monospace/templates/index.tmpl @@ -1,5 +1,6 @@ ## -*- coding: utf-8 -*- <%namespace name="helper" file="index_helper.tmpl"/> +<%namespace name="disqus" file="disqus_helper.tmpl"/> <%inherit file="base.tmpl"/> <%block name="content"> % for post in posts: @@ -19,9 +20,9 @@ </span> </div> ${post.text(lang, index_teasers)} - ${helper.html_disqus_link(post)} + ${disqus.html_disqus_link(post.permalink()+"#disqus_thread", post.base_path)} </div> % endfor ${helper.html_pager()} - ${helper.html_disqus_script()} + ${disqus.html_disqus_script()} </%block> diff --git a/nikola/data/themes/monospace/templates/index_helper.tmpl b/nikola/data/themes/monospace/templates/index_helper.tmpl index cfecdf3..114a730 100644 --- a/nikola/data/themes/monospace/templates/index_helper.tmpl +++ b/nikola/data/themes/monospace/templates/index_helper.tmpl @@ -1,3 +1,4 @@ +## -*- coding: utf-8 -*- <%def name="html_pager()"> <div> <ul class="pager"> @@ -14,18 +15,3 @@ </ul> </div> </%def> - - -<%def name="html_disqus_link(post)"> - <p> - %if disqus_forum: - <a href="${post.permalink()}#disqus_thread">Comments</a> - %endif -</%def> - - -<%def name="html_disqus_script()"> - %if disqus_forum: - <script type="text/javascript">var disqus_shortname="${disqus_forum}";(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> - %endif -</%def> diff --git a/nikola/data/themes/monospace/templates/post.tmpl b/nikola/data/themes/monospace/templates/post.tmpl index 94a74f8..2ba27f1 100644 --- a/nikola/data/themes/monospace/templates/post.tmpl +++ b/nikola/data/themes/monospace/templates/post.tmpl @@ -1,12 +1,13 @@ ## -*- coding: utf-8 -*- <%namespace name="helper" file="post_helper.tmpl"/> +<%namespace name="disqus" file="disqus_helper.tmpl"/> <%inherit file="base.tmpl"/> <%block name="content"> <div class="post"> ${helper.html_title()} <div class="meta" style="background-color: rgb(234, 234, 234); "> <span class="authordate"> - ${messages[lang]["Posted"]}: ${post.date.strftime(date_format)} [<a href="${post.pagenames[lang]+'.txt'}">${messages[lang]["Source"]}</a>] + ${messages[lang]["Posted"]}: ${post.date.strftime(date_format)} [<a href="${post.pagenames[lang]+'.txt'}" id="sourcelink">${messages[lang]["Source"]}</a>] </span> <br> %if post.tags: @@ -23,6 +24,6 @@ </div> ${post.text(lang)} ${helper.html_pager(post)} - ${helper.html_disqus(post)} + ${disqus.html_disqus(post.permalink(absolute=True), post.title(lang), post.base_path)} </div> </%block> diff --git a/nikola/data/themes/monospace/templates/post_helper.tmpl b/nikola/data/themes/monospace/templates/post_helper.tmpl index 3e874e9..8651c65 100644 --- a/nikola/data/themes/monospace/templates/post_helper.tmpl +++ b/nikola/data/themes/monospace/templates/post_helper.tmpl @@ -1,3 +1,4 @@ +## -*- coding: utf-8 -*- <%def name="html_title()"> <h1>${title}</h1> % if link: @@ -9,7 +10,7 @@ <%def name="html_translations(post)"> %if len(translations) > 1: %for langname in translations.keys(): - %if langname != lang: + %if langname != lang and post.is_translation_available(langname): | <a href="${post.permalink(langname)}">${messages[langname]["Read in English"]}</a> %endif @@ -28,16 +29,6 @@ </%def> -<%def name="html_disqus(post)"> - %if disqus_forum: - <div id="disqus_thread"></div> - <script type="text/javascript">var disqus_shortname="${disqus_forum}";var disqus_url="${post.permalink(absolute=True)}";(function(){var a=document.createElement("script");a.type="text/javascript";a.async=true;a.src="http://"+disqus_shortname+".disqus.com/embed.js";(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(a)})(); </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> - %endif -</%def> - - <%def name="html_pager(post)"> <ul class="pager"> %if post.prev_post: diff --git a/nikola/data/themes/monospace/templates/story.tmpl b/nikola/data/themes/monospace/templates/story.tmpl index deb0a46..30d263b 100644 --- a/nikola/data/themes/monospace/templates/story.tmpl +++ b/nikola/data/themes/monospace/templates/story.tmpl @@ -5,4 +5,7 @@ <h1>${title}</h1> %endif ${post.text(lang)} +%if enable_comments: + ${disqus.html_disqus(post.permalink(absolute=True), post.title(lang), post.base_path)} +%endif </%block> diff --git a/nikola/data/themes/orphan/messages b/nikola/data/themes/orphan/messages deleted file mode 120000 index 3047ea2..0000000 --- a/nikola/data/themes/orphan/messages +++ /dev/null @@ -1 +0,0 @@ -../default/messages/
\ No newline at end of file diff --git a/nikola/data/themes/orphan/templates/base_helper.tmpl b/nikola/data/themes/orphan/templates/base_helper.tmpl index f5fe80c..170dee1 100644 --- a/nikola/data/themes/orphan/templates/base_helper.tmpl +++ b/nikola/data/themes/orphan/templates/base_helper.tmpl @@ -1,22 +1,34 @@ +## -*- coding: utf-8 -*- <%def name="html_head()"> <meta charset="utf-8"> <meta name="title" content="${title} | ${blog_title}" > <meta name="description" content="${description}" > <meta name="author" content="${blog_author}"> <title>${title} | ${blog_title}</title> + <!-- Le styles --> %if use_bundles: -<!-- CSS and JS Bundles here --> <link href="/assets/css/all.css" rel="stylesheet" type="text/css"> + <script src="/assets/js/all.js" type="text/javascript"></script> %else: -<!-- CSS and JS here --> + <link href="/assets/css/bootstrap.css" rel="stylesheet" type="text/css"> <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/colorbox.css" rel="stylesheet" type="text/css"/> + <link href="/assets/css/slides.css" rel="stylesheet" type="text/css"/> <link href="/assets/css/theme.css" rel="stylesheet" type="text/css"/> %if has_custom_css: -<!-- Custom CSS here --> <link href="/assets/css/custom.css" rel="stylesheet" type="text/css"> %endif + <link href="/assets/css/bootstrap-responsive.css" rel="stylesheet" type="text/css"> + <script src="/assets/js/jquery-1.7.2.min.js" type="text/javascript"></script> + <script src="/assets/js/jquery.colorbox-min.js" type="text/javascript"></script> + <script src="/assets/js/slides.min.jquery.js" type="text/javascript"></script> + <script src="/assets/js/bootstrap.min.js" type="text/javascript"></script> %endif + <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements --> + <!--[if lt IE 9]> + <script src="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script> + <![endif]--> %if rss_link: ${rss_link} %else: @@ -24,6 +36,11 @@ <link rel="alternate" type="application/rss+xml" title="RSS (${language})" href="${_link('rss', None, lang)}"> %endfor %endif + %if favicons: + %for name, file, size in favicons: + <link rel="${name}" href="${file}" sizes="${size}"/> + %endfor + %endif </%def> diff --git a/nikola/data/themes/orphan/templates/disqus_helper.tmpl b/nikola/data/themes/orphan/templates/disqus_helper.tmpl new file mode 100644 index 0000000..674e20e --- /dev/null +++ b/nikola/data/themes/orphan/templates/disqus_helper.tmpl @@ -0,0 +1,40 @@ +## -*- coding: utf-8 -*- +<%! + import json +%> +<%def name="html_disqus(url, title, identifier)"> + %if disqus_forum: + <div id="disqus_thread"></div> + <script type="text/javascript"> + var disqus_shortname ="${disqus_forum}"; + %if url: + var disqus_url="${url}"; + %endif + var disqus_title=${json.dumps(title)}; + var disqus_identifier="${identifier}"; + var disqus_config = function () { + this.language = "${lang}"; + }; + (function() { + var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; + dsq.src = 'http://' + 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> + %endif +</%def> + +<%def name="html_disqus_link(link, identifier)"> + <p> + %if disqus_forum: + <a href="${link}" data-disqus-identifier="${identifier}">Comments</a> + %endif +</%def> + + +<%def name="html_disqus_script()"> + %if disqus_forum: + <script type="text/javascript">var disqus_shortname="${disqus_forum}";(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> + %endif +</%def> diff --git a/nikola/data/themes/orphan/templates/gallery.tmpl b/nikola/data/themes/orphan/templates/gallery.tmpl index 37d749f..3186cc8 100644 --- a/nikola/data/themes/orphan/templates/gallery.tmpl +++ b/nikola/data/themes/orphan/templates/gallery.tmpl @@ -1,5 +1,6 @@ ## -*- coding: utf-8 -*- <%inherit file="base.tmpl"/> +<%namespace name="disqus" file="disqus_helper.tmpl"/> <%block name="sourcelink"></%block> <%block name="content"> @@ -24,4 +25,7 @@ <img src="${image[1]}" /></a></li> %endfor </ul> +%if enable_comments: + ${disqus.html_disqus(None, permalink, title)} +%endif </%block> diff --git a/nikola/data/themes/orphan/templates/index.tmpl b/nikola/data/themes/orphan/templates/index.tmpl index 03dd1f8..1a436e2 100644 --- a/nikola/data/themes/orphan/templates/index.tmpl +++ b/nikola/data/themes/orphan/templates/index.tmpl @@ -1,5 +1,6 @@ ## -*- coding: utf-8 -*- <%namespace name="helper" file="index_helper.tmpl"/> +<%namespace name="disqus" file="disqus_helper.tmpl"/> <%inherit file="base.tmpl"/> <%block name="content"> % for post in posts: @@ -10,9 +11,9 @@ </small></h1> <hr> ${post.text(lang, index_teasers)} - ${helper.html_disqus_link(post)} + ${disqus.html_disqus_link(post.permalink()+"#disqus_thread", post.base_path)} </div> % endfor ${helper.html_pager()} - ${helper.html_disqus_script()} + ${disqus.html_disqus_script()} </%block> diff --git a/nikola/data/themes/orphan/templates/index_helper.tmpl b/nikola/data/themes/orphan/templates/index_helper.tmpl index cfecdf3..114a730 100644 --- a/nikola/data/themes/orphan/templates/index_helper.tmpl +++ b/nikola/data/themes/orphan/templates/index_helper.tmpl @@ -1,3 +1,4 @@ +## -*- coding: utf-8 -*- <%def name="html_pager()"> <div> <ul class="pager"> @@ -14,18 +15,3 @@ </ul> </div> </%def> - - -<%def name="html_disqus_link(post)"> - <p> - %if disqus_forum: - <a href="${post.permalink()}#disqus_thread">Comments</a> - %endif -</%def> - - -<%def name="html_disqus_script()"> - %if disqus_forum: - <script type="text/javascript">var disqus_shortname="${disqus_forum}";(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> - %endif -</%def> diff --git a/nikola/data/themes/orphan/templates/post.tmpl b/nikola/data/themes/orphan/templates/post.tmpl index 306192d..672d4f6 100644 --- a/nikola/data/themes/orphan/templates/post.tmpl +++ b/nikola/data/themes/orphan/templates/post.tmpl @@ -1,5 +1,6 @@ ## -*- coding: utf-8 -*- <%namespace name="helper" file="post_helper.tmpl"/> +<%namespace name="disqus" file="disqus_helper.tmpl"/> <%inherit file="base.tmpl"/> <%block name="content"> <div class="postbox"> @@ -9,12 +10,12 @@ ${messages[lang]["Posted"]}: ${post.date.strftime(date_format)} ${helper.html_translations(post)} | - <a href="${post.pagenames[lang]+'.txt'}">${messages[lang]["Source"]}</a> + <a href="${post.pagenames[lang]+'.txt'}" id="sourcelink">${messages[lang]["Source"]}</a> ${helper.html_tags(post)} </small> <hr> ${post.text(lang)} ${helper.html_pager(post)} - ${helper.html_disqus(post)} + ${disqus.html_disqus(post.permalink(absolute=True), post.title(lang), post.base_path)} </div> </%block> diff --git a/nikola/data/themes/orphan/templates/post_helper.tmpl b/nikola/data/themes/orphan/templates/post_helper.tmpl index 3e874e9..a3dc75f 100644 --- a/nikola/data/themes/orphan/templates/post_helper.tmpl +++ b/nikola/data/themes/orphan/templates/post_helper.tmpl @@ -1,3 +1,4 @@ +## -*- coding: utf-8 -*- <%def name="html_title()"> <h1>${title}</h1> % if link: @@ -9,7 +10,7 @@ <%def name="html_translations(post)"> %if len(translations) > 1: %for langname in translations.keys(): - %if langname != lang: + %if langname != lang and post.is_translation_available(langname): | <a href="${post.permalink(langname)}">${messages[langname]["Read in English"]}</a> %endif @@ -28,16 +29,6 @@ </%def> -<%def name="html_disqus(post)"> - %if disqus_forum: - <div id="disqus_thread"></div> - <script type="text/javascript">var disqus_shortname="${disqus_forum}";var disqus_url="${post.permalink(absolute=True)}";(function(){var a=document.createElement("script");a.type="text/javascript";a.async=true;a.src="http://"+disqus_shortname+".disqus.com/embed.js";(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(a)})(); </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> - %endif -</%def> - - <%def name="html_pager(post)"> <ul class="pager"> %if post.prev_post: diff --git a/nikola/data/themes/orphan/templates/story.tmpl b/nikola/data/themes/orphan/templates/story.tmpl index deb0a46..30d263b 100644 --- a/nikola/data/themes/orphan/templates/story.tmpl +++ b/nikola/data/themes/orphan/templates/story.tmpl @@ -5,4 +5,7 @@ <h1>${title}</h1> %endif ${post.text(lang)} +%if enable_comments: + ${disqus.html_disqus(post.permalink(absolute=True), post.title(lang), post.base_path)} +%endif </%block> diff --git a/nikola/data/themes/site/templates/base.tmpl b/nikola/data/themes/site/templates/base.tmpl index 784f29a..2094d9a 100644 --- a/nikola/data/themes/site/templates/base.tmpl +++ b/nikola/data/themes/site/templates/base.tmpl @@ -3,6 +3,7 @@ <!DOCTYPE html> <html lang="${lang}"> <head> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> ${html_head()} <%block name="extra_head"> </%block> @@ -12,34 +13,50 @@ <div class="navbar navbar-fixed-top"> <div class="navbar-inner"> <div class="container"> + + <!-- .btn-navbar is used as the toggle for collapsed navbar content --> + <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </a> + <a class="brand" href="${abs_link('/')}"> ${blog_title} </a> - <ul class="nav"> - ${html_sidebar_links()} - </ul> - %if search_form: - ${search_form} - %endif - <ul class="nav pull-right"> - <%block name="belowtitle"> - %if len(translations) > 1: - <li>${html_translations()}</li> - %endif - </%block> - <%block name="sourcelink"> </%block> - </ul> + <!-- Everything you want hidden at 940px or less, place within here --> + <div class="nav-collapse collapse"> + <ul class="nav"> + ${html_sidebar_links()} + </ul> + %if search_form: + ${search_form} + %endif + <ul class="nav pull-right"> + <%block name="belowtitle"> + %if len(translations) > 1: + <li>${html_translations()}</li> + %endif + </%block> + <%block name="sourcelink"> </%block> + </ul> + </div> </div> </div> </div> <!-- End of Menubar --> -<div class="container" id="container"> +<div class="container-fluid" id="container-fluid"> <!--Body content--> + <div class="row-fluid"> + <div class="span2"></div> + <div class="span8"> <%block name="content"></%block> + </div> + </div> <!--End of body content--> - <div class="footerbox"> +</div> +<div class="footerbox"> ${content_footer} - </div> </div> ${html_social()} ${analytics} diff --git a/nikola/data/themes/site/templates/post.tmpl b/nikola/data/themes/site/templates/post.tmpl index 06ca10f..785385f 100644 --- a/nikola/data/themes/site/templates/post.tmpl +++ b/nikola/data/themes/site/templates/post.tmpl @@ -1,5 +1,6 @@ ## -*- coding: utf-8 -*- <%namespace name="helper" file="post_helper.tmpl"/> +<%namespace name="disqus" file="disqus_helper.tmpl"/> <%inherit file="base.tmpl"/> <%block name="content"> <div class="postbox"> @@ -13,12 +14,12 @@ <hr> ${post.text(lang)} ${helper.html_pager(post)} - ${helper.html_disqus(post)} + ${disqus.html_disqus(post.permalink(absolute=True), post.title(lang), post.base_path)} </div> </%block> <%block name="sourcelink"> <li> - <a href="${post.pagenames[lang]+post.source_ext()}">${messages[lang]["Source"]}</a> + <a href="${post.pagenames[lang]+post.source_ext()}" id="sourcelink">${messages[lang]["Source"]}</a> </li> </%block> |
