From 8b14a1e5b2ca574fdd4fd2377567ec98a110d4b6 Mon Sep 17 00:00:00 2001 From: Agustin Henze Date: Wed, 13 Mar 2013 20:58:39 -0300 Subject: Imported Upstream version 5.4.2 --- nikola/data/samplesite/files/images/biohazard.png | Bin 0 -> 179 bytes nikola/data/samplesite/listings/hello.py | 3 +- .../data/samplesite/stories/creating-a-theme.meta | 3 ++ .../data/samplesite/stories/creating-a-theme.txt | 1 + nikola/data/samplesite/stories/quickref.txt | 60 ++++++++++----------- nikola/data/samplesite/stories/quickstart.txt | 18 +++---- nikola/data/themes/default/assets/css/theme.css | 7 ++- nikola/data/themes/default/assets/js/mathjax.js | 12 +++++ nikola/data/themes/default/bundles | 2 +- nikola/data/themes/default/templates/base.tmpl | 4 ++ .../data/themes/default/templates/base_helper.tmpl | 13 +++-- nikola/data/themes/default/templates/gallery.tmpl | 6 +-- nikola/data/themes/default/templates/index.tmpl | 3 +- .../themes/default/templates/index_helper.tmpl | 8 ++- nikola/data/themes/default/templates/listing.tmpl | 14 ++++- nikola/data/themes/default/templates/post.tmpl | 14 +++-- .../data/themes/default/templates/post_helper.tmpl | 31 ++++++++++- .../data/themes/jinja-default/templates/base.tmpl | 12 +++-- .../themes/jinja-default/templates/gallery.tmpl | 8 +-- .../data/themes/jinja-default/templates/index.tmpl | 4 +- .../themes/jinja-default/templates/listing.tmpl | 2 +- .../data/themes/jinja-default/templates/post.tmpl | 2 - nikola/data/themes/site/README | 2 +- nikola/data/themes/site/assets/css/theme.css | 9 +++- nikola/data/themes/site/templates/post.tmpl | 25 --------- 25 files changed, 160 insertions(+), 103 deletions(-) create mode 100644 nikola/data/samplesite/files/images/biohazard.png create mode 100644 nikola/data/samplesite/stories/creating-a-theme.meta create mode 120000 nikola/data/samplesite/stories/creating-a-theme.txt create mode 100644 nikola/data/themes/default/assets/js/mathjax.js delete mode 100644 nikola/data/themes/site/templates/post.tmpl (limited to 'nikola/data') diff --git a/nikola/data/samplesite/files/images/biohazard.png b/nikola/data/samplesite/files/images/biohazard.png new file mode 100644 index 0000000..ae4629d Binary files /dev/null and b/nikola/data/samplesite/files/images/biohazard.png differ diff --git a/nikola/data/samplesite/listings/hello.py b/nikola/data/samplesite/listings/hello.py index 695c212..885acde 100644 --- a/nikola/data/samplesite/listings/hello.py +++ b/nikola/data/samplesite/listings/hello.py @@ -4,7 +4,8 @@ import sys def hello(name='world'): - print "hello", name + greeting = "hello " + name + print(greeting) if __name__ == "__main__": hello(*sys.argv[1:]) diff --git a/nikola/data/samplesite/stories/creating-a-theme.meta b/nikola/data/samplesite/stories/creating-a-theme.meta new file mode 100644 index 0000000..fe9b69a --- /dev/null +++ b/nikola/data/samplesite/stories/creating-a-theme.meta @@ -0,0 +1,3 @@ +Creating a Theme +creating-a-theme +2012/03/13 12:00 diff --git a/nikola/data/samplesite/stories/creating-a-theme.txt b/nikola/data/samplesite/stories/creating-a-theme.txt new file mode 120000 index 0000000..108a192 --- /dev/null +++ b/nikola/data/samplesite/stories/creating-a-theme.txt @@ -0,0 +1 @@ +../../../../docs/creating-a-theme.txt \ No newline at end of file diff --git a/nikola/data/samplesite/stories/quickref.txt b/nikola/data/samplesite/stories/quickref.txt index 13ebc9b..9a06d74 100644 --- a/nikola/data/samplesite/stories/quickref.txt +++ b/nikola/data/samplesite/stories/quickref.txt @@ -55,7 +55,7 @@

Links that look like "(details)" point into the HTML version of the full reStructuredText + href="http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html">reStructuredText specification document. These are relative links; if they don't work, please use the Inline Markup -

(details) +

(details)

Inline markup allows words and phrases within text to have character styles (like italics and boldface) and functionality @@ -198,7 +198,7 @@ >Escaping with Backslashes

(details) + href="http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#escaping-mechanism">details)

reStructuredText uses backslashes ("\") to override the special meaning given to markup characters and get the literal characters @@ -246,7 +246,7 @@

Section Structure

-

(details) +

(details)

@@ -292,7 +292,7 @@

Paragraphs

-

(details) +

(details)

@@ -320,7 +320,7 @@

Bullet Lists

-

(details) +

(details)

@@ -358,7 +358,7 @@

Enumerated Lists

-

(details) +

(details)

@@ -396,7 +396,7 @@

Definition Lists

-

(details) +

(details)

@@ -437,7 +437,7 @@

Field Lists

-

(details) +

(details)

@@ -476,7 +476,7 @@

Option Lists

-

(details) +

(details)

@@ -524,7 +524,7 @@

Literal Blocks

-

(details) +

(details)

@@ -613,7 +613,7 @@

Line Blocks

-

(details) +

(details)

@@ -655,7 +655,7 @@

Block Quotes

-

(details) +

(details)

@@ -687,7 +687,7 @@

Doctest Blocks

-

(details) +

(details)

@@ -723,7 +723,7 @@

Tables

-

(details) +

(details)

There are two syntaxes for tables in reStructuredText. Grid tables are complete but cumbersome to create. Simple tables are @@ -840,7 +840,7 @@

Transitions

-

(details) +

(details)

@@ -890,7 +890,7 @@

Footnotes

-

(details) +

(details)

@@ -983,7 +983,7 @@

Citations

-

(details) +

(details)

@@ -1036,7 +1036,7 @@

Hyperlink Targets

-

(details) +

(details)

External Hyperlink Targets

@@ -1081,11 +1081,11 @@ printed documents, where the link needs to be presented explicitly, for example as a footnote. You can force usage of the call-out form by using the - "target-notes" + "target-notes" directive.

reStructuredText also provides for embedded URIs (details), + href="http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#embedded-uris">details), a convenience at the expense of readability. A hyperlink reference may directly embed a target URI inline, within angle brackets. The following is exactly equivalent to the example above: @@ -1149,7 +1149,7 @@

Indirect Hyperlink Targets

-

(details) +

(details)

@@ -1189,7 +1189,7 @@

Implicit Hyperlink Targets

-

(details) +

(details)

Section titles, footnotes, and citations automatically generate hyperlink targets (the title text or footnote/citation label is @@ -1217,12 +1217,12 @@

Directives

-

(details) +

(details)

Directives are a general-purpose extension mechanism, a way of adding support for new constructs without adding new syntax. For a description of all standard directives, see reStructuredText + href="http://docutils.sourceforge.net/docs/ref/rst/directives.html" >reStructuredText Directives.

@@ -1235,17 +1235,17 @@
For instance: -

.. image:: images/ball1.gif +

.. image:: images/biohazard.png

For instance: -

ball1 +

ball1

Substitution References and Definitions

-

(details) +

(details)

Substitutions are like inline directives, allowing graphics and arbitrary constructs within text. @@ -1268,7 +1268,7 @@ -

The biohazard symbol +

The biohazard symbol must be used on containers used to dispose of medical waste. @@ -1276,7 +1276,7 @@

Comments

-

(details) +

(details)

Any text which begins with an explicit markup start but doesn't use the syntax of any of the constructs above, is a comment. diff --git a/nikola/data/samplesite/stories/quickstart.txt b/nikola/data/samplesite/stories/quickstart.txt index a74d8fa..1a0f330 100644 --- a/nikola/data/samplesite/stories/quickstart.txt +++ b/nikola/data/samplesite/stories/quickstart.txt @@ -96,7 +96,7 @@ __ quickref.html#escaping middle of a word won't be recognized. See the `markup spec`__ for full details. -__ ../../ref/rst/restructuredtext.html#inline-markup +__ http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#inline-markup Lists @@ -362,18 +362,18 @@ __ quickref.html#directives To include an image in your document, you use the the ``image`` directive__. For example:: - .. image:: images/biohazard.png + .. image:: /images/biohazard.png results in: -.. image:: images/biohazard.png +.. image:: /images/biohazard.png -The ``images/biohazard.png`` part indicates the filename of the image +The ``/images/biohazard.png`` part indicates the filename of the image you wish to appear in the document. There's no restriction placed on the image (format, size etc). If the image is to appear in HTML and you wish to supply additional information, you may:: - .. image:: images/biohazard.png + .. image:: /images/biohazard.png :height: 100 :width: 200 :scale: 50 @@ -381,8 +381,8 @@ you wish to supply additional information, you may:: See the full `image directive documentation`__ for more info. -__ ../../ref/rst/directives.html -__ ../../ref/rst/directives.html#images +__ http://docutils.sourceforge.net/docs/ref/rst/directives.html +__ http://docutils.sourceforge.net/docs/ref/rst/directives.html#images What Next? @@ -401,6 +401,6 @@ list. http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html. .. _reStructuredText Markup Specification: - ../../ref/rst/restructuredtext.html -.. _Docutils-users: ../mailing-lists.html#docutils-users + http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html +.. _Docutils-users: http://docutils.sourceforge.net/docs/user/mailing-lists.html#docutils-users .. _Docutils project web site: http://docutils.sourceforge.net/ diff --git a/nikola/data/themes/default/assets/css/theme.css b/nikola/data/themes/default/assets/css/theme.css index 6f3d4cb..0523ce9 100644 --- a/nikola/data/themes/default/assets/css/theme.css +++ b/nikola/data/themes/default/assets/css/theme.css @@ -49,9 +49,14 @@ div.figure > a > img { margin-right: auto; } -div.admonition, div.attention, div.caution, div.danger, div.error, div.hint, div.important, div.note, div.tip, div.warning { +div.sidebar, div.admonition, div.attention, div.caution, div.danger, div.error, div.hint, div.important, div.note, div.tip, div.warning { /* Issue 277 */ border: 1px solid #aaa; border-radius: 5px; } +blockquote p, blockquote { + font-size: 17.5px; + font-weight: 300; + line-height: 1.25; +} diff --git a/nikola/data/themes/default/assets/js/mathjax.js b/nikola/data/themes/default/assets/js/mathjax.js new file mode 100644 index 0000000..2f4e773 --- /dev/null +++ b/nikola/data/themes/default/assets/js/mathjax.js @@ -0,0 +1,12 @@ +// We wait for the onload function to load MathJax after the page is completely loaded. +// MathJax is loaded 1 unit of time after the page is ready. +// This hack prevent problems when you use social button from addthis. +// +window.onload = function () { + setTimeout(function () { + var script = document.createElement("script"); + script.type = "text/javascript"; + script.src = "https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"; + document.getElementsByTagName("body")[0].appendChild(script); + },1) +} \ No newline at end of file diff --git a/nikola/data/themes/default/bundles b/nikola/data/themes/default/bundles index 10f44e7..35af9c0 100644 --- a/nikola/data/themes/default/bundles +++ b/nikola/data/themes/default/bundles @@ -1,4 +1,4 @@ assets/css/all-nocdn.css=bootstrap.css,bootstrap-responsive.css,rst.css,code.css,colorbox.css,slides.css,theme.css,custom.css assets/css/all.css=rst.css,code.css,colorbox.css,slides.css,theme.css,custom.css -assets/js/all-nocdn.js=bootstrap.min.js,jquery-1.7.2.min.js,jquery.colorbox-min.js,slides.min.jquery.js +assets/js/all-nocdn.js=jquery-1.7.2.min.js,bootstrap.min.js,jquery.colorbox-min.js,slides.min.jquery.js assets/js/all.js=jquery.colorbox-min.js,slides.min.jquery.js diff --git a/nikola/data/themes/default/templates/base.tmpl b/nikola/data/themes/default/templates/base.tmpl index 7af8497..c0935a2 100644 --- a/nikola/data/themes/default/templates/base.tmpl +++ b/nikola/data/themes/default/templates/base.tmpl @@ -48,6 +48,10 @@ + + + + ${analytics} ${late_load_js()} diff --git a/nikola/data/themes/default/templates/base_helper.tmpl b/nikola/data/themes/default/templates/base_helper.tmpl index 51969c9..eb22905 100644 --- a/nikola/data/themes/default/templates/base_helper.tmpl +++ b/nikola/data/themes/default/templates/base_helper.tmpl @@ -4,7 +4,7 @@ ${title} | ${blog_title} - + ${mathjax_config} %if use_bundles: %if use_cdn: @@ -28,7 +28,6 @@ %endif %endif - @@ -36,7 +35,7 @@ ${rss_link} %else: %for language in translations: - + %endfor %endif %if favicons: @@ -73,10 +72,10 @@

Share -
diff --git a/nikola/data/themes/default/templates/gallery.tmpl b/nikola/data/themes/default/templates/gallery.tmpl index 3186cc8..09c25cc 100644 --- a/nikola/data/themes/default/templates/gallery.tmpl +++ b/nikola/data/themes/default/templates/gallery.tmpl @@ -6,7 +6,7 @@ <%block name="content"> %if text: @@ -16,13 +16,13 @@ %endif %if enable_comments: diff --git a/nikola/data/themes/default/templates/index.tmpl b/nikola/data/themes/default/templates/index.tmpl index 1a436e2..4f66867 100644 --- a/nikola/data/themes/default/templates/index.tmpl +++ b/nikola/data/themes/default/templates/index.tmpl @@ -7,7 +7,7 @@

${post.title(lang)}    - ${messages[lang]["Posted"]}: ${post.date.strftime(date_format)} + ${messages[lang]["Posted"]}:


${post.text(lang, index_teasers)} @@ -16,4 +16,5 @@ % endfor ${helper.html_pager()} ${disqus.html_disqus_script()} + ${helper.mathjax_script(post)} diff --git a/nikola/data/themes/default/templates/index_helper.tmpl b/nikola/data/themes/default/templates/index_helper.tmpl index 114a730..151b4d2 100644 --- a/nikola/data/themes/default/templates/index_helper.tmpl +++ b/nikola/data/themes/default/templates/index_helper.tmpl @@ -5,13 +5,17 @@ %if prevlink: %endif %if nextlink: %endif
+ +<%def name="mathjax_script(post)"> + %if any(post.is_mathjax for post in posts): + + %endif + diff --git a/nikola/data/themes/default/templates/listing.tmpl b/nikola/data/themes/default/templates/listing.tmpl index 596a704..f279af0 100644 --- a/nikola/data/themes/default/templates/listing.tmpl +++ b/nikola/data/themes/default/templates/listing.tmpl @@ -3,8 +3,18 @@ <%block name="content"> -${code} + +% if code: + ${code} +% endif diff --git a/nikola/data/themes/default/templates/post.tmpl b/nikola/data/themes/default/templates/post.tmpl index 672d4f6..22d8a58 100644 --- a/nikola/data/themes/default/templates/post.tmpl +++ b/nikola/data/themes/default/templates/post.tmpl @@ -2,20 +2,28 @@ <%namespace name="helper" file="post_helper.tmpl"/> <%namespace name="disqus" file="disqus_helper.tmpl"/> <%inherit file="base.tmpl"/> +<%block name="extra_head"> +${helper.twitter_card_information(post)} + <%block name="content">
${helper.html_title()}
- ${messages[lang]["Posted"]}: ${post.date.strftime(date_format)} + ${messages[lang]["Posted"]}: ${helper.html_translations(post)} -   |   - ${messages[lang]["Source"]} ${helper.html_tags(post)}
${post.text(lang)} ${helper.html_pager(post)} ${disqus.html_disqus(post.permalink(absolute=True), post.title(lang), post.base_path)} + ${helper.mathjax_script(post)}
+ +<%block name="sourcelink"> +
  • + ${messages[lang]["Source"]} +
  • + diff --git a/nikola/data/themes/default/templates/post_helper.tmpl b/nikola/data/themes/default/templates/post_helper.tmpl index ab08359..911a831 100644 --- a/nikola/data/themes/default/templates/post_helper.tmpl +++ b/nikola/data/themes/default/templates/post_helper.tmpl @@ -33,12 +33,39 @@ %if post.prev_post: %endif %if post.next_post: %endif + +<%def name="twitter_card_information(post)"> + %if twitter_card and twitter_card['use_twitter_cards']: + + + %if 'site:id' in twitter_card: + + %elif 'site' in twitter_card: + + %endif + %if 'creator:id' in twitter_card: + + %elif 'creator' in twitter_card: + + %endif + + %if post.description(lang): + + %else: + + %endif + %endif + + +<%def name="mathjax_script(post)"> + %if post.is_mathjax: + + %endif + diff --git a/nikola/data/themes/jinja-default/templates/base.tmpl b/nikola/data/themes/jinja-default/templates/base.tmpl index 32e5d48..97cddff 100644 --- a/nikola/data/themes/jinja-default/templates/base.tmpl +++ b/nikola/data/themes/jinja-default/templates/base.tmpl @@ -93,15 +93,19 @@
    Share -
    {% endif %} + + + + {{analytics}} {% if use_bundles %} diff --git a/nikola/data/themes/jinja-default/templates/gallery.tmpl b/nikola/data/themes/jinja-default/templates/gallery.tmpl index 34ff439..9b16df6 100644 --- a/nikola/data/themes/jinja-default/templates/gallery.tmpl +++ b/nikola/data/themes/jinja-default/templates/gallery.tmpl @@ -4,7 +4,7 @@ {% block content %} {% if text %} @@ -14,13 +14,13 @@ {% endif %} {%if enable_comments %} diff --git a/nikola/data/themes/jinja-default/templates/index.tmpl b/nikola/data/themes/jinja-default/templates/index.tmpl index ad54c19..ab0392c 100644 --- a/nikola/data/themes/jinja-default/templates/index.tmpl +++ b/nikola/data/themes/jinja-default/templates/index.tmpl @@ -19,12 +19,10 @@ {%if prevlink %} {% endif %} {% if nextlink %} + {{messages[lang]["Older posts"]}} → {% endif %} diff --git a/nikola/data/themes/jinja-default/templates/listing.tmpl b/nikola/data/themes/jinja-default/templates/listing.tmpl index 8310635..493624a 100644 --- a/nikola/data/themes/jinja-default/templates/listing.tmpl +++ b/nikola/data/themes/jinja-default/templates/listing.tmpl @@ -2,7 +2,7 @@ {% block content %} {{code}} diff --git a/nikola/data/themes/jinja-default/templates/post.tmpl b/nikola/data/themes/jinja-default/templates/post.tmpl index 2a356c5..d14e973 100644 --- a/nikola/data/themes/jinja-default/templates/post.tmpl +++ b/nikola/data/themes/jinja-default/templates/post.tmpl @@ -32,12 +32,10 @@ {%if post.prev_post %} {% endif %} {%if post.next_post %} {% endif %} {% if disqus_forum %} diff --git a/nikola/data/themes/site/README b/nikola/data/themes/site/README index 6cbc7dd..c89543c 100644 --- a/nikola/data/themes/site/README +++ b/nikola/data/themes/site/README @@ -29,4 +29,4 @@ default duckduckgo search form: - """ % BLOG_URL + """ % SITE_URL diff --git a/nikola/data/themes/site/assets/css/theme.css b/nikola/data/themes/site/assets/css/theme.css index 0183c69..aa0ee4a 100644 --- a/nikola/data/themes/site/assets/css/theme.css +++ b/nikola/data/themes/site/assets/css/theme.css @@ -52,8 +52,15 @@ div.figure > a > img { margin-right: auto; } -div.admonition, div.attention, div.caution, div.danger, div.error, div.hint, div.important, div.note, div.tip, div.warning { +div.sidebar, div.admonition, div.attention, div.caution, div.danger, div.error, div.hint, div.important, div.note, div.tip, div.warning { /* Issue 277 */ border: 1px solid #aaa; border-radius: 5px; } + +blockquote p, blockquote { + font-size: 17.5px; + font-weight: 300; + line-height: 1.25; +} + diff --git a/nikola/data/themes/site/templates/post.tmpl b/nikola/data/themes/site/templates/post.tmpl deleted file mode 100644 index 785385f..0000000 --- a/nikola/data/themes/site/templates/post.tmpl +++ /dev/null @@ -1,25 +0,0 @@ -## -*- coding: utf-8 -*- -<%namespace name="helper" file="post_helper.tmpl"/> -<%namespace name="disqus" file="disqus_helper.tmpl"/> -<%inherit file="base.tmpl"/> -<%block name="content"> -
    - ${helper.html_title()} -
    - - ${messages[lang]["Posted"]}: ${post.date.strftime(date_format)} - ${helper.html_translations(post)} - ${helper.html_tags(post)} - -
    - ${post.text(lang)} - ${helper.html_pager(post)} - ${disqus.html_disqus(post.permalink(absolute=True), post.title(lang), post.base_path)} -
    - - -<%block name="sourcelink"> -
  • - ${messages[lang]["Source"]} -
  • - -- cgit v1.2.3