diff options
| author | 2013-05-30 17:41:06 -0300 | |
|---|---|---|
| committer | 2013-05-30 17:41:06 -0300 | |
| commit | 0c4dfdec5b55b6064dccc38bbfb0a7c0699c895a (patch) | |
| tree | a6707225ccc559f7edf50ddd3fdc7fc85145c921 /nikola/data/themes/monospace | |
| parent | 8b14a1e5b2ca574fdd4fd2377567ec98a110d4b6 (diff) | |
Imported Upstream version 5.4.4
Diffstat (limited to 'nikola/data/themes/monospace')
12 files changed, 92 insertions, 107 deletions
diff --git a/nikola/data/themes/monospace/assets/css/code.css b/nikola/data/themes/monospace/assets/css/code.css deleted file mode 100644 index b1d7ace..0000000 --- a/nikola/data/themes/monospace/assets/css/code.css +++ /dev/null @@ -1,62 +0,0 @@ -pre { word-break: pre; white-space: pre; word-wrap: pre; overflow: auto; max-width: 100%;} -td.linenos { vertical-align: top; width: 4em;} -div.code > pre, .code -{ background: #f8f8f8; white-space: pre;} -.code .c { color: #008800; font-style: italic } /* Comment */ -.code .err { border: 1px solid #FF0000 } /* Error */ -.code .k { color: #AA22FF; font-weight: bold } /* Keyword */ -.code .o { color: #666666 } /* Operator */ -.code .cm { color: #008800; font-style: italic } /* Comment.Multiline */ -.code .cp { color: #008800 } /* Comment.Preproc */ -.code .c1 { color: #008800; font-style: italic } /* Comment.Single */ -.code .cs { color: #008800; font-weight: bold } /* Comment.Special */ -.code .gd { color: #A00000 } /* Generic.Deleted */ -.code .ge { font-style: italic } /* Generic.Emph */ -.code .gr { color: #FF0000 } /* Generic.Error */ -.code .gh { color: #000080; font-weight: bold } /* Generic.Heading */ -.code .gi { color: #00A000 } /* Generic.Inserted */ -.code .go { color: #808080 } /* Generic.Output */ -.code .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ -.code .gs { font-weight: bold } /* Generic.Strong */ -.code .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ -.code .gt { color: #0040D0 } /* Generic.Traceback */ -.code .kc { color: #AA22FF; font-weight: bold } /* Keyword.Constant */ -.code .kd { color: #AA22FF; font-weight: bold } /* Keyword.Declaration */ -.code .kp { color: #AA22FF } /* Keyword.Pseudo */ -.code .kr { color: #AA22FF; font-weight: bold } /* Keyword.Reserved */ -.code .kt { color: #AA22FF; font-weight: bold } /* Keyword.Type */ -.code .m { color: #666666 } /* Literal.Number */ -.code .s { color: #BB4444 } /* Literal.String */ -.code .na { color: #BB4444 } /* Name.Attribute */ -.code .nb { color: #AA22FF } /* Name.Builtin */ -.code .nc { color: #0000FF } /* Name.Class */ -.code .no { color: #880000 } /* Name.Constant */ -.code .nd { color: #AA22FF } /* Name.Decorator */ -.code .ni { color: #999999; font-weight: bold } /* Name.Entity */ -.code .ne { color: #D2413A; font-weight: bold } /* Name.Exception */ -.code .nf { color: #00A000 } /* Name.Function */ -.code .nl { color: #A0A000 } /* Name.Label */ -.code .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ -.code .nt { color: #008000; font-weight: bold } /* Name.Tag */ -.code .nv { color: #B8860B } /* Name.Variable */ -.code .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ -.code .mf { color: #666666 } /* Literal.Number.Float */ -.code .mh { color: #666666 } /* Literal.Number.Hex */ -.code .mi { color: #666666 } /* Literal.Number.Integer */ -.code .mo { color: #666666 } /* Literal.Number.Oct */ -.code .sb { color: #BB4444 } /* Literal.String.Backtick */ -.code .sc { color: #BB4444 } /* Literal.String.Char */ -.code .sd { color: #BB4444; font-style: italic } /* Literal.String.Doc */ -.code .s2 { color: #BB4444 } /* Literal.String.Double */ -.code .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */ -.code .sh { color: #BB4444 } /* Literal.String.Heredoc */ -.code .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */ -.code .sx { color: #008000 } /* Literal.String.Other */ -.code .sr { color: #BB6688 } /* Literal.String.Regex */ -.code .s1 { color: #BB4444 } /* Literal.String.Single */ -.code .ss { color: #B8860B } /* Literal.String.Symbol */ -.code .bp { color: #AA22FF } /* Name.Builtin.Pseudo */ -.code .vc { color: #B8860B } /* Name.Variable.Class */ -.code .vg { color: #B8860B } /* Name.Variable.Global */ -.code .vi { color: #B8860B } /* Name.Variable.Instance */ -.code .il { color: #666666 } /* Literal.Number.Integer.Long */ diff --git a/nikola/data/themes/monospace/bundles b/nikola/data/themes/monospace/bundles index aa35d9c..4760181 100644 --- a/nikola/data/themes/monospace/bundles +++ b/nikola/data/themes/monospace/bundles @@ -1 +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/monospace/templates/base.tmpl b/nikola/data/themes/monospace/templates/base.tmpl index 9eecbd4..806795d 100644 --- a/nikola/data/themes/monospace/templates/base.tmpl +++ b/nikola/data/themes/monospace/templates/base.tmpl @@ -1,11 +1,13 @@ ## -*- coding: utf-8 -*- <%namespace file="base_helper.tmpl" import="*"/> +${set_locale(lang)} <!DOCTYPE html> <html lang="${lang}"> <head> ${html_head()} <%block name="extra_head"> </%block> + ${extra_head_data} </head> <body class="home blog"> %if add_this_buttons: @@ -23,7 +25,7 @@ <%block name="belowtitle"> %if len(translations) > 1: <small> - ${(messages[lang][u"Also available in"])}: + ${(messages("Also available in"))}: ${html_translations()} </small> %endif @@ -38,6 +40,6 @@ <div id="footer"> ${content_footer} </div> - </div> + </div> ${analytics} </body> diff --git a/nikola/data/themes/monospace/templates/base_helper.tmpl b/nikola/data/themes/monospace/templates/base_helper.tmpl index aba8dff..4f3e45b 100644 --- a/nikola/data/themes/monospace/templates/base_helper.tmpl +++ b/nikola/data/themes/monospace/templates/base_helper.tmpl @@ -4,27 +4,29 @@ <meta name="description" content="${description}" > <meta name="author" content="${blog_author}"> <title>${title} | ${blog_title}</title> - <!-- Le styles --> + ${mathjax_config} %if use_bundles: - <link href="/assets/css/all.css" rel="stylesheet" type="text/css"> - <script src="/assets/js/all.js" type="text/javascript"></script> + %if use_cdn: + <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/css/bootstrap-combined.min.css" rel="stylesheet"> + <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/bootstrap.css" rel="stylesheet" type="text/css"> + %if use_cdn: + <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/css/bootstrap-combined.min.css" rel="stylesheet"> + %else: + <link href="/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css"> + <link href="/assets/css/bootstrap-responsive.min.css" rel="stylesheet" type="text/css"> + %endif <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: <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]--> @@ -32,7 +34,7 @@ ${rss_link} %else: %for language in translations: - <link rel="alternate" type="application/rss+xml" title="RSS (${language})" href="${_link('rss', None, lang)}"> + <link rel="alternate" type="application/rss+xml" title="RSS (${language})" href="${_link('rss', None, language)}"> %endfor %endif %if favicons: @@ -48,10 +50,10 @@ <!-- Social buttons --> <div id="addthisbox" class="addthis_toolbox addthis_peekaboo_style addthis_default_style addthis_label_style addthis_32x32_style"> <a class="addthis_button_more">Share</a> - <ul><li><a class="addthis_button_facebook"></a></li> - <li><a class="addthis_button_google_plusone_share"></a></li> - <li><a class="addthis_button_linkedin"></a></li> - <li><a class="addthis_button_twitter"></a></li> + <ul><li><a class="addthis_button_facebook"></a> + <li><a class="addthis_button_google_plusone_share"></a> + <li><a class="addthis_button_linkedin"></a> + <li><a class="addthis_button_twitter"></a> </ul> </div> <script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-4f7088a56bb93798"></script> @@ -74,7 +76,7 @@ <%def name="html_translations()"> %for langname in translations.keys(): %if langname != lang: - <a href="${_link("index", None, langname)}">${messages[langname]["LANGUAGE"]}</a> + <a href="${_link("index", None, langname)}">${messages("LANGUAGE", langname)}</a> %endif %endfor </%def> diff --git a/nikola/data/themes/monospace/templates/disqus_helper.tmpl b/nikola/data/themes/monospace/templates/disqus_helper.tmpl index 674e20e..4c60f85 100644 --- a/nikola/data/themes/monospace/templates/disqus_helper.tmpl +++ b/nikola/data/themes/monospace/templates/disqus_helper.tmpl @@ -1,6 +1,9 @@ ## -*- coding: utf-8 -*- <%! import json + translations = { + 'es': 'es_ES', + } %> <%def name="html_disqus(url, title, identifier)"> %if disqus_forum: @@ -12,8 +15,8 @@ %endif var disqus_title=${json.dumps(title)}; var disqus_identifier="${identifier}"; - var disqus_config = function () { - this.language = "${lang}"; + var disqus_config = function () { + this.language = "${translations.get(lang, lang)}"; }; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; diff --git a/nikola/data/themes/monospace/templates/index.tmpl b/nikola/data/themes/monospace/templates/index.tmpl index ee57d26..4a0c630 100644 --- a/nikola/data/themes/monospace/templates/index.tmpl +++ b/nikola/data/themes/monospace/templates/index.tmpl @@ -5,22 +5,24 @@ <%block name="content"> % for post in posts: <div class="postbox"> - <h1><a href="${post.permalink(lang)}">${post.title(lang)}</a></h1> + <h1><a href="${post.permalink()}">${post.title()}</a></h1> <div class="meta" style="background-color: rgb(234, 234, 234); "> <span class="authordate"> - ${messages[lang]["Posted"]}: ${post.date.strftime(date_format)} + ${messages("Posted")}: ${post.formatted_date(date_format)} </span> <br> <span class="tags">Tags: %if post.tags: %for tag in post.tags: - <a class="tag" href="${_link('tag', tag, lang)}"><span class="badge badge-info">${tag}</span></a> + <a class="tag" href="${_link('tag', tag)}"><span class="badge badge-info">${tag}</span></a> %endfor %endif </span> </div> - ${post.text(lang, index_teasers)} - ${disqus.html_disqus_link(post.permalink()+"#disqus_thread", post.base_path)} + ${post.text(teaser_only=index_teasers)} + % if not post.meta('nocomments'): + ${disqus.html_disqus_link(post.permalink()+"#disqus_thread", post.base_path)} + % endif </div> % endfor ${helper.html_pager()} diff --git a/nikola/data/themes/monospace/templates/index_helper.tmpl b/nikola/data/themes/monospace/templates/index_helper.tmpl index 114a730..1bb700c 100644 --- a/nikola/data/themes/monospace/templates/index_helper.tmpl +++ b/nikola/data/themes/monospace/templates/index_helper.tmpl @@ -4,12 +4,12 @@ <ul class="pager"> %if prevlink: <li class="previous"> - <a href="${prevlink}">← ${messages[lang]["Newer posts"]}</a> + <a href="${prevlink}">← ${messages("Newer posts")}</a> </li> %endif %if nextlink: <li class="next"> - <a href="${nextlink}">${messages[lang]["Older posts"]} →</a> + <a href="${nextlink}">${messages("Older posts")} →</a> </li> %endif </ul> diff --git a/nikola/data/themes/monospace/templates/list_post.tmpl b/nikola/data/themes/monospace/templates/list_post.tmpl index 1a1cdee..f0e159d 100644 --- a/nikola/data/themes/monospace/templates/list_post.tmpl +++ b/nikola/data/themes/monospace/templates/list_post.tmpl @@ -6,7 +6,7 @@ <h1>${title}</h1> <ul class="unstyled"> % for post in posts: - <li><a href="${post.permalink(lang)}">[${post.date.strftime(date_format)}] ${post.title(lang)}</a> + <li><a href="${post.permalink()}">[${post.formatted_date(date_format)}] ${post.title()}</a> % endfor </ul> </div> diff --git a/nikola/data/themes/monospace/templates/post.tmpl b/nikola/data/themes/monospace/templates/post.tmpl index 2ba27f1..0ec360d 100644 --- a/nikola/data/themes/monospace/templates/post.tmpl +++ b/nikola/data/themes/monospace/templates/post.tmpl @@ -7,13 +7,16 @@ ${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'}" id="sourcelink">${messages[lang]["Source"]}</a>] + ${messages("Posted")}: ${post.formatted_date(date_format)} + % if not post.meta('password'): + [<a href="${post.meta('slug')+'.txt'}" id="sourcelink">${messages("Source")}</a>] + % endif </span> <br> %if post.tags: - <span class="tags">${messages[lang]["Tags"]}: + <span class="tags">${messages("Tags")}: %for tag in post.tags: - <a class="tag" href="${_link('tag', tag, lang)}"><span class="badge badge-info">${tag}</span></a> + <a class="tag" href="${_link('tag', tag)}"><span class="badge badge-info">${tag}</span></a> %endfor </span> <br> @@ -22,8 +25,10 @@ ${helper.html_translations(post)} </span> </div> - ${post.text(lang)} + ${post.text()} ${helper.html_pager(post)} - ${disqus.html_disqus(post.permalink(absolute=True), post.title(lang), post.base_path)} + % if not post.meta('nocomments'): + ${disqus.html_disqus(post.permalink(absolute=True), post.title(), post.base_path)} + % endif </div> </%block> diff --git a/nikola/data/themes/monospace/templates/post_helper.tmpl b/nikola/data/themes/monospace/templates/post_helper.tmpl index 8651c65..cce0ecf 100644 --- a/nikola/data/themes/monospace/templates/post_helper.tmpl +++ b/nikola/data/themes/monospace/templates/post_helper.tmpl @@ -2,7 +2,7 @@ <%def name="html_title()"> <h1>${title}</h1> % if link: - <p><a href='${link}'>${messages[lang]["Original site"]}</a></p> + <p><a href='${link}'>${messages("Original site")}</a></p> % endif </%def> @@ -12,7 +12,7 @@ %for langname in translations.keys(): %if langname != lang and post.is_translation_available(langname): | - <a href="${post.permalink(langname)}">${messages[langname]["Read in English"]}</a> + <a href="${post.permalink(langname)}">${messages("Read in English", langname)}</a> %endif %endfor %endif @@ -21,25 +21,53 @@ <%def name="html_tags(post)"> %if post.tags: - | ${messages[lang]["More posts about"]} + | ${messages("More posts about")} %for tag in post.tags: - <a class="tag" href="${_link('tag', tag, lang)}"><span class="badge badge-info">${tag}</span></a> + <a class="tag" href="${_link('tag', tag)}"><span class="badge badge-info">${tag}</span></a> %endfor %endif </%def> - <%def name="html_pager(post)"> <ul class="pager"> %if post.prev_post: <li class="previous"> - <a href="${post.prev_post.permalink(lang)}">← ${messages[lang]["Previous post"]}</a> + <a href="${post.prev_post.permalink()}">← ${messages("Previous post")}</a> </li> %endif %if post.next_post: <li class="next"> - <a href="${post.next_post.permalink(lang)}">${messages[lang]["Next post"]} →</a> + <a href="${post.next_post.permalink()}">${messages("Next post")} →</a> </li> %endif </ul> </%def> + +<%def name="twitter_card_information(post)"> + %if twitter_card and twitter_card['use_twitter_cards']: + <meta name="twitter:card" content="${twitter_card.get('card', 'summary')|h}"> + <meta name="og:url" content="${post.permalink(absolute=True)}"> + %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 + <meta name="og:title" content="${post.title()[:70]|h}"> + %if post.description(): + <meta name="og:description" content="${post.description()[:200]|h}"> + %else: + <meta name="og:description" content="${post.text(strip_html=True)[:200]|h}"> + %endif + %endif +</%def> + +<%def name="mathjax_script(post)"> + %if post.is_mathjax: + <script src="/assets/js/mathjax.js" type="text/javascript"></script> + %endif +</%def> diff --git a/nikola/data/themes/monospace/templates/story.tmpl b/nikola/data/themes/monospace/templates/story.tmpl index 30d263b..21d0e2f 100644 --- a/nikola/data/themes/monospace/templates/story.tmpl +++ b/nikola/data/themes/monospace/templates/story.tmpl @@ -1,11 +1,15 @@ ## -*- coding: utf-8 -*- <%inherit file="post.tmpl"/> +<%namespace name="helper" file="post_helper.tmpl"/> +<%block name="extra_head"> +${helper.twitter_card_information(post)} +</%block> <%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)} + ${post.text()} +%if enable_comments and not post.meta('nocomments'): + ${disqus.html_disqus(post.permalink(absolute=True), post.title(), post.base_path)} %endif </%block> diff --git a/nikola/data/themes/monospace/templates/tag.tmpl b/nikola/data/themes/monospace/templates/tag.tmpl index 7c89ad1..97aafeb 100644 --- a/nikola/data/themes/monospace/templates/tag.tmpl +++ b/nikola/data/themes/monospace/templates/tag.tmpl @@ -2,6 +2,6 @@ <%inherit file="list_post.tmpl"/> <%block name="extra_head"> %for language in translations: - <link rel="alternate" type="application/rss+xml" type="application/rss+xml" title="RSS for tag ${tag} (${language})" href="${_link("tag_rss", tag, lang)}"> + <link rel="alternate" type="application/rss+xml" type="application/rss+xml" title="RSS for tag ${tag} (${language})" href="${_link("tag_rss", tag, language)}"> %endfor </%block> |
