aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatarAgustin Henze <tin@sluc.org.ar>2014-02-28 08:49:38 -0300
committerLibravatarAgustin Henze <tin@sluc.org.ar>2014-02-28 08:49:38 -0300
commit2828399ba5cbb14502b023d4de1ba02f13dd5055 (patch)
tree38012b6bacaa508ca56fb6f4ba87b912bb54b8c9
parentca94afc07df55cb7fc6fe3b4f3011877b7881195 (diff)
downloadnikola-2828399ba5cbb14502b023d4de1ba02f13dd5055.tar.bz2
nikola-2828399ba5cbb14502b023d4de1ba02f13dd5055.tar.xz
nikola-2828399ba5cbb14502b023d4de1ba02f13dd5055.tar.zst
Imported Upstream version 6.3.0upstream/6.3.0
-rw-r--r--.gitignore5
-rw-r--r--.travis.yml24
-rw-r--r--AUTHORS.txt2
-rw-r--r--CHANGES.txt61
-rw-r--r--CONTRIBUTING.rst6
-rw-r--r--LICENSE.txt2
-rw-r--r--MANIFEST.in1
-rw-r--r--README.rst10
-rw-r--r--docs/creating-a-site.txt4
-rw-r--r--docs/creating-a-theme.txt4
-rw-r--r--docs/extending.txt2
-rw-r--r--docs/getting-help.txt75
-rw-r--r--docs/internals.txt2
-rw-r--r--docs/man/nikola.115
-rw-r--r--docs/manual.txt151
-rw-r--r--docs/social_buttons.txt2
-rw-r--r--docs/sphinx/conf.py6
-rw-r--r--docs/sphinx/index.txt8
-rw-r--r--docs/theming.txt6
-rw-r--r--docs/upgrading-to-v6.txt54
-rw-r--r--dodo.py88
-rw-r--r--nikola/__init__.py30
-rw-r--r--nikola/__main__.py (renamed from nikola/main.py)25
-rw-r--r--nikola/conf.py.in78
-rw-r--r--nikola/data/samplesite/files/assets/css/custom.css0
-rw-r--r--nikola/data/samplesite/galleries/demo/index.txt4
-rw-r--r--nikola/data/themes/base/assets/css/theme.css1
-rw-r--r--nikola/data/themes/base/assets/js/mathjax.js9
-rw-r--r--nikola/data/themes/base/messages/messages_bg.py8
-rw-r--r--nikola/data/themes/base/messages/messages_ca.py6
-rw-r--r--nikola/data/themes/base/messages/messages_cs.py29
l---------nikola/data/themes/base/messages/messages_cz.py1
-rw-r--r--nikola/data/themes/base/messages/messages_de.py6
-rw-r--r--nikola/data/themes/base/messages/messages_el.py8
-rw-r--r--nikola/data/themes/base/messages/messages_en.py8
-rw-r--r--nikola/data/themes/base/messages/messages_eo.py8
-rw-r--r--nikola/data/themes/base/messages/messages_es.py6
-rw-r--r--nikola/data/themes/base/messages/messages_et.py29
-rw-r--r--nikola/data/themes/base/messages/messages_eu.py29
-rw-r--r--nikola/data/themes/base/messages/messages_fa.py6
-rw-r--r--nikola/data/themes/base/messages/messages_fi.py6
-rw-r--r--nikola/data/themes/base/messages/messages_fr.py22
-rw-r--r--nikola/data/themes/base/messages/messages_hr.py10
-rw-r--r--nikola/data/themes/base/messages/messages_it.py6
-rw-r--r--nikola/data/themes/base/messages/messages_ja.py12
-rw-r--r--nikola/data/themes/base/messages/messages_nb.py29
-rw-r--r--nikola/data/themes/base/messages/messages_nl.py6
-rw-r--r--nikola/data/themes/base/messages/messages_pl.py10
-rw-r--r--nikola/data/themes/base/messages/messages_pt_br.py6
-rw-r--r--nikola/data/themes/base/messages/messages_ru.py6
-rw-r--r--nikola/data/themes/base/messages/messages_sl.py6
l---------nikola/data/themes/base/messages/messages_tr.py1
-rw-r--r--nikola/data/themes/base/messages/messages_tr_tr.py10
-rw-r--r--nikola/data/themes/base/messages/messages_ur.py29
-rw-r--r--nikola/data/themes/base/messages/messages_zh_cn.py10
-rw-r--r--nikola/data/themes/base/templates/base.tmpl2
-rw-r--r--nikola/data/themes/base/templates/base_helper.tmpl9
-rw-r--r--nikola/data/themes/base/templates/comments_helper.tmpl14
-rw-r--r--nikola/data/themes/base/templates/disqus_helper.tmpl22
-rw-r--r--nikola/data/themes/base/templates/gallery.tmpl8
-rw-r--r--nikola/data/themes/base/templates/index.tmpl6
-rwxr-xr-x[-rw-r--r--]nikola/data/themes/base/templates/index_helper.tmpl32
-rw-r--r--nikola/data/themes/base/templates/isso_helper.tmpl20
-rw-r--r--nikola/data/themes/base/templates/post.tmpl7
-rwxr-xr-x[-rw-r--r--]nikola/data/themes/base/templates/post_helper.tmpl51
-rw-r--r--nikola/data/themes/base/templates/tagindex.tmpl2
-rw-r--r--nikola/data/themes/bootstrap/assets/css/theme.css18
-rw-r--r--nikola/data/themes/bootstrap/templates/bootstrap_helper.tmpl5
-rw-r--r--nikola/data/themes/bootstrap/templates/gallery.tmpl8
-rw-r--r--nikola/filters.py26
-rw-r--r--nikola/nikola.py68
-rw-r--r--nikola/plugin_categories.py32
-rw-r--r--nikola/plugins/basic_import.py2
-rw-r--r--nikola/plugins/command/__init__.py2
-rw-r--r--nikola/plugins/command/auto.py49
-rw-r--r--nikola/plugins/command/bootswatch_theme.py2
-rw-r--r--nikola/plugins/command/check.py53
-rw-r--r--nikola/plugins/command/console.plugin2
-rw-r--r--nikola/plugins/command/console.py32
-rw-r--r--nikola/plugins/command/deploy.py15
-rw-r--r--nikola/plugins/command/import_blogger.py2
-rw-r--r--nikola/plugins/command/import_feed.py2
-rw-r--r--nikola/plugins/command/import_wordpress.py4
-rw-r--r--nikola/plugins/command/init.py2
-rw-r--r--nikola/plugins/command/install_plugin.py12
-rw-r--r--nikola/plugins/command/install_theme.py45
-rw-r--r--nikola/plugins/command/mincss.py2
-rw-r--r--nikola/plugins/command/new_post.py2
-rw-r--r--nikola/plugins/command/orphans.plugin10
-rw-r--r--nikola/plugins/command/orphans.py45
-rw-r--r--nikola/plugins/command/planetoid/__init__.py2
-rw-r--r--nikola/plugins/command/serve.py2
-rw-r--r--nikola/plugins/command/version.py4
-rw-r--r--nikola/plugins/compile/__init__.py25
-rw-r--r--nikola/plugins/compile/asciidoc.py13
-rw-r--r--nikola/plugins/compile/bbcode.py11
-rw-r--r--nikola/plugins/compile/html.py27
-rw-r--r--nikola/plugins/compile/ipynb/__init__.py23
-rw-r--r--nikola/plugins/compile/markdown/__init__.py14
-rw-r--r--nikola/plugins/compile/markdown/mdx_gist.py2
-rw-r--r--nikola/plugins/compile/markdown/mdx_nikola.py6
-rw-r--r--nikola/plugins/compile/markdown/mdx_podcast.py2
-rw-r--r--nikola/plugins/compile/misaka.py13
-rw-r--r--nikola/plugins/compile/pandoc.py12
-rw-r--r--nikola/plugins/compile/php.py12
-rw-r--r--nikola/plugins/compile/rest/__init__.py34
-rw-r--r--nikola/plugins/compile/rest/chart.py2
-rw-r--r--nikola/plugins/compile/rest/doc.py2
-rw-r--r--nikola/plugins/compile/rest/listing.py2
-rw-r--r--nikola/plugins/compile/rest/media.py2
-rw-r--r--nikola/plugins/compile/rest/post_list.py5
-rw-r--r--nikola/plugins/compile/rest/slides.py2
-rw-r--r--nikola/plugins/compile/rest/soundcloud.py9
-rw-r--r--nikola/plugins/compile/rest/template.txt8
-rw-r--r--nikola/plugins/compile/rest/vimeo.py2
-rw-r--r--nikola/plugins/compile/rest/youtube.py2
-rw-r--r--nikola/plugins/compile/textile.py13
-rw-r--r--nikola/plugins/compile/txt2tags.py15
-rw-r--r--nikola/plugins/compile/wiki.py13
-rw-r--r--nikola/plugins/loghandler/__init__.py25
-rw-r--r--nikola/plugins/loghandler/smtp.py2
-rw-r--r--nikola/plugins/loghandler/stderr.py6
-rw-r--r--nikola/plugins/task/__init__.py25
-rw-r--r--nikola/plugins/task/archive.py9
-rw-r--r--nikola/plugins/task/build_less.py13
-rw-r--r--nikola/plugins/task/build_sass.py15
-rw-r--r--nikola/plugins/task/bundles.py8
-rw-r--r--nikola/plugins/task/copy_assets.py2
-rw-r--r--nikola/plugins/task/copy_files.py2
-rw-r--r--nikola/plugins/task/galleries.py40
-rw-r--r--nikola/plugins/task/gzip.py2
-rw-r--r--nikola/plugins/task/indexes.py15
-rw-r--r--nikola/plugins/task/listings.py2
-rw-r--r--nikola/plugins/task/localsearch/__init__.py2
-rw-r--r--nikola/plugins/task/mustache/__init__.py8
-rw-r--r--nikola/plugins/task/pages.py2
-rw-r--r--nikola/plugins/task/posts.py2
-rw-r--r--nikola/plugins/task/redirect.py2
-rw-r--r--nikola/plugins/task/rss.py2
-rw-r--r--nikola/plugins/task/sitemap/__init__.py2
-rw-r--r--nikola/plugins/task/sources.py4
-rw-r--r--nikola/plugins/task/tags.py13
-rw-r--r--nikola/plugins/template/__init__.py25
-rw-r--r--nikola/plugins/template/jinja.py9
-rw-r--r--nikola/plugins/template/mako.py2
-rw-r--r--nikola/post.py99
-rw-r--r--nikola/rc4.py2
-rw-r--r--nikola/utils.py77
-rw-r--r--nikola/winutils.py2
-rw-r--r--requirements-full.txt2
-rw-r--r--requirements-tests.txt1
-rw-r--r--requirements.txt3
-rwxr-xr-xscripts/capty8
-rwxr-xr-xscripts/import_po.py17
-rwxr-xr-xscripts/nikola4
-rwxr-xr-xscripts/set_version.py2
-rw-r--r--setup.cfg2
-rwxr-xr-xsetup.py102
-rw-r--r--tests/README.rst38
-rw-r--r--tests/__init__.py25
-rw-r--r--tests/base.py18
-rw-r--r--tests/context.py9
-rw-r--r--tests/data/translated_titles/conf.py18
-rw-r--r--tests/data/translated_titles/stories/1.txt.pl (renamed from tests/data/translated_titles/stories/1.txt.es)0
-rw-r--r--tests/test_command_import_wordpress.py8
-rw-r--r--tests/test_command_init.py9
-rw-r--r--tests/test_compile_markdown.py29
-rw-r--r--tests/test_integration.py103
-rw-r--r--tests/test_locale.py6
-rw-r--r--tests/test_plugin_importing.py8
-rw-r--r--tests/test_rss_feeds.py19
-rw-r--r--tests/test_rst_compiler.py10
-rw-r--r--tests/test_scheduling.py19
-rw-r--r--tests/test_utils.py105
-rw-r--r--translations/nikola.messages/bg.po23
-rw-r--r--translations/nikola.messages/ca.po23
-rw-r--r--translations/nikola.messages/cs.po85
-rw-r--r--translations/nikola.messages/de.po23
-rw-r--r--translations/nikola.messages/el.po23
-rw-r--r--translations/nikola.messages/en.po25
-rw-r--r--translations/nikola.messages/eo.po21
-rw-r--r--translations/nikola.messages/es.po23
-rw-r--r--translations/nikola.messages/et.po87
-rw-r--r--translations/nikola.messages/eu.po86
-rw-r--r--translations/nikola.messages/fa.po21
-rw-r--r--translations/nikola.messages/fi.po23
-rw-r--r--translations/nikola.messages/fr.po38
-rw-r--r--translations/nikola.messages/hr.po27
-rw-r--r--translations/nikola.messages/it.po22
-rw-r--r--translations/nikola.messages/ja.po27
-rw-r--r--translations/nikola.messages/nb.po85
-rw-r--r--translations/nikola.messages/nl.po27
-rw-r--r--translations/nikola.messages/pl.po22
-rw-r--r--translations/nikola.messages/pt_BR.po23
-rw-r--r--translations/nikola.messages/ru.po21
-rw-r--r--translations/nikola.messages/sl.po25
-rw-r--r--translations/nikola.messages/tr_TR.po21
-rw-r--r--translations/nikola.messages/ur.po87
-rw-r--r--translations/nikola.messages/zh_CN.po26
199 files changed, 2872 insertions, 906 deletions
diff --git a/.gitignore b/.gitignore
index 968b271..ddcf4b3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,8 +12,11 @@ build/
__pycache__/
*.egg-info/
-# For virtualenvwrapper
+# virtualenvwrapper oh-my-zsh plugin
.venv
# coverage.py
.coverage
+
+# pyenv
+.python-version
diff --git a/.travis.yml b/.travis.yml
index 6ef3dc6..680496f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,21 +1,29 @@
before_install:
- - sudo apt-get update -qq || true
- - sudo apt-get --reinstall install -qq language-pack-en language-pack-es
+ - "if [[ $NMODE == 'nikola' ]]; then sudo apt-get update -qq || true; fi"
+ - "if [[ $NMODE == 'nikola' ]]; then sudo apt-get --reinstall install -qq language-pack-en-base language-pack-pl-base; fi"
language: python
+cache: apt
python:
- "2.6"
- "2.7"
- "3.3"
+matrix:
+ include:
+ - python: "2.7"
+ env: NMODE=flake8
+env:
+ NMODE=nikola
install:
- - "pip install -r requirements-tests.txt --use-mirrors"
- - "pip install . --use-mirrors"
+ - "if [[ $NMODE == 'nikola' ]]; then pip install -r requirements-tests.txt --use-mirrors; fi"
+ - "if [[ $NMODE == 'nikola' ]]; then pip install . --use-mirrors; fi"
+ - "if [[ $NMODE == 'flake8' ]]; then pip install flake8 --use-mirrors; fi"
# We run tests, nikola (to see if the command is executable) and flake8.
script:
- - nosetests --with-coverage --cover-package=nikola --with-doctest --doctest-options=+NORMALIZE_WHITESPACE --logging-filter=-yapsy
- - nikola help
- - "flake8 --ignore=E501 ."
+ - "if [[ $NMODE == 'nikola' ]]; then nosetests --with-coverage --cover-package=nikola --with-doctest --doctest-options=+NORMALIZE_WHITESPACE --logging-filter=-yapsy; fi"
+ - "if [[ $NMODE == 'nikola' ]]; then nikola help; fi"
+ - "if [[ $NMODE == 'flake8' ]]; then flake8 --ignore=E501 .; fi"
after_success:
- - coveralls
+ - "if [[ $NMODE == 'nikola' ]]; then coveralls; fi"
notifications:
irc:
channels:
diff --git a/AUTHORS.txt b/AUTHORS.txt
index d627544..59dc3db 100644
--- a/AUTHORS.txt
+++ b/AUTHORS.txt
@@ -51,6 +51,7 @@ mrabbitt <https://github.com/mrabbitt>
neilmb <https://github.com/neilmb>
notfoss <https://github.com/notfoss>
numshub <https://github.com/numshub>
+onnodb <https://github.com/onnodb>
pabluk <https://github.com/pabluk>
paskal <https://github.com/paskal>
punchagan <https://github.com/punchagan>
@@ -64,3 +65,4 @@ tolusonaike <https://github.com/tolusonaike>
wimpr1m <https://github.com/wimpr1m>
yarko <https://github.com/yarko>
neiesc <https://github.com/neiesc>
+ermeaney <https://github.com/ermeney>
diff --git a/CHANGES.txt b/CHANGES.txt
index c1fcb44..59318e3 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,3 +1,64 @@
+New in 6.3.0
+============
+
+Features
+--------
+
+* Added translations:
+
+ - Basque by aitorp
+ - Czech by Ondřej Grover
+ - Estonian by Lauri Võsandi
+ - Norwegian Bokmål by Daniel Aleksandersen
+
+* TIMEZONE now defaults to UTC (via Issue #893)
+* Added a DEMOTE_HEADERS option (on by default; previously implemented by
+ the Markdown and reST compilers) to have consenting compilers produce
+ documents with headers lower by one than the one defined (Issue #891)
+* isso comments are now supported (Issue #905)
+* Gallery titles are used in more places (Issue #902)
+* Gallery titles also are used in breadcrumbs (Issue #902)
+* ``tagindex.tmpl`` is used for tag indexes instead of ``index.tmpl`` (Issues #930, #933)
+* Added SASS_COMPILER option (defaults to sass) to add support for alternate compilers like sassc (Issue #940)
+* Added LESS_COMPILER option (defaults to lessc) to add support for alternate compilers like recess (via Issue #940)
+* sass/less files and targets file will be processed from site root (Issue #941)
+* Added a list of posts for each tag in tag_cloud_data.json
+* Added EXTRA_PLUGINS_DIRS option, for specifying additional plugin directories (Issue #953)
+* Expose original doit "auto" command as "doit_auto" (Issue #955)
+* New "type" metadata to make differences for posts (Issue #927)
+* New Post.is_post attribute to differentiate posts and pages without bias
+ (Post.use_in_feeds is False if the post is retired/unpublished/a draft)
+* Add rel=canonical <link> elements (Issue #449)
+* Add rel=alternate <link> elements to translations of the current page (Issues #988, #989)
+* Added a INDEXES_PAGES_MAIN setting to show the page number on the index page
+ if desired (True) (Issues #210, #987)
+* Added a TRANSLATIONS_PATTERN setting to specify the format for
+ language-dependent filenames (Issue #990)
+
+Bugfixes
+--------
+
+* Support livereload 2.0 (Issue #968)
+* Don't crash when docutils exception have no line number (Issue #920)
+* Forced permalinks in active menu items (Issue #916)
+* Remind the user to set THEME to use a downloaded theme
+* Fix crash when using USE_FILENAME_AS_TITLE = False (Issue #892)
+* Fixed deploy events if there is no TIMEZONE set (Issue #893 via #822)
+* Modified translation strings: "Posted", "Also available in", "More posts
+ about" — may break backwards compatibility (Issue #905)
+ Details: https://groups.google.com/forum/#!topic/nikola-discuss/ABXKk9G0_u0
+* Facebook comments are now showing properly
+* Added a warning/error when lessc/sass are missing (via Issue themes#24)
+* Fixed sass/less under Windows (Issue #939, themes#24)
+* Fix URL rewriting of fragment-only links (Issue #945)
+* Fixed the deploy rsync example (rsync --delete doesn't work with '/\*' as
+ source) (Issue #959)
+* Added a notice for the user if webassets is not installed and
+ USE_BUNDLES is True (Issue #965)
+* Support livereload 2.0 (Issue #968)
+* Remove some unnecessary elements (Issues #969, #970)
+* abs_link should return absolute URI
+
New in 6.2.1
============
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index f31f798..fa314cd 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -34,7 +34,7 @@ Here are some guidelines about how you can contribute to Nikola:
* You may want to use the `Tim Pope’s Git commit messages standard
<http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html>`_.
It’s not necessary, but if you are doing something big, we recommend
- describing it there.
+ describing it in the commit message.
* While working, **rebase instead of merging** (if possible). We encourage
using ``git rebase`` instead of ``git merge``. If you are using
``git pull``, please run ``git config pull.rebase true`` to prevent merges
@@ -44,7 +44,9 @@ Here are some guidelines about how you can contribute to Nikola:
* **Make sure documentation is updated** — at the very least, keep docstrings
current, and if necessary, update the reStructuredText documentation in ``docs/``.
* **Add a changelog entry** at the top of ``CHANGES.txt`` mentioning issue number
- and in the correct Features/Bugfixes section.
+ and in the correct Features/Bugfixes section. (while creating the new
+ changelog entry, put it in the version that does not exist (consult
+ setup.py) or create a new section)
* **Run flake8** for style consistency. Use ``flake8 --ignore=E501 .``
* **Try writing some tests** if possible — again, following existing tests is
often easiest, and a good way to tell whether the feature you are modifying is
diff --git a/LICENSE.txt b/LICENSE.txt
index 2f1eda4..a57a89a 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,4 +1,4 @@
-Copyright © 2012-2013 Roberto Alsina and others.
+Copyright © 2012-2014 Roberto Alsina and others.
Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
diff --git a/MANIFEST.in b/MANIFEST.in
index 40af1db..16d6a90 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -4,3 +4,4 @@ graft scripts
graft tests
include *.txt
include *.rst
+include *.py
diff --git a/README.rst b/README.rst
index afa5500..7803c46 100644
--- a/README.rst
+++ b/README.rst
@@ -57,12 +57,12 @@ Assuming you have pip installed::
cd nikola
pip install .
-Optionally (for markdown and lots of other features)::
-
- pip install -r requirements.txt
-
-For even more stuff, like tests and very optional features::
+For optional features::
pip install -r requirements-full.txt
+
+For tests (see tests/README.rst for more details)::
+
+ pip install -r requirements-tests.txt
For more information, see http://getnikola.com/
diff --git a/docs/creating-a-site.txt b/docs/creating-a-site.txt
index a200d54..097bfb5 100644
--- a/docs/creating-a-site.txt
+++ b/docs/creating-a-site.txt
@@ -38,7 +38,7 @@ configuration file:
BLOG_TITLE = "Not a Blog"
# This is the main URL for your site. It will be used
# in a prominent link
- SITE_URL = "http://notablog.ralsina.com.ar"
+ SITE_URL = "http://notablog.ralsina.com.ar/"
BLOG_EMAIL = "ralsina@kde.org"
BLOG_DESCRIPTION = "This is a demo site (not a blog) for Nikola."
@@ -168,6 +168,6 @@ or whatever.
in http://yoursite.com/blog (you may want to add links to it in NAVIGATION_LINKS of course).
You can see the finished site in http://notablog.ralsina.com.ar and its full configuration in
-http://ralsina.com.ar/listings/notablog/conf.py.html
+http://ralsina.me/listings/notablog/conf.py.html
I hope this was helpful!
diff --git a/docs/creating-a-theme.txt b/docs/creating-a-theme.txt
index 1e67410..35c2dbf 100644
--- a/docs/creating-a-theme.txt
+++ b/docs/creating-a-theme.txt
@@ -263,7 +263,7 @@ It turns out ``bootstrap`` doesn' have one of those! That's because it inherits
<%inherit file="base.tmpl"/>
<%block name="content">
% for post in posts:
- <div class="postbox">
+ <div class="postbox post-${post.meta('type')}">
<h1><a href="${post.permalink()}">${post.title()}</a>
<small>&nbsp;&nbsp;
${messages("Posted")}: <time class="published" datetime="${post.date.isoformat()}">${post.formatted_date(date_format)}</time>
@@ -291,7 +291,7 @@ box, add links for the posts tags, move the date there, etc.
<%inherit file="base.tmpl"/>
<%block name="content">
% for post in posts:
- <div class="postbox">
+ <div class="postbox post-${post.meta('type')}">
<h1><a href="${post.permalink()}">${post.title()}</a></h1>
<div class="meta" style="background-color: rgb(234, 234, 234); ">
<span class="authordate">
diff --git a/docs/extending.txt b/docs/extending.txt
index f5c7aae..25d1782 100644
--- a/docs/extending.txt
+++ b/docs/extending.txt
@@ -8,7 +8,7 @@
Extending Nikola
================
-:Version: 6.2.1
+:Version: 6.3.0
:Author: Roberto Alsina <ralsina@netmanagers.com.ar>
.. class:: alert alert-info pull-right
diff --git a/docs/getting-help.txt b/docs/getting-help.txt
new file mode 100644
index 0000000..9cad1b3
--- /dev/null
+++ b/docs/getting-help.txt
@@ -0,0 +1,75 @@
+.. title: Help, Bugs, Contact
+.. slug: contact
+.. date: 1970-01-01 15:00:00
+.. description: Get help using Nikola, or contact us.
+
+:Version: 6.3.0
+
+.. class:: alert alert-info pull-right
+
+.. contents::
+
+Help and Support
+================
+
+1. A `mailing list`_, nikola-discuss on Google Groups exists.
+2. There is an IRC channel, #nikola on Freenode. You can find many
+ developers and volunteers (users) there which are there to provide
+ help, if they are around and read your message.
+3. You can also contact `@GetNikola <http://twitter.com/GetNikola>`_ on
+ Twitter.
+4. If you are experiencing a bug, [1]_ you should report it on GitHub (see
+ below).
+
+Plugins and Themes
+------------------
+
+Plugins and Themes from the Indexes are not officially supported.
+
+1. Ask the `mailing list`_, which may or may not work out.
+2. You can also try the IRC channel if the theme/plugin is very popular.
+3. Report an issue at the `plugins issue tracker`_ or at the `themes
+ issue tracker`_.
+4. Contact the author of the plugin/theme. The name of the author of a
+ plugin is available in the ``.plugin`` and ``.py`` files. Tracking
+ down theme authors can be much harder due to how our architecture
+ works (but certainly is doable).
+
+Report a Bug, Request a Feature
+===============================
+
+Bug reports should be sent to the `Issue tracker`_ at GitHub.
+
+Feature requests should be sent to the or to the `Issue tracker`_ or to
+the `mailing list`_, especially if they require further discussion.
+
+Administrativia
+===============
+
+If you are in need of getting administrativia [2]_ resolved, you may want
+to e-mail info@getnikola.com and therefore contact the people behind the
+project. Note that this email **may not** be used for support matters.
+Messages are forwarded to all three administrators, the names and
+personal addresses (if you need to contact them personally) of you can
+find below.
+
+Administrators
+--------------
+
++----------------+-----------------+-----------+-----------------------+
+| Name | GitHub Nickname | Location | E-mail |
++================+=================+===========+=======================+
+| Roberto Alsina | ralsina | Argentina | roberto@getnikola.com |
++----------------+-----------------+-----------+-----------------------+
+| Damián Avila | damianavila | Argentina | damian@getnikola.com |
++----------------+-----------------+-----------+-----------------------+
+| Chris Warrick | Kwpolska | Poland | chris@getnikola.com |
++----------------+-----------------+-----------+-----------------------+
+
+.. [1] `As defined on Wikipedia. <http://en.wikipedia.org/wiki/Software_bug>`_
+.. [2] `administrative matters <http://en.wiktionary.org/wiki/administrativia>`_
+
+.. _mailing list: http://groups.google.com/group/nikola-discuss
+.. _Issue tracker: https://github.com/getnikola/nikola/issues
+.. _plugins issue tracker: https://github.com/getnikola/plugins/issues
+.. _themes issue tracker: https://github.com/getnikola/nikola-themes/issues
diff --git a/docs/internals.txt b/docs/internals.txt
index 14de433..75e2a97 100644
--- a/docs/internals.txt
+++ b/docs/internals.txt
@@ -59,7 +59,7 @@ targets
Files that the action generates. No two actions can have the same targets.
basename:name
- Each task is identified by either a name or a basename:name pair. Nikola
+ Each task is identified by either a name or a basename:name pair.
.. sidebar:: More about tasks
diff --git a/docs/man/nikola.1 b/docs/man/nikola.1
index 9385a2a..f794ccb 100644
--- a/docs/man/nikola.1
+++ b/docs/man/nikola.1
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.43.3.
-.TH NIKOLA "1" "November 2013" "nikola 6.2.1" "User Commands"
+.TH NIKOLA "1" "January 2014" "nikola 6.3.0" "User Commands"
.SH NAME
-nikola \- manual page for nikola 6.2.1
+nikola \- manual page for nikola 6.3.0
.SH DESCRIPTION
Nikola is a tool to create static websites and blogs. For full documentation and more information, please visit http://getnikola.com
.SS "Available commands:"
@@ -22,11 +22,14 @@ nikola clean
clean action / remove targets
.TP
nikola console
-Start an interactive Python (IPython\->bpython\->plain) console with access to your site and configuration
+start an interactive Python console with access to your site
.TP
nikola deploy
deploy the site
.TP
+nikola doit_auto
+automatically execute tasks when a dependency changes
+.TP
nikola dumpdb
dump dependency DB
.TP
@@ -66,6 +69,9 @@ apply mincss to the generated site
nikola new_post
create a new blog post or site page
.TP
+nikola orphans
+list all orphans
+.TP
nikola run
run tasks
.TP
@@ -75,6 +81,9 @@ start the test webserver
nikola strace
use strace to list file_deps and targets
.TP
+nikola tabcompletion
+generate script for tab\-complention
+.TP
nikola version
print the Nikola version number
.TP
diff --git a/docs/manual.txt b/docs/manual.txt
index c186260..d78b4f6 100644
--- a/docs/manual.txt
+++ b/docs/manual.txt
@@ -8,7 +8,7 @@
The Nikola Handbook
===================
-:Version: 6.2.1
+:Version: 6.3.0
.. class:: alert alert-info pull-right
@@ -89,11 +89,16 @@ out there.
Getting Help
------------
-* Feel free to contact me at ralsina@netmanagers.com.ar for questions about Nikola.
+.. class:: lead
+
+`Get help here! <http://getnikola.com/contact.html>`_
+
+TL;DR:
+
* You can file bugs at `the issue tracker <https://github.com/getnikola/nikola/issues>`__
* You can discuss Nikola at the `nikola-discuss google group <http://groups.google.com/group/nikola-discuss>`_
* You can subscribe to `the Nikola Blog <http://getnikola.com/blog>`_
-* You can follow `Nikola on Twitter <https://twitter.com/nikolagenerator>`_
+* You can follow `Nikola on Twitter <https://twitter.com/GetNikola>`_
Why Static?
-----------
@@ -198,6 +203,16 @@ of how to "get" something for your specific operating system are left to you.
The short version is: ``pip install nikola``
+If you are running Arch Linux, there are AUR packages, available in Python 2/3
+and stable/git master flavors: `python-nikola`__ / `python2-nikola`__ for the
+latest stable release or `python-nikola-git`__ / `python2-nikola-git`__ for the
+GitHub master. (only one package may be installed at the same time.)
+
+__ https://aur.archlinux.org/packages/python-nikola/
+__ https://aur.archlinux.org/packages/python2-nikola/
+__ https://aur.archlinux.org/packages/python-nikola-git/
+__ https://aur.archlinux.org/packages/python2-nikola-git/
+
Note that you need Python v2.6 or newer OR v3.3 or newer.
For some features it may give you an error message telling you that you need to
@@ -205,7 +220,10 @@ install something else. For example, if it tells you you need ``requests``::
pip install requests
-And so on.
+And so on. Alternatively, you can install the ``requirements-full.txt`` file
+shipped with the full source tree to get everything. (or `see the file
+online
+<https://github.com/getnikola/nikola/blob/master/requirements-full.txt>`_)
Longer version:
@@ -229,6 +247,9 @@ Longer version:
#. Get `yapsy <http://yapsy.sourceforge.net>`_
#. Get `PyRSS2Gen <http://www.dalkescientific.com/Python/PyRSS2Gen.html>`_
#. Get `pytz <http://pytz.sourceforge.net/>`_
+ #. Get `Logbook <http://pythonhosted.org/Logbook/>`_
+ #. Get `blinker <http://pythonhosted.org/blinker/>`_
+ #. Get `Setuptools <http://pythonhosted.org/setuptools/>`_
#. If using Python 2, get `configparser <http://pypi.python.org/pypi/configparser/3.2.0r3>`_
#. run ``python setup.py install``
@@ -238,7 +259,10 @@ After that, run ``nikola init --demo sitename`` and that will create a folder ca
Nikola is packaged for some Linux distributions, you may get that instead.
-*NOTE*: If you get a ``ERROR: /bin/sh: 1: xslt-config: not found`` or ``fatal error:
+libxml/libxslt errors
+~~~~~~~~~~~~~~~~~~~~~
+
+If you get a ``ERROR: /bin/sh: 1: xslt-config: not found`` or ``fatal error:
libxml/xmlversion.h: No such file or directory`` when running ``pip install -r requirements.txt``, install *libxml* and *libxslt* libraries, like so:
Debian systems::
@@ -246,9 +270,27 @@ Debian systems::
sudo apt-get install libxml2-dev
sudo apt-get install libxslt1-dev
-Red Hat/RPM based systems::
+Red Hat/RPM-based systems::
+
+ sudo yum install libxslt-devel libxml2-devel
+
+Python.h not found
+~~~~~~~~~~~~~~~~~~
- yum install libxslt-devel libxml2-devel
+If you get an error to the effect of ``Python.h not found``, you need to
+install development packages for Python.
+
+Debian systems::
+
+ sudo apt-get install python-dev
+
+Red Hat/RPM-based systems::
+
+ sudo yum install python-devel
+
+Note that many other distros/operating systems (including Arch Linux,
+\*BSD and OS X) do not require such packages, as C headers are included
+with the base distribution of Python.
Installation on Linux, Mac OS X, \*BSD, and any other POSIX-compatible OS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -274,7 +316,8 @@ their `PyPI <https://pypi.python.org/>`_ pages to find official packages, `the u
2. Windows has some differences over POSIX, which may cause some features to work incorrectly under Windows. If any problems occur, please do not hesitate to report them. Some of the differeces include:
* ``\`` as path separator (instead of ``/``)
- * the concept of partitions
+ * the concept of HDD partitions and letters (instead of
+ seamless mounting under one root)
* some characters in paths are disallowed (although this shouldn’t cause
problems)
* CR+LF (aka ``\r\n``) as the line separator (instead of LF ``\n``)
@@ -442,6 +485,7 @@ The content of that file is as follows::
.. tags:
.. link:
.. description:
+ .. type: text
Write your post here.
@@ -451,6 +495,9 @@ The third line is the post's date, and is set to "now".
The other lines are optional. Tags are comma-separated. The ``link`` is an original
source for the content, and ``description`` is mostly useful for SEO.
+``type`` is the post type, whatever you set here (prepended with ``post-``)
+will become a class of the `<article>` element for this post. Defaults to
+``text`` (resulting in a ``post-text`` class)
You can add your own metadata fields in the same manner, if you use a theme that
supports them (for example: ``.. author: John Doe``)
@@ -458,7 +505,7 @@ supports them (for example: ``.. author: John Doe``)
To add these metadata fields to all new posts by default, you can set the
variable ``ADDITIONAL_METADATA`` in your configuration. For example, you can
add the author metadata to all new posts by default, by adding the following
-to your configuration ::
+to your configuration::
ADDITIONAL_METADATA = {
'author': 'John Doe'
@@ -500,11 +547,11 @@ to your configuration ::
Set "True" if you do not want to see the **story** title as a
heading of the page (does not work for posts).
-
.. note:: The Two-File Format
Nikola originally used a separate ``.meta`` file. That will still work!
- The format of the meta files is the same as shown above, but without the
+ The format of the meta files is the same as shown above (i.e. only
+ the 7 base fields, in the order listed above), but without the
explanations::
How to make money
@@ -512,27 +559,64 @@ to your configuration ::
2012/09/15 19:52:05
If you are writing a multilingual site, you can also create a per-language
-post file (for example: ``how-to-make-money.txt.es``). This one can replace
-metadata of the default language, for example:
+post file (for example: ``how-to-make-money.txt.es`` with the default TRANSLATIONS_PATTERN, see below).
+This one can replace metadata of the default language, for example:
* The translated title for the post or page
* A translated version of the page name
+The pattern used for finding translations is controlled by the
+TRANSLATIONS_PATTERN variable in your configuration file.
+
+The default as in the example above is to append the language code to the
+filename path to identify a translation of a file, so the German translation
+of ``some_file.rst`` should be named ``some_file.rst.de``. This is because
+the TRANSLATIONS_PATTERN variable is by default set to::
+
+ TRANSLATIONS_PATTERN = "{path}.{ext}.{lang}"
+
+However, if you don't want your Polish input files to be considered
+Perl code (e.g. ``some_file.rst.pl``), you could use this pattern::
+
+ TRANSLATIONS_PATTERN = "{path}.{lang}.{ext}"
+
+Note that this pattern will become the default in v7.0.0.
+
+.. note:: Considered languages
+
+ nikola will only look for translation of input files for languages
+ specified in the TRANSLATIONS variable.
+
You can edit these files with your favourite text editor, and once you are happy
with the contents, generate the pages as explained in `Getting Started`_
Currently supported languages are
+* Basque
+* Bulgarian
* Catalan
+* Chinese (Simplified)
+* Croatian
+* Czech
+* Dutch
* English
+* Esperanto
+* Estonian
+* Finnish
* French
* German
* Greek
* Italian
+* Japanese
+* Norwegian Bokmål
+* Persian
* Polish
+* Portuguese
* Russian
-* Simplified Chinese.
+* Slovenian
* Spanish
+* Turkish
+* Urdu
If you wish to add support for more languages, check out the instructions
at the `theming guide <http://getnikola.com/theming.html>`_.
@@ -549,9 +633,11 @@ and ``PAGES`` configuration options::
# (whatever/thing.txt).
#
# That fragment could have an associated metadata file (whatever/thing.meta),
- # and optionally translated files (example for spanish, with code "es"):
+ # and optionally translated files (example for Spanish, with code "es"):
# whatever/thing.txt.es and whatever/thing.meta.es
#
+ # This assumes you use the default TRANSLATIONS_PATTERN.
+ #
# From those files, a set of HTML fragment files will be generated:
# cache/whatever/thing.html (and maybe cache/whatever/thing.html.es)
#
@@ -707,6 +793,21 @@ to the same as above), with no other post on Monday, at/after 7am,
setting ``SCHEDULE_FORCE_TODAY = True`` will have your post scheduled
to Monday, instead of being scheduled to Wednesday 7am.
+Post Types
+~~~~~~~~~~
+
+Nikola supports specifying post types, just like Tumblr does. Post
+types affect the look of your posts, by adding a ``post-YOURINPUTHERE``
+class to the post. Each post can have one and exactly one type. Nikola
+styles the following types in the default themes:
+
++-----------------+----------------------------+------------------+
+| Name(s) | Description | Styling |
++=================+============================+==================+
+| text | plain text — default value | standard |
++-----------------+----------------------------+------------------+
+| micro | “small” (short) posts | big serif font |
++-----------------+----------------------------+------------------+
Creating a Page
---------------
@@ -901,7 +1002,7 @@ One caveat is that if any command has a % in it, you should double them.
Here is an example, from my own site's deployment script::
DEPLOY_COMMANDS = [
- 'rsync -rav --delete output/* ralsina@lateral.netmanagers.com.ar:/srv/www/lateral',
+ 'rsync -rav --delete output/ ralsina@lateral.netmanagers.com.ar:/srv/www/lateral',
'rdiff-backup output ~/blog-backup',
"links -dump 'http://www.twingly.com/ping2?url=lateral.netmanagers.com.ar'",
]
@@ -924,7 +1025,8 @@ Nikola supports several third party comment systems:
* `LiveFyre <http://www.livefyre.com/>`_
* `Moot <http://moot.it>`_
* `Google+ <http://plus.google.com>`_
-* `Facebook <http://facebook.com>`_
+* `Facebook <http://facebook.com/>`_
+* `isso <http://posativ.org/isso/>`_
By default it will use DISQUS, but you can change by setting ``COMMENT_SYSTEM``
to one of "disqus", "intensedebate", "livefyre", "moot", "googleplus" or
@@ -944,6 +1046,8 @@ to one of "disqus", "intensedebate", "livefyre", "moot", "googleplus" or
* For Facebook, you need to `create an app
<https://developers.facebook.com/apps>` (turn off sandbox mode!)
and get an **App ID**
+ * For isso, it is the URL of isso (must be world-accessible and **have a trailing slash**,
+ default ``http://localhost:8080/``)
To use comments in a visible site, you should register with the service and
then set the ``COMMENT_SYSTEM_ID`` option.
@@ -1191,6 +1295,10 @@ The ID is 78131362 and you can embed the audio with this::
.. soundcloud:: 78131362
+You can also embed playlists, via the `soundcloud_playlist` directive which works the same way.
+
+ .. soundcloud_playlist:: 9411706
+
Code
~~~~
@@ -1486,7 +1594,8 @@ Custom Plugins
--------------
You can create your own plugins (see :doc:`extending`) and use them in your own
-site by putting them in a ``plugins/`` folder.
+site by putting them in a ``plugins/`` folder. You can also put them in
+directories listed in the ``EXTRA_PLUGINS_DIRS`` configuration variable.
Getting Extra Plugins
@@ -1495,7 +1604,7 @@ Getting Extra Plugins
If you want extra plugins, there is also the `Plugins Index <http://plugins.getnikola.com/>`_.
Similarly to themes, there is a nice, built-in command to install them —
-``install_plugin``:
+``install_plugin``::
$ nikola install_plugin -l
Plugins:
@@ -1524,6 +1633,10 @@ Similarly to themes, there is a nice, built-in command to install them —
You can also share plugins you created with the community! Visit the
`GitHub repository <https://github.com/getnikola/plugins>`__ to find out more.
+You can use the plugins in this repository without installing them into your
+site, by cloning the repository and adding the path of the plugins directory to
+the ``EXTRA_PLUGINS_DIRS`` list in your configuration.
+
License
-------
diff --git a/docs/social_buttons.txt b/docs/social_buttons.txt
index efbf9df..61260bc 100644
--- a/docs/social_buttons.txt
+++ b/docs/social_buttons.txt
@@ -8,7 +8,7 @@
Using Alternative Social Buttons with Nikola
============================================
-:Version: 6.2.1
+:Version: 6.3.0
.. class:: alert alert-info pull-right
diff --git a/docs/sphinx/conf.py b/docs/sphinx/conf.py
index 9e24c8f..26080aa 100644
--- a/docs/sphinx/conf.py
+++ b/docs/sphinx/conf.py
@@ -47,16 +47,16 @@ master_doc = 'index'
# General information about the project.
project = 'Nikola'
-copyright = '2013, The Nikola Contributors'
+copyright = '2012-2014, The Nikola Contributors'
# The version info for the project yo're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
-version = '6.2.0'
+version = '6.3.0'
# The full version, including alpha/beta/rc tags.
-release = '6.2.0'
+release = '6.3.0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/docs/sphinx/index.txt b/docs/sphinx/index.txt
index 6d899ab..9395e67 100644
--- a/docs/sphinx/index.txt
+++ b/docs/sphinx/index.txt
@@ -17,11 +17,3 @@ the Nikola website <http://getnikola.com/documentation.html>`_.
internals
tests
social_buttons
-
-Indices and tables
-==================
-
-* :ref:`genindex`
-* :ref:`modindex`
-* :ref:`search`
-
diff --git a/docs/theming.txt b/docs/theming.txt
index 99492ab..1886741 100644
--- a/docs/theming.txt
+++ b/docs/theming.txt
@@ -8,7 +8,7 @@
Theming Nikola
==============
-:Version: 6.2.1
+:Version: 6.3.0
:Author: Roberto Alsina <ralsina@netmanagers.com.ar>
.. class:: alert alert-info pull-right
@@ -172,6 +172,10 @@ These are the templates that come with the included themes:
Used to display the list of tags and categories. ``tag.tmpl`` is used to show the contents
of a single tag or category.
+``tagindex.tmpl``
+ Used to display tag indexes, if ``TAG_PAGES_ARE_INDEXES`` is True.
+ By default, it just inherits ``index.tmpl``.
+
You can add other templates for specific pages, which the user can then use in his ``POSTS``
or ``PAGES`` option in ``conf.py``. Also, keep in mind that your theme is yours,
there is no reason why you would need to maintain the inheritance as it is, or not
diff --git a/docs/upgrading-to-v6.txt b/docs/upgrading-to-v6.txt
index 386d6ab..adcad08 100644
--- a/docs/upgrading-to-v6.txt
+++ b/docs/upgrading-to-v6.txt
@@ -8,7 +8,7 @@
Upgrading to v6
===============
-:Version: 6.2.1
+:Version: 6.3.0
Nikola tries fairly hard to be compatible between versions. However, there were
a few areas which were getting clunky, and needed fxing. So, here's what you may
@@ -21,9 +21,6 @@ Themes
------
**NOTE**
- The install_theme command is not working yet, get themes from https://github.com/getnikola/nikola-themes
-
-**NOTE**
There is no equivalent for the jinja-default theme yet. If you have a custom,
jinja-based theme, upgrading is probably a bad idea right now.
@@ -50,11 +47,16 @@ break for you.
Facebook comments support changed the HTML tag to:
-.. code-block: html
+.. code-block:: mako
- <html% if comment_system == 'facebook': xmlns:fb="http://ogp.me/ns/fb#"
- %endif lang="${lang}">
+ <html
+ %if comment_system == 'facebook':
+ xmlns:fb="http://ogp.me/ns/fb#"
+ %endif
+ lang="${lang}">
+If you do not want to use Facebook comments, you can leave the old ``<html
+lang="${lang}">`` tag in and it will work just fine.
Comments
~~~~~~~~
@@ -72,10 +74,36 @@ If you don't, your theme should work just fine, but support only disqus comments
Configuration
-------------
-A number of options have been renamed. In all cases, the behaviour should be **exactly** as
-before. If it's not, let me know. Also, you will get warnings. That doesn't mean things
-broke. They are there to inform you of what's happening, and that you need to tweak
-your config.
+A number of options have been renamed. In most cases, the behaviour
+should be **exactly** as before.
+
+However, ``post_pages`` was split into ``POSTS`` and ``PAGES``. Long
+story short, anything that had a ``True`` as the ``use_in_feeds``
+(last) value goes to ``POSTS`` and anything with ``False`` goes to
+``PAGES``. For example:
+
+.. code-block:: python
+
+ post_pages = (
+ ("posts/*.txt", "", "post.tmpl", True),
+ ("stories/*.txt", "p", "story.tmpl", False),
+ ("stories/*.html", "s", "story.tmpl", False),
+ )
+
+ ### becomes ###
+
+ POSTS = (
+ ("posts/*.txt", "", "post.tmpl"),
+ )
+
+ PAGES = (
+ ("stories/*.txt", "p", "story.tmpl"),
+ ("stories/*.html", "s", "story.tmpl"),
+ )
+
+Also, you will get warnings. That doesn't mean things broke. They are
+there to inform you of what's happening, and that you need to tweak your
+config.
-All the deprecated options will work during the v6 cycle, and only be removed in v7, when
-those warnings will become errors.
+All the deprecated options will work during the v6 cycle, and only be
+removed in v7, when those warnings will become errors.
diff --git a/dodo.py b/dodo.py
new file mode 100644
index 0000000..7ad61d6
--- /dev/null
+++ b/dodo.py
@@ -0,0 +1,88 @@
+
+import os
+import fnmatch
+import locale
+import subprocess
+
+DOIT_CONFIG = {
+ 'default_tasks': ['flake8', 'test'],
+ 'reporter': 'executed-only',
+}
+
+
+def recursive_glob(path, pattern):
+ """recursively walk path directories and return files matching the pattern"""
+ for root, dirnames, filenames in os.walk(path):
+ for filename in fnmatch.filter(filenames, pattern):
+ yield os.path.join(root, filename)
+
+
+def task_flake8():
+ """flake8 - static check for python files"""
+ for fname in recursive_glob('.', '*.py'):
+ if fname.startswith('./cache'):
+ continue
+ yield {
+ 'name': fname,
+ 'actions': ['flake8 --ignore=E501 {0}'.format(fname)],
+ 'file_dep': [fname],
+ }
+
+
+def task_locale():
+ """set environ locale vars used in nikola tests"""
+ def set_nikola_test_locales():
+ try:
+ out = subprocess.check_output(['locale', '-a'])
+ locales = []
+ languages = set()
+ for line in out.splitlines():
+ if line.endswith('.utf8') and '_' in line:
+ lang = line.split('_')[0]
+ if lang not in languages:
+ try:
+ locale.setlocale(locale.LC_ALL, line)
+ except:
+ continue
+ languages.add(lang)
+ locales.append((lang, line))
+ if len(locales) == 2:
+ break
+ if len(locales) != 2:
+ return False # task failed
+ else:
+ os.environ['NIKOLA_LOCALE_DEFAULT'] = ','.join(locales[0])
+ os.environ['NIKOLA_LOCALE_OTHER'] = ','.join(locales[1])
+ finally:
+ # restore to default locale
+ locale.resetlocale()
+
+ return {'actions': [set_nikola_test_locales], 'verbosity': 2}
+
+
+def task_test():
+ """run unit-tests using nose"""
+ return {
+ 'task_dep': ['locale'],
+ 'actions': ['nosetests'],
+ }
+
+
+def task_coverage():
+ """run unit-tests using nose"""
+ return {
+ 'task_dep': ['locale'],
+ 'actions': ['nosetests --with-coverage --cover-package=nikola --with-doctest --doctest-options=+NORMALIZE_WHITESPACE --logging-filter=-yapsy'],
+ 'verbosity': 2,
+ }
+
+
+def task_gen_completion():
+ """generate tab-completion scripts"""
+ cmd = 'nikola tabcompletion --shell {0} --hardcode-tasks > _nikola_{0}'
+ for shell in ('bash', 'zsh'):
+ yield {
+ 'name': shell,
+ 'actions': [cmd.format(shell)],
+ 'targets': ['_nikola_{0}'.format(shell)],
+ }
diff --git a/nikola/__init__.py b/nikola/__init__.py
index a04e3b9..0a82198 100644
--- a/nikola/__init__.py
+++ b/nikola/__init__.py
@@ -1,8 +1,34 @@
# -*- coding: utf-8 -*-
+# Copyright © 2012-2014 Roberto Alsina and others.
+
+# Permission is hereby granted, free of charge, to any
+# person obtaining a copy of this software and associated
+# documentation files (the "Software"), to deal in the
+# Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the
+# Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice
+# shall be included in all copies or substantial portions of
+# the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+# PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
+# OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
from __future__ import absolute_import
+import os
+
+__version__ = "6.3.0"
+DEBUG = bool(os.getenv('NIKOLA_DEBUG'))
from .nikola import Nikola # NOQA
from . import plugins # NOQA
-
-__version__ = "6.2.1"
diff --git a/nikola/main.py b/nikola/__main__.py
index f00a4d2..6b549b4 100644
--- a/nikola/main.py
+++ b/nikola/__main__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -38,11 +38,12 @@ from doit.doit_cmd import DoitMain
from doit.cmd_help import Help as DoitHelp
from doit.cmd_run import Run as DoitRun
from doit.cmd_clean import Clean as DoitClean
+from doit.cmd_auto import Auto as DoitAuto
from logbook import NullHandler
from . import __version__
from .nikola import Nikola
-from .utils import _reload, sys_decode, LOGGER, STRICT_HANDLER
+from .utils import _reload, sys_decode, get_root_dir, LOGGER, STRICT_HANDLER
config = {}
@@ -58,6 +59,11 @@ def main(args):
nullhandler.push_application()
quiet = True
global config
+
+ root = get_root_dir()
+ if root:
+ os.chdir(root)
+
sys.path.append('')
try:
import conf
@@ -127,6 +133,10 @@ class Clean(DoitClean):
shutil.rmtree(cache_folder)
return super(Clean, self).clean_tasks(tasks, dryrun)
+# Nikola has its own "auto" commands that uses livereload.
+# Expose original doit "auto" command as "doit_auto".
+DoitAuto.name = 'doit_auto'
+
class NikolaTaskLoader(TaskLoader):
"""custom task loader to get tasks from Nikola instead of dodo.py file"""
@@ -156,7 +166,7 @@ class NikolaTaskLoader(TaskLoader):
class DoitNikola(DoitMain):
# overwite help command
- DOIT_CMDS = list(DoitMain.DOIT_CMDS) + [Help, Build, Clean]
+ DOIT_CMDS = list(DoitMain.DOIT_CMDS) + [Help, Build, Clean, DoitAuto]
TASK_LOADER = NikolaTaskLoader
def __init__(self, nikola, quiet=False):
@@ -181,7 +191,9 @@ class DoitNikola(DoitMain):
args = ['help']
# Hide run because Nikola uses build
sub_cmds.pop('run')
-
+ if len(args) == 0 or any(arg in ["--version", '-V'] for arg in args):
+ cmd_args = ['version']
+ args = ['version']
if len(args) == 0 or args[0] not in sub_cmds.keys() or \
args[0] == 'build':
# Check for conf.py before launching run
@@ -193,4 +205,7 @@ class DoitNikola(DoitMain):
@staticmethod
def print_version():
- print("Nikola version " + __version__)
+ print("Nikola v" + __version__)
+
+if __name__ == "__main__":
+ sys.exit(main(sys.argv[1:]))
diff --git a/nikola/conf.py.in b/nikola/conf.py.in
index 20605d8..6ae0e1d 100644
--- a/nikola/conf.py.in
+++ b/nikola/conf.py.in
@@ -25,28 +25,33 @@ BLOG_DESCRIPTION = "${BLOG_DESCRIPTION}"
# Currently supported languages are:
# bg Bulgarian
# ca Catalan
+# cs Czech [ALTERNATIVELY cz]
# de German
# el Greek [NOT gr!]
# en English
# eo Esperanto
# es Spanish
+# et Estonian
+# eu Basque
# fa Persian
# fi Finnish
# fr French
# hr Croatian
# it Italian
-# jp Japanese
+# ja Japanese [NOT jp!]
+# nb Norwegian Bokmål
# nl Dutch
# pt_br Portuguese (Brasil)
# pl Polish
# ru Russian
# sl Slovenian [NOT sl_si!]
-# tr_tr Turkish (Turkey)
+# tr Turkish (Turkey) [NOT tr_tr!]
+# ur Urdu
# zh_cn Chinese (Simplified)
#
# If you want to use Nikola with a non-supported language you have to provide
# a module containing the necessary translations
-# (p.e. look at the modules at: ./nikola/data/themes/default/messages/fr.py).
+# (cf. the modules at nikola/data/themes/base/messages/fr.py).
# If a specific post is not translated to a language, then the version
# in the default language will be shown instead.
@@ -62,6 +67,20 @@ TRANSLATIONS = {
# "es": "./es",
}
+# What will translated input files be named like?
+
+# If you have a page something.rst, then something.rst.pl will be considered
+# its Polish translation.
+# (in the above example: path == "something", lang == "pl", ext == "rst")
+# this pattern is also used for metadata:
+# something.meta -> something.meta.pl
+
+TRANSLATIONS_PATTERN = "{path}.{ext}.{lang}"
+
+# If you don't want your Polish files to be considered Perl code, use this:
+# TRANSLATIONS_PATTERN = "{path}.{lang}.{ext}"
+# Note that this pattern will become the default in v7.0.0.
+
# Links for the sidebar / navigation bar.
# You should provide a key-value pair for each used language.
NAVIGATION_LINKS = {
@@ -96,6 +115,8 @@ NAVIGATION_LINKS = {
# and optionally translated files (example for spanish, with code "es"):
# whatever/thing.txt.es and whatever/thing.meta.es
#
+# This assumes you use the default TRANSLATIONS_PATTERN.
+#
# From those files, a set of HTML fragment files will be generated:
# cache/whatever/thing.html (and maybe cache/whatever/thing.html.es)
#
@@ -165,6 +186,12 @@ COMPILERS = ${COMPILERS}
# ARCHIVE_PATH = ""
# ARCHIVE_FILENAME = "archive.html"
+# URLs to other posts/pages can take 3 forms:
+# rel_path: a relative URL to the current page/post (default)
+# full_path: a URL with the full path from the root
+# absolute: a complete URL (that includes the SITE_URL)
+# URL_TYPE = 'rel_path'
+
# Final locations are:
# output / TRANSLATION[lang] / RSS_PATH / rss.xml
# RSS_PATH = ""
@@ -187,7 +214,7 @@ COMPILERS = ${COMPILERS}
# Commands to execute to deploy. Can be anything, for example,
# you may use rsync:
-# "rsync -rav output/* joe@my.site:/srv/www/site"
+# "rsync -rav --delete output/ joe@my.site:/srv/www/site"
# And then do a backup, or run `nikola ping` from the `ping`
# plugin (`nikola install_plugin ping`).
# To do manual deployment, set it to []
@@ -235,11 +262,17 @@ COMPILERS = ${COMPILERS}
# Use an external gzip command? None means no.
# Example: GZIP_COMMAND = "pigz -k {filename}"
# GZIP_COMMAND = None
-# Make sure the server does not return a "Accept-Ranges: bytes" header for
+# Make sure the server does not return a "Accept-Ranges: bytes" header for
# files compressed by this option! OR make sure that a ranged request does not
# return partial content of another representation for these resources. Do not
# use this feature if you do not understand what this means.
+# Compiler to process LESS files.
+# LESS_COMPILER = 'lessc'
+
+# Compiler to process Sass files.
+# SASS_COMPILER = 'sass'
+
# #############################################################################
# Image Gallery Options
# #############################################################################
@@ -259,10 +292,13 @@ COMPILERS = ${COMPILERS}
# HTML fragments and diverse things that are used by the templates
# #############################################################################
-# Data about post-per-page indexes
-# INDEXES_TITLE = "" # If this is empty, the default is BLOG_TITLE
-# INDEXES_PAGES = "" # If this is empty, the default is 'old posts page %d'
-# translated
+# Data about post-per-page indexes.
+# INDEXES_PAGES defaults to 'old posts, page %d' or 'page %d' (translated),
+# depending on the value of INDEXES_PAGES_MAIN.
+# INDEXES_TITLE = "" # If this is empty, defaults to BLOG_TITLE
+# INDEXES_PAGES = "" # If this is empty, defaults to '[old posts,] page %d' (see above)
+# INDEXES_PAGES_MAIN = False # If True, INDEXES_PAGES is also displayed on
+ # the main (the newest) index page (index.html)
# Name of the theme to use.
THEME = "${THEME}"
@@ -330,7 +366,7 @@ CONTENT_FOOTER = CONTENT_FOOTER.format(email=BLOG_EMAIL,
# To use comments, you can choose between different third party comment
# systems, one of "disqus", "livefyre", "intensedebate", "moot",
-# "googleplus" or "facebook"
+# "googleplus", "facebook" or "isso"
# COMMENT_SYSTEM = "disqus"
# And you also need to add your COMMENT_SYSTEM_ID which
# depends on what comment system you use. The default is
@@ -583,14 +619,15 @@ CONTENT_FOOTER = CONTENT_FOOTER.format(email=BLOG_EMAIL,
# }
-# Post's dates are considered in GMT by default, if you want to use
-# another timezone, please set TIMEZONE to match. Check the available
+# Post's dates are considered in UTC by default, if you want to use
+# another time zone, please set TIMEZONE to match. Check the available
# list from Wikipedia:
# http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
-# Also, if you want to use a different timezone in some of your posts,
+# (eg. 'Europe/Zurich')
+# Also, if you want to use a different time zone in some of your posts,
# you can use W3C-DTF Format (ex. 2012-03-30T23:00:00+02:00)
#
-# TIMEZONE = 'Europe/Zurich'
+# TIMEZONE = 'UTC'
# If webassets is installed, bundle JS and CSS to make site loading faster
# USE_BUNDLES = True
@@ -598,6 +635,11 @@ CONTENT_FOOTER = CONTENT_FOOTER.format(email=BLOG_EMAIL,
# Plugins you don't want to use. Be careful :-)
# DISABLED_PLUGINS = ["render_galleries"]
+# Add the absolute paths to directories containing plugins to use them.
+# For example, the `plugins` directory of your clone of the Nikola plugins
+# repository.
+# EXTRA_PLUGINS_DIRS = []
+
# Experimental plugins - use at your own risk.
# They probably need some manual adjustments - please see their respective
# readme.
@@ -615,6 +657,14 @@ CONTENT_FOOTER = CONTENT_FOOTER.format(email=BLOG_EMAIL,
# If set to True, enable optional hyphenation in your posts (requires pyphen)
# HYPHENATE = False
+# The <hN> tags in HTML generated by certain compilers (reST/Markdown)
+# will be demoted by that much (1 → h1 will become h2 and so on)
+# This was a hidden feature of the Markdown and reST compilers in the
+# past. Useful especially if your post titles are in <h1> tags too, for
+# example.
+# (defaults to 1.)
+# DEMOTE_HEADERS = 1
+
# You can configure the logging handlers installed as plugins or change the
# log level of the default stdout handler.
LOGGING_HANDLERS = {
diff --git a/nikola/data/samplesite/files/assets/css/custom.css b/nikola/data/samplesite/files/assets/css/custom.css
deleted file mode 100644
index e69de29..0000000
--- a/nikola/data/samplesite/files/assets/css/custom.css
+++ /dev/null
diff --git a/nikola/data/samplesite/galleries/demo/index.txt b/nikola/data/samplesite/galleries/demo/index.txt
index d3d5a44..e29f66e 100644
--- a/nikola/data/samplesite/galleries/demo/index.txt
+++ b/nikola/data/samplesite/galleries/demo/index.txt
@@ -1,2 +1,4 @@
+.. title: Nikola Tesla
+
Some public domain pictures of Nikola Tesla
-(copied from `here <http://kerryr.net/pioneers/gallery/tesla.htm>`_) \ No newline at end of file
+(copied from `here <http://kerryr.net/pioneers/gallery/tesla.htm>`_)
diff --git a/nikola/data/themes/base/assets/css/theme.css b/nikola/data/themes/base/assets/css/theme.css
index e69de29..2a924f1 100644
--- a/nikola/data/themes/base/assets/css/theme.css
+++ b/nikola/data/themes/base/assets/css/theme.css
@@ -0,0 +1 @@
+/* This file intentionally left blank. */
diff --git a/nikola/data/themes/base/assets/js/mathjax.js b/nikola/data/themes/base/assets/js/mathjax.js
index 2f4e773..82c1f6c 100644
--- a/nikola/data/themes/base/assets/js/mathjax.js
+++ b/nikola/data/themes/base/assets/js/mathjax.js
@@ -6,7 +6,12 @@ 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";
+ if (location.protocol == 'https:') {
+ scriptbase = "https://c328740.ssl.cf1.rackcdn.com/";
+ } else {
+ scriptbase = "http://cdn.mathjax.org/";
+ }
+ script.src = scriptbase + "mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
document.getElementsByTagName("body")[0].appendChild(script);
},1)
-} \ No newline at end of file
+}
diff --git a/nikola/data/themes/base/messages/messages_bg.py b/nikola/data/themes/base/messages/messages_bg.py
index 2d36959..d4881b5 100644
--- a/nikola/data/themes/base/messages/messages_bg.py
+++ b/nikola/data/themes/base/messages/messages_bg.py
@@ -3,15 +3,18 @@ from __future__ import unicode_literals
MESSAGES = {
"Also available in": "Също достъпно в",
+ "Also available in:": "Също достъпно в:",
"Archive": "Архив",
"Categories": "Категории",
"LANGUAGE": "Български",
- "More posts about": "Още публикации относно ",
+ "More posts about %s": "Още публикации относно %s",
+ "More posts about": "Още публикации относно",
"Newer posts": "Нови публикации",
"Next post": "Следваща публикация",
"Older posts": "Стари публикации",
"Original site": "Оригиналния сайт",
"Posted": "Публиковано",
+ "Posted:": "Публиковано:",
"Posts about %s": "Публикации относно %s",
"Posts for year %s": "Публикации за %s година",
"Posts for {month} {year}": "Публикации за {month} {year}",
@@ -21,5 +24,6 @@ MESSAGES = {
"Source": "Source",
"Tags and Categories": "Тагове и Категории",
"Tags": "Тагове",
- "old posts page %d": "стари публикации страница %d",
+ "old posts, page %d": "стари публикации, страница %d",
+ "page %d": "страница %d",
}
diff --git a/nikola/data/themes/base/messages/messages_ca.py b/nikola/data/themes/base/messages/messages_ca.py
index 80c4ee4..d3a97b5 100644
--- a/nikola/data/themes/base/messages/messages_ca.py
+++ b/nikola/data/themes/base/messages/messages_ca.py
@@ -3,15 +3,18 @@ from __future__ import unicode_literals
MESSAGES = {
"Also available in": "També disponibles en",
+ "Also available in:": "També disponibles en:",
"Archive": "Arxiu",
"Categories": "",
"LANGUAGE": "Català",
+ "More posts about %s": "Més entrades sobre %s",
"More posts about": "Més entrades sobre",
"Newer posts": "Entrades posteriors",
"Next post": "Entrada següent",
"Older posts": "Entrades anteriors",
"Original site": "Lloc original",
"Posted": "Publicat",
+ "Posted:": "Publicat:",
"Posts about %s": "Entrades sobre %s",
"Posts for year %s": "Entrades de l'any %s",
"Posts for {month} {year}": "",
@@ -21,5 +24,6 @@ MESSAGES = {
"Source": "Codi",
"Tags and Categories": "",
"Tags": "Etiquetes",
- "old posts page %d": "entrades antigues pàgina %d",
+ "old posts, page %d": "entrades antigues, pàgina %d",
+ "page %d": "pàgina %d",
}
diff --git a/nikola/data/themes/base/messages/messages_cs.py b/nikola/data/themes/base/messages/messages_cs.py
new file mode 100644
index 0000000..33482b5
--- /dev/null
+++ b/nikola/data/themes/base/messages/messages_cs.py
@@ -0,0 +1,29 @@
+# -*- encoding:utf-8 -*-
+from __future__ import unicode_literals
+
+MESSAGES = {
+ "Also available in": "Dostupné také v",
+ "Also available in:": "Dostupné také v",
+ "Archive": "Archiv",
+ "Categories": "Kategorie",
+ "LANGUAGE": "Čeština",
+ "More posts about %s": "Další příspěvky o %s",
+ "More posts about": "Další příspěvky o",
+ "Newer posts": "Novější příspěvky",
+ "Next post": "Další příspěvek",
+ "Older posts": "Starší příspěvky",
+ "Original site": "Původní stránka",
+ "Posted": "Zveřejněno",
+ "Posted:": "Zveřejněno:",
+ "Posts about %s": "Příspěvky o %s",
+ "Posts for year %s": "Příspěvky v roce %s",
+ "Posts for {month} {year}": "Příspěvky v {month} {year}",
+ "Previous post": "Předchozí příspěvek",
+ "Read in English": "Číst v češtině",
+ "Read more": "Číst dál",
+ "Source": "Zdroj",
+ "Tags and Categories": "Štítky a kategorie",
+ "Tags": "Štítky",
+ "old posts, page %d": "staré příspěvky, strana %d",
+ "page %d": "strana %d",
+}
diff --git a/nikola/data/themes/base/messages/messages_cz.py b/nikola/data/themes/base/messages/messages_cz.py
new file mode 120000
index 0000000..d784fd5
--- /dev/null
+++ b/nikola/data/themes/base/messages/messages_cz.py
@@ -0,0 +1 @@
+messages_cs.py \ No newline at end of file
diff --git a/nikola/data/themes/base/messages/messages_de.py b/nikola/data/themes/base/messages/messages_de.py
index c885304..6795031 100644
--- a/nikola/data/themes/base/messages/messages_de.py
+++ b/nikola/data/themes/base/messages/messages_de.py
@@ -3,15 +3,18 @@ from __future__ import unicode_literals
MESSAGES = {
"Also available in": "Auch verfügbar in",
+ "Also available in:": "Auch verfügbar in:",
"Archive": "Archiv",
"Categories": "Kategorien",
"LANGUAGE": "Deutsch",
+ "More posts about %s": "Weitere Einträge über %s",
"More posts about": "Weitere Einträge über",
"Newer posts": "Neuere Einträge",
"Next post": "Nächster Eintrag",
"Older posts": "Ältere Einträge",
"Original site": "Original-Seite",
"Posted": "Veröffentlicht",
+ "Posted:": "Veröffentlicht:",
"Posts about %s": "Einträge über %s",
"Posts for year %s": "Einträge aus dem Jahr %s",
"Posts for {month} {year}": "Einträge aus {month} {year}",
@@ -21,5 +24,6 @@ MESSAGES = {
"Source": "Source",
"Tags and Categories": "Tags und Kategorien",
"Tags": "Tags",
- "old posts page %d": "Vorherige Einträge %d",
+ "old posts, page %d": "Vorherige Einträge, Seite %d",
+ "page %d": "Seite %d",
}
diff --git a/nikola/data/themes/base/messages/messages_el.py b/nikola/data/themes/base/messages/messages_el.py
index a1745fa..710558b 100644
--- a/nikola/data/themes/base/messages/messages_el.py
+++ b/nikola/data/themes/base/messages/messages_el.py
@@ -3,15 +3,18 @@ from __future__ import unicode_literals
MESSAGES = {
"Also available in": "Διαθέσιμο και στα",
+ "Also available in:": "Διαθέσιμο και στα:",
"Archive": "Αρχείο",
"Categories": "Κατηγορίες",
"LANGUAGE": "Ελληνικά",
+ "More posts about %s": "Περισσότερες αναρτήσεις για %s",
"More posts about": "Περισσότερες αναρτήσεις για",
"Newer posts": "Νεότερες αναρτήσεις",
"Next post": "Επόμενη ανάρτηση",
"Older posts": "Παλαιότερες αναρτήσεις",
"Original site": "Ιστοσελίδα αρχικής ανάρτησης",
"Posted": "Αναρτήθηκε",
+ "Posted:": "Αναρτήθηκε:",
"Posts about %s": "Αναρτήσεις για %s",
"Posts for year %s": "Αναρτήσεις για το έτος %s",
"Posts for {month} {year}": "Αναρτήσεις για τον {month} του {year}",
@@ -19,7 +22,8 @@ MESSAGES = {
"Read in English": "Διαβάστε στα Ελληνικά",
"Read more": "Διαβάστε περισσότερα",
"Source": "Πηγαίος κώδικας",
- "Tags and Categories": "",
+ "Tags and Categories": "Ετικέτες και κατηγορίες",
"Tags": "Ετικέτες",
- "old posts page %d": "σελίδα παλαιότερων αναρτήσεων %d",
+ "old posts, page %d": "σελίδα παλαιότερων αναρτήσεων %d",
+ "page %d": "σελίδα %d",
}
diff --git a/nikola/data/themes/base/messages/messages_en.py b/nikola/data/themes/base/messages/messages_en.py
index 1e695ac..021f5e7 100644
--- a/nikola/data/themes/base/messages/messages_en.py
+++ b/nikola/data/themes/base/messages/messages_en.py
@@ -3,17 +3,18 @@ from __future__ import unicode_literals
MESSAGES = {
"Also available in": "Also available in",
+ "Also available in:": "Also available in:",
"Archive": "Archive",
"Categories": "Categories",
"LANGUAGE": "English",
+ "More posts about %s": "More posts about %s",
"More posts about": "More posts about",
"Newer posts": "Newer posts",
"Next post": "Next post",
- "No content": "",
- "No title": "",
"Older posts": "Older posts",
"Original site": "Original site",
"Posted": "Posted",
+ "Posted:": "Posted:",
"Posts about %s": "Posts about %s",
"Posts for year %s": "Posts for year %s",
"Posts for {month} {year}": "Posts for {month} {year}",
@@ -23,5 +24,6 @@ MESSAGES = {
"Source": "Source",
"Tags and Categories": "Tags and Categories",
"Tags": "Tags",
- "old posts page %d": "old posts page %d",
+ "old posts, page %d": "old posts, page %d",
+ "page %d": "page %d",
}
diff --git a/nikola/data/themes/base/messages/messages_eo.py b/nikola/data/themes/base/messages/messages_eo.py
index 50bd25a..fdbea88 100644
--- a/nikola/data/themes/base/messages/messages_eo.py
+++ b/nikola/data/themes/base/messages/messages_eo.py
@@ -3,15 +3,18 @@ from __future__ import unicode_literals
MESSAGES = {
"Also available in": "Ankaŭ disponebla en",
+ "Also available in:": "Ankaŭ disponebla en:",
"Archive": "Arĥivo",
"Categories": "Kategorioj",
"LANGUAGE": "Anglalingve",
- "More posts about": "Pli artikoloj pri...",
+ "More posts about %s": "Pli artikoloj pri %s",
+ "More posts about": "Pli artikoloj pri",
"Newer posts": "Pli novaj artikoloj",
"Next post": "Venonta artikolo",
"Older posts": "Pli malnovaj artikoloj",
"Original site": "Originala interretejo",
"Posted": "Skribita",
+ "Posted:": "Skribita:",
"Posts about %s": "Artikoloj pri %s",
"Posts for year %s": "Artikoloj de la jaro %s",
"Posts for {month} {year}": "Artikoloj skribitaj en {month} {year}",
@@ -21,5 +24,6 @@ MESSAGES = {
"Source": "Fonto",
"Tags and Categories": "Etikedoj kaj Kategorioj",
"Tags": "Etikedoj",
- "old posts page %d": "paĝo de malnovaj artikoloj %d",
+ "old posts, page %d": "paĝo de malnovaj artikoloj %d",
+ "page %d": "paĝo %d",
}
diff --git a/nikola/data/themes/base/messages/messages_es.py b/nikola/data/themes/base/messages/messages_es.py
index 79ffac6..6c48fb9 100644
--- a/nikola/data/themes/base/messages/messages_es.py
+++ b/nikola/data/themes/base/messages/messages_es.py
@@ -3,15 +3,18 @@ from __future__ import unicode_literals
MESSAGES = {
"Also available in": "También disponible en",
+ "Also available in:": "También disponible en:",
"Archive": "Archivo",
"Categories": "Categorías",
"LANGUAGE": "Español",
+ "More posts about %s": "Más posts sobre %s",
"More posts about": "Más posts sobre",
"Newer posts": "Posts posteriores",
"Next post": "Siguiente post",
"Older posts": "Posts anteriores",
"Original site": "Sitio original",
"Posted": "Publicado",
+ "Posted:": "Publicado:",
"Posts about %s": "Posts sobre %s",
"Posts for year %s": "Posts del año %s",
"Posts for {month} {year}": "Posts de {month} {year}",
@@ -21,5 +24,6 @@ MESSAGES = {
"Source": "Código",
"Tags and Categories": "Tags y Categorías",
"Tags": "Tags",
- "old posts page %d": "posts antiguos página %d",
+ "old posts, page %d": "posts antiguos, página %d",
+ "page %d": "página %d",
}
diff --git a/nikola/data/themes/base/messages/messages_et.py b/nikola/data/themes/base/messages/messages_et.py
new file mode 100644
index 0000000..314f3b8
--- /dev/null
+++ b/nikola/data/themes/base/messages/messages_et.py
@@ -0,0 +1,29 @@
+# -*- encoding:utf-8 -*-
+from __future__ import unicode_literals
+
+MESSAGES = {
+ "Also available in": "Saadaval ka",
+ "Also available in:": "Saadaval ka:",
+ "Archive": "Arhiiv",
+ "Categories": "Kategooriad",
+ "LANGUAGE": "Eesti",
+ "More posts about %s": "Veel postitusi %s kohta",
+ "More posts about": "Veel postitusi kohta",
+ "Newer posts": "Uued postitused",
+ "Next post": "Järgmine postitus",
+ "Older posts": "Vanemad postitused",
+ "Original site": "Algallikas",
+ "Posted": "Postitatud",
+ "Posted:": "Postitatud:",
+ "Posts about %s": "Postitused %s kohta",
+ "Posts for year %s": "Postitused aastast %s",
+ "Posts for {month} {year}": "Postitused {year} aasta kuust {month} ",
+ "Previous post": "Eelmine postitus",
+ "Read in English": "Loe eesti keeles",
+ "Read more": "Loe veel",
+ "Source": "Lähtekood",
+ "Tags and Categories": "Sildid ja kategooriad",
+ "Tags": "Märksõnad",
+ "old posts, page %d": "vanade postituste, leht %d",
+ "page %d": "leht %d",
+}
diff --git a/nikola/data/themes/base/messages/messages_eu.py b/nikola/data/themes/base/messages/messages_eu.py
new file mode 100644
index 0000000..18d7575
--- /dev/null
+++ b/nikola/data/themes/base/messages/messages_eu.py
@@ -0,0 +1,29 @@
+# -*- encoding:utf-8 -*-
+from __future__ import unicode_literals
+
+MESSAGES = {
+ "Also available in": "Eskuragarria hemen ere",
+ "Also available in:": "Eskuragarria hemen ere:",
+ "Archive": "Artxiboa",
+ "Categories": "Kategoriak",
+ "LANGUAGE": "Euskara",
+ "More posts about %s": "%s-ri buruzko post gehiago",
+ "More posts about": "-ri buruzko post gehiago",
+ "Newer posts": "Post berrienak",
+ "Next post": "Hurrengo posta",
+ "Older posts": "Post zaharrenak",
+ "Original site": "Jatorrizko orria",
+ "Posted": "Argitaratuta",
+ "Posted:": "Argitaratuta:",
+ "Posts about %s": "%s-ri buruzko postak",
+ "Posts for year %s": "%s. urteko postak",
+ "Posts for {month} {year}": "{year}ko {month}ren postak",
+ "Previous post": "Aurreko posta",
+ "Read in English": "Euskaraz irakurri",
+ "Read more": "Irakurri gehiago",
+ "Source": "Iturria",
+ "Tags and Categories": "Etiketak eta Kategoriak",
+ "Tags": "Etiketak",
+ "old posts, page %d": "Post zaharren, orria %d",
+ "page %d": "orria %d",
+}
diff --git a/nikola/data/themes/base/messages/messages_fa.py b/nikola/data/themes/base/messages/messages_fa.py
index 786893c..bd278ca 100644
--- a/nikola/data/themes/base/messages/messages_fa.py
+++ b/nikola/data/themes/base/messages/messages_fa.py
@@ -3,15 +3,18 @@ from __future__ import unicode_literals
MESSAGES = {
"Also available in": "همچنین قابل دسترس از",
+ "Also available in:": "همچنین قابل دسترس از:",
"Archive": "آرشیو",
"Categories": "دسته‌ها",
"LANGUAGE": "فارسی",
+ "More posts about %s": "ارسال‌های بیشتر دربارهٔ%s",
"More posts about": "ارسال‌های بیشتر دربارهٔ",
"Newer posts": "ارسال‌های جدید‌تر",
"Next post": "ارسال بعدی",
"Older posts": "پست‌های قدیمی‌تر",
"Original site": "سایت اصلی",
"Posted": "ارسال شده",
+ "Posted:": "ارسال شده:",
"Posts about %s": "ارسال‌ها دربارهٔ %s",
"Posts for year %s": "ارسال‌ها برای سال %s",
"Posts for {month} {year}": "ارسال برای {month} {year}",
@@ -21,5 +24,6 @@ MESSAGES = {
"Source": "منبع",
"Tags and Categories": "برچسب‌ها و دسته‌ها",
"Tags": "برچسب‌ها",
- "old posts page %d": "صفحهٔ ارسال‌های قدیمی %d",
+ "old posts, page %d": "صفحهٔ ارسال‌های قدیمی %d",
+ "page %d": "",
}
diff --git a/nikola/data/themes/base/messages/messages_fi.py b/nikola/data/themes/base/messages/messages_fi.py
index ca64919..b24ee2c 100644
--- a/nikola/data/themes/base/messages/messages_fi.py
+++ b/nikola/data/themes/base/messages/messages_fi.py
@@ -3,15 +3,18 @@ from __future__ import unicode_literals
MESSAGES = {
"Also available in": "Saatavilla myös",
+ "Also available in:": "Saatavilla myös:",
"Archive": "Arkisto",
"Categories": "Kategoriat",
"LANGUAGE": "Suomi",
+ "More posts about %s": "Lisää postauksia aiheesta %s",
"More posts about": "Lisää postauksia aiheesta",
"Newer posts": "Uudempia postauksia",
"Next post": "Seuraava postaus",
"Older posts": "Vanhempia postauksia",
"Original site": "Alkuperäinen sivusto",
"Posted": "Postattu",
+ "Posted:": "Postattu:",
"Posts about %s": "Postauksia aiheesta %s",
"Posts for year %s": "Postauksia vuodelta %s",
"Posts for {month} {year}": "Postauksia ajalle {month} {year}",
@@ -21,5 +24,6 @@ MESSAGES = {
"Source": "Lähde",
"Tags and Categories": "Tagit ja kategoriat",
"Tags": "Tagit",
- "old posts page %d": "vanhojen postauksien sivu %d",
+ "old posts, page %d": "vanhojen postauksien, sivu %d",
+ "page %d": "sivu %d",
}
diff --git a/nikola/data/themes/base/messages/messages_fr.py b/nikola/data/themes/base/messages/messages_fr.py
index 45c7474..ad4aea0 100644
--- a/nikola/data/themes/base/messages/messages_fr.py
+++ b/nikola/data/themes/base/messages/messages_fr.py
@@ -2,24 +2,28 @@
from __future__ import unicode_literals
MESSAGES = {
- "Also available in": "Disponible aussi en",
+ "Also available in": "Egalement disponible en",
+ "Also available in:": "Egalement disponible en:",
"Archive": "Archives",
"Categories": "Catégories",
"LANGUAGE": "Français",
- "More posts about": "Plus de billets sur",
+ "More posts about %s": "Plus d'articles sur %s",
+ "More posts about": "Plus d'articles sur",
"Newer posts": "Billets récents",
- "Next post": "Billet suivant",
- "Older posts": "Anciens billets",
+ "Next post": "Article suivant",
+ "Older posts": "Anciens articles",
"Original site": "Site d'origine",
"Posted": "Publié",
- "Posts about %s": "Billets sur %s",
- "Posts for year %s": "Billets de l'année %s",
- "Posts for {month} {year}": "Billets de {month} {year}",
- "Previous post": "Billet précédent",
+ "Posted:": "Publié:",
+ "Posts about %s": "Articles sur %s",
+ "Posts for year %s": "Articles de l'année %s",
+ "Posts for {month} {year}": "Articles de {month} {year}",
+ "Previous post": "Article précédent",
"Read in English": "Lire en français",
"Read more": "Lire la suite",
"Source": "Source",
"Tags and Categories": "Étiquettes et catégories",
"Tags": "Étiquettes",
- "old posts page %d": "anciens billets page %d",
+ "old posts, page %d": "anciens articles, page %d",
+ "page %d": "page %d",
}
diff --git a/nikola/data/themes/base/messages/messages_hr.py b/nikola/data/themes/base/messages/messages_hr.py
index 420159d..ad74078 100644
--- a/nikola/data/themes/base/messages/messages_hr.py
+++ b/nikola/data/themes/base/messages/messages_hr.py
@@ -3,15 +3,18 @@ from __future__ import unicode_literals
MESSAGES = {
"Also available in": "Također dostupno i u",
+ "Also available in:": "Također dostupno i u:",
"Archive": "Arhiva",
- "Categories": "",
+ "Categories": "Kategorije",
"LANGUAGE": "hrvatski",
+ "More posts about %s": "Više postova o %s",
"More posts about": "Više postova o",
"Newer posts": "Noviji postovi",
"Next post": "Sljedeći post",
"Older posts": "Stariji postovi",
"Original site": "Izvorna stranica",
"Posted": "Objavljeno",
+ "Posted:": "Objavljeno:",
"Posts about %s": "Postovi o %s",
"Posts for year %s": "Postovi za godinu %s",
"Posts for {month} {year}": "Postovi za {month} {year}",
@@ -19,7 +22,8 @@ MESSAGES = {
"Read in English": "Čitaj na hrvatskom",
"Read more": "Čitaj dalje",
"Source": "Izvor",
- "Tags and Categories": "",
+ "Tags and Categories": "Tagovi i kategorije",
"Tags": "Tagovi",
- "old posts page %d": "stari postovi stranice %d",
+ "old posts, page %d": "stari postovi, stranice %d",
+ "page %d": "stranice %d",
}
diff --git a/nikola/data/themes/base/messages/messages_it.py b/nikola/data/themes/base/messages/messages_it.py
index b460f22..912342e 100644
--- a/nikola/data/themes/base/messages/messages_it.py
+++ b/nikola/data/themes/base/messages/messages_it.py
@@ -3,15 +3,18 @@ from __future__ import unicode_literals
MESSAGES = {
"Also available in": "Anche disponibile in",
+ "Also available in:": "Anche disponibile in:",
"Archive": "Archivio",
"Categories": "Categorie",
"LANGUAGE": "Italiano",
+ "More posts about %s": "Altri articoli collegati %s",
"More posts about": "Altri articoli collegati",
"Newer posts": "Articoli recenti",
"Next post": "Articolo successivo",
"Older posts": "Articoli precedenti",
"Original site": "Sito originale",
"Posted": "Pubblicato",
+ "Posted:": "Pubblicato:",
"Posts about %s": "Articoli su %s",
"Posts for year %s": "Articoli per l'anno %s",
"Posts for {month} {year}": "Articoli per {month} {year}",
@@ -21,5 +24,6 @@ MESSAGES = {
"Source": "Sorgente",
"Tags and Categories": "Tags e Categorie",
"Tags": "Tags",
- "old posts page %d": "pagina dei vecchi articoli %d",
+ "old posts, page %d": "pagina dei vecchi articoli %d",
+ "page %d": "pagina %d",
}
diff --git a/nikola/data/themes/base/messages/messages_ja.py b/nikola/data/themes/base/messages/messages_ja.py
index 4a238cc..1bdf168 100644
--- a/nikola/data/themes/base/messages/messages_ja.py
+++ b/nikola/data/themes/base/messages/messages_ja.py
@@ -3,15 +3,18 @@ from __future__ import unicode_literals
MESSAGES = {
"Also available in": "他の言語で読む",
+ "Also available in:": "他の言語で読む:",
"Archive": "過去の記事",
- "Categories": "",
+ "Categories": "カテゴリー",
"LANGUAGE": "日本語",
- "More posts about": "タグ",
+ "More posts about %s": "タグ: %s",
+ "More posts about": "タグ:",
"Newer posts": "新しい記事",
"Next post": "次の記事",
"Older posts": "過去の記事",
"Original site": "元のサイト",
"Posted": "投稿日時",
+ "Posted:": "投稿日時:",
"Posts about %s": "%sについての記事",
"Posts for year %s": "%s年の記事",
"Posts for {month} {year}": "{year}年{month}月の記事",
@@ -19,7 +22,8 @@ MESSAGES = {
"Read in English": "日本語で読む",
"Read more": "続きを読む",
"Source": "ソース",
- "Tags and Categories": "",
+ "Tags and Categories": "タグとカテゴリー",
"Tags": "タグ",
- "old posts page %d": "前の記事 %dページ目",
+ "old posts, page %d": "前の記事 %dページ目",
+ "page %d": "",
}
diff --git a/nikola/data/themes/base/messages/messages_nb.py b/nikola/data/themes/base/messages/messages_nb.py
new file mode 100644
index 0000000..154e329
--- /dev/null
+++ b/nikola/data/themes/base/messages/messages_nb.py
@@ -0,0 +1,29 @@
+# -*- encoding:utf-8 -*-
+from __future__ import unicode_literals
+
+MESSAGES = {
+ "Also available in": "Også tilgjengelig på",
+ "Also available in:": "Også tilgjengelig på:",
+ "Archive": "Arkiv",
+ "Categories": "Kategorier",
+ "LANGUAGE": "norsk",
+ "More posts about %s": "Flere innlegg om %s",
+ "More posts about": "Flere innlegg om",
+ "Newer posts": "Nyere innlegg",
+ "Next post": "Neste innlegg",
+ "Older posts": "Eldre innlegg",
+ "Original site": "Opprinnelig side",
+ "Posted": "Publisert",
+ "Posted:": "Publisert:",
+ "Posts about %s": "Innlegg om %s",
+ "Posts for year %s": "Innlegg fra %s",
+ "Posts for {month} {year}": "Innlegg fra {month} {year}",
+ "Previous post": "Forrige innlegg",
+ "Read in English": "Les på norsk",
+ "Read more": "Les mer",
+ "Source": "Kilde",
+ "Tags and Categories": "Merker og kategorier",
+ "Tags": "Merker",
+ "old posts, page %d": "eldre innlegg, side %d",
+ "page %d": "side %d",
+}
diff --git a/nikola/data/themes/base/messages/messages_nl.py b/nikola/data/themes/base/messages/messages_nl.py
index a2da822..887e85f 100644
--- a/nikola/data/themes/base/messages/messages_nl.py
+++ b/nikola/data/themes/base/messages/messages_nl.py
@@ -3,15 +3,18 @@ from __future__ import unicode_literals
MESSAGES = {
"Also available in": "Ook beschikbaar in",
+ "Also available in:": "Ook beschikbaar in:",
"Archive": "Archief",
"Categories": "Categorieën",
"LANGUAGE": "Nederlands",
+ "More posts about %s": "Meer berichten over %s",
"More posts about": "Meer berichten over",
"Newer posts": "Nieuwere berichten",
"Next post": "Volgend bericht",
"Older posts": "Oudere berichten",
"Original site": "Originele site",
"Posted": "Geplaatst",
+ "Posted:": "Geplaatst:",
"Posts about %s": "Berichten over %s",
"Posts for year %s": "Berichten voor het jaar %s",
"Posts for {month} {year}": "Berichten voor {month} {year}",
@@ -21,5 +24,6 @@ MESSAGES = {
"Source": "Bron",
"Tags and Categories": "Tags en Categorieën",
"Tags": "Tags",
- "old posts page %d": "oude berichten pagina %d",
+ "old posts, page %d": "oude berichten, pagina %d",
+ "page %d": "pagina %d",
}
diff --git a/nikola/data/themes/base/messages/messages_pl.py b/nikola/data/themes/base/messages/messages_pl.py
index cf5c51c..352b0ed 100644
--- a/nikola/data/themes/base/messages/messages_pl.py
+++ b/nikola/data/themes/base/messages/messages_pl.py
@@ -2,16 +2,19 @@
from __future__ import unicode_literals
MESSAGES = {
- "Also available in": "Również dostępny w",
+ "Also available in": "Również dostępny w językach",
+ "Also available in:": "Również dostępny w językach:",
"Archive": "Archiwum",
"Categories": "Kategorie",
"LANGUAGE": "polski",
+ "More posts about %s": "Więcej postów o %s",
"More posts about": "Więcej postów o",
"Newer posts": "Nowsze posty",
"Next post": "Następny post",
"Older posts": "Starsze posty",
"Original site": "Oryginalna strona",
- "Posted": "Opublikowany",
+ "Posted": "Opublikowano",
+ "Posted:": "Opublikowano:",
"Posts about %s": "Posty o %s",
"Posts for year %s": "Posty z roku %s",
"Posts for {month} {year}": "Posty z {month} {year}",
@@ -21,5 +24,6 @@ MESSAGES = {
"Source": "Źródło",
"Tags and Categories": "Tagi i Kategorie",
"Tags": "Tags",
- "old posts page %d": "stare posty, strona %d",
+ "old posts, page %d": "stare posty, strona %d",
+ "page %d": "strona %d",
}
diff --git a/nikola/data/themes/base/messages/messages_pt_br.py b/nikola/data/themes/base/messages/messages_pt_br.py
index ebf642a..1283a2a 100644
--- a/nikola/data/themes/base/messages/messages_pt_br.py
+++ b/nikola/data/themes/base/messages/messages_pt_br.py
@@ -3,15 +3,18 @@ from __future__ import unicode_literals
MESSAGES = {
"Also available in": "Também disponível em",
+ "Also available in:": "Também disponível em:",
"Archive": "Arquivo",
"Categories": "Categorias",
"LANGUAGE": "Português",
+ "More posts about %s": "Mais posts sobre %s",
"More posts about": "Mais posts sobre",
"Newer posts": "Posts mais recentes",
"Next post": "Próximo post",
"Older posts": "Posts mais antigos",
"Original site": "Site original",
"Posted": "Publicado",
+ "Posted:": "Publicado:",
"Posts about %s": "Posts sobre %s",
"Posts for year %s": "Posts do ano %s",
"Posts for {month} {year}": "Posts de {month} {year}",
@@ -21,5 +24,6 @@ MESSAGES = {
"Source": "Código",
"Tags and Categories": "Tags e Categorias",
"Tags": "Tags",
- "old posts page %d": "Posts antigos página %d",
+ "old posts, page %d": "Posts antigos, página %d",
+ "page %d": "página %d",
}
diff --git a/nikola/data/themes/base/messages/messages_ru.py b/nikola/data/themes/base/messages/messages_ru.py
index 44ce1f2..3462292 100644
--- a/nikola/data/themes/base/messages/messages_ru.py
+++ b/nikola/data/themes/base/messages/messages_ru.py
@@ -3,15 +3,18 @@ from __future__ import unicode_literals
MESSAGES = {
"Also available in": "Также доступно на",
+ "Also available in:": "Также доступно на:",
"Archive": "Архив",
"Categories": "Категории",
"LANGUAGE": "Русский",
+ "More posts about %s": "Больше записей о %s",
"More posts about": "Больше записей о",
"Newer posts": "Новые записи",
"Next post": "Следующая запись",
"Older posts": "Старые записи",
"Original site": "Оригинальный сайт",
"Posted": "Опубликовано",
+ "Posted:": "Опубликовано:",
"Posts about %s": "Записи о %s",
"Posts for year %s": "Записи за %s год",
"Posts for {month} {year}": "Записи за {month} {year}",
@@ -21,5 +24,6 @@ MESSAGES = {
"Source": "Источник",
"Tags and Categories": "Тэги и категории",
"Tags": "Тэги",
- "old posts page %d": "%d страница со старыми записями",
+ "old posts, page %d": "%d страница со старыми записями",
+ "page %d": "%d страница",
}
diff --git a/nikola/data/themes/base/messages/messages_sl.py b/nikola/data/themes/base/messages/messages_sl.py
index bad3327..817bcee 100644
--- a/nikola/data/themes/base/messages/messages_sl.py
+++ b/nikola/data/themes/base/messages/messages_sl.py
@@ -3,15 +3,18 @@ from __future__ import unicode_literals
MESSAGES = {
"Also available in": "Na voljo tudi v",
+ "Also available in:": "Na voljo tudi v:",
"Archive": "Arhiv",
"Categories": "Kategorije",
"LANGUAGE": "Slovenščina",
+ "More posts about %s": "Več objav o %s",
"More posts about": "Več objav o",
"Newer posts": "Novejše objave",
"Next post": "Naslednja objava",
"Older posts": "Starejše objave",
"Original site": "Izvorna spletna stran",
"Posted": "Objavljeno",
+ "Posted:": "Objavljeno:",
"Posts about %s": "Objave o %s",
"Posts for year %s": "Objave za leto %s",
"Posts for {month} {year}": "Objave za {month} {year}",
@@ -21,5 +24,6 @@ MESSAGES = {
"Source": "Izvor",
"Tags and Categories": "Značke in kategorije",
"Tags": "Značke",
- "old posts page %d": "stare objave, stran %d",
+ "old posts, page %d": "stare objave, stran %d",
+ "page %d": "stran %d",
}
diff --git a/nikola/data/themes/base/messages/messages_tr.py b/nikola/data/themes/base/messages/messages_tr.py
new file mode 120000
index 0000000..ad92768
--- /dev/null
+++ b/nikola/data/themes/base/messages/messages_tr.py
@@ -0,0 +1 @@
+messages_tr_tr.py \ No newline at end of file
diff --git a/nikola/data/themes/base/messages/messages_tr_tr.py b/nikola/data/themes/base/messages/messages_tr_tr.py
index 7cf0e9f..633f057 100644
--- a/nikola/data/themes/base/messages/messages_tr_tr.py
+++ b/nikola/data/themes/base/messages/messages_tr_tr.py
@@ -2,16 +2,19 @@
from __future__ import unicode_literals
MESSAGES = {
- "Also available in": "Şu dilde de mevcut:",
+ "Also available in": "Şu dilde de mevcut",
+ "Also available in:": "Şu dilde de mevcut:",
"Archive": "Arşiv",
"Categories": "Kategoriler",
"LANGUAGE": "Türkçe",
- "More posts about": "ilgili diğer yazılar",
+ "More posts about %s": "%s ilgili diğer yazılar",
+ "More posts about": " ilgili diğer yazılar",
"Newer posts": "Daha yeni yazılar",
"Next post": "Sonraki yazı",
"Older posts": "Daha eski yazılar",
"Original site": "Orjinal web sayfası",
"Posted": "Yayın tarihi",
+ "Posted:": "Yayın tarihi:",
"Posts about %s": "%s ile ilgili yazılar",
"Posts for year %s": "%s yılındaki yazılar",
"Posts for {month} {year}": "{month} {year} göre yazılar",
@@ -21,5 +24,6 @@ MESSAGES = {
"Source": "Kaynak",
"Tags and Categories": "Etiketler ve Kategoriler",
"Tags": "Etiketler",
- "old posts page %d": "eski yazılar sayfa %d",
+ "old posts, page %d": "eski yazılar, sayfa %d",
+ "page %d": "sayfa %d",
}
diff --git a/nikola/data/themes/base/messages/messages_ur.py b/nikola/data/themes/base/messages/messages_ur.py
new file mode 100644
index 0000000..d9c2f2b
--- /dev/null
+++ b/nikola/data/themes/base/messages/messages_ur.py
@@ -0,0 +1,29 @@
+# -*- encoding:utf-8 -*-
+from __future__ import unicode_literals
+
+MESSAGES = {
+ "Also available in": "ان زبانوں میں بھی دستیاب",
+ "Also available in:": "ان زبانوں میں بھی دستیاب:",
+ "Archive": "آرکائیو",
+ "Categories": "زمرے",
+ "LANGUAGE": "اردو",
+ "More posts about %s": "%s کے بارے میں مزید تحاریر",
+ "More posts about": " کے بارے میں مزید تحاریر",
+ "Newer posts": "نئی تحاریر",
+ "Next post": "اگلی تحریر",
+ "Older posts": "پرانی تحاریر",
+ "Original site": "اصلی سائٹ",
+ "Posted": "اشاعت",
+ "Posted:": "اشاعت:",
+ "Posts about %s": "%s کے بارے میں تحاریر",
+ "Posts for year %s": "سال %s کی تحاریر",
+ "Posts for {month} {year}": "{month} {year} کی تحاریر",
+ "Previous post": "پچھلی تحریر",
+ "Read in English": "اردو میں پڑھیے",
+ "Read more": "مزید پڑھیے",
+ "Source": "سورس",
+ "Tags and Categories": "ٹیگز اور زمرے",
+ "Tags": "ٹیگز",
+ "old posts, page %d": "پرانی تحاریر صفحہ %d",
+ "page %d": "",
+}
diff --git a/nikola/data/themes/base/messages/messages_zh_cn.py b/nikola/data/themes/base/messages/messages_zh_cn.py
index fc79313..cb9a2f7 100644
--- a/nikola/data/themes/base/messages/messages_zh_cn.py
+++ b/nikola/data/themes/base/messages/messages_zh_cn.py
@@ -3,15 +3,18 @@ from __future__ import unicode_literals
MESSAGES = {
"Also available in": "其他语言版本",
+ "Also available in:": "其他语言版本:",
"Archive": "文章存档",
- "Categories": "",
+ "Categories": "分类",
"LANGUAGE": "简体中文",
+ "More posts about %s": "更多相关文章: %s",
"More posts about": "更多相关文章:",
"Newer posts": "新一篇",
"Next post": "后一篇",
"Older posts": "旧一篇",
"Original site": "原文地址",
"Posted": "发表于",
+ "Posted:": "发表于:",
"Posts about %s": "文章分类:%s",
"Posts for year %s": "%s年文章",
"Posts for {month} {year}": "{year}年{month}月文章",
@@ -19,7 +22,8 @@ MESSAGES = {
"Read in English": "中文版",
"Read more": "更多",
"Source": "源代码",
- "Tags and Categories": "",
+ "Tags and Categories": "标签和分类",
"Tags": "标签",
- "old posts page %d": "旧文章页 %d",
+ "old posts, page %d": "旧文章页 %d",
+ "page %d": "",
}
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"))}:&nbsp;
+ ${messages("Also available in:")}&nbsp;
${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>&nbsp;${folder}</a></li>
+ % for folder, ftitle in folders:
+ <li><a href="${folder}"><i
+ class="icon-folder-open"></i>&nbsp;${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>&nbsp;&nbsp;
- ${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">&larr; ${messages("Newer posts")}</a>
- </li>
- %endif
- %if nextlink:
- <li class="next">
- <a href="${nextlink}" rel="next">${messages("Older posts")} &rarr;</a>
- </li>
- %endif
-</ul>
-</div>
+ %if prevlink or nextlink:
+ <div>
+ <ul class="pager">
+ %if prevlink:
+ <li class="previous">
+ <a href="${prevlink}" rel="prev">&larr; ${messages("Newer posts")}</a>
+ </li>
+ %endif
+ %if nextlink:
+ <li class="next">
+ <a href="${nextlink}" rel="next">${messages("Older posts")} &rarr;</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)}
&nbsp;&nbsp;|&nbsp;&nbsp;
@@ -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):
&nbsp;&nbsp;|&nbsp;&nbsp;
- <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:
- &nbsp;&nbsp;|&nbsp;&nbsp;${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>
+ &nbsp;&nbsp;|&nbsp;&nbsp;
+ ${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">&larr; ${messages("Previous post")}</a>
- </li>
- %endif
- %if post.next_post:
- <li class="next">
- <a href="${post.next_post.permalink()}" rel="next">${messages("Next post")} &rarr;</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">&larr; ${messages("Previous post")}</a>
+ </li>
+ %endif
+ %if post.next_post:
+ <li class="next">
+ <a href="${post.next_post.permalink()}" rel="next">${messages("Next post")} &rarr;</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"/>
diff --git a/nikola/data/themes/bootstrap/assets/css/theme.css b/nikola/data/themes/bootstrap/assets/css/theme.css
index 2ff1a80..952073f 100644
--- a/nikola/data/themes/bootstrap/assets/css/theme.css
+++ b/nikola/data/themes/bootstrap/assets/css/theme.css
@@ -84,4 +84,20 @@ pre, pre code {
white-space: pre;
word-wrap: normal;
overflow: auto;
-} \ No newline at end of file
+}
+
+article.post-micro {
+ font-family: Georgia, 'Times New Roman', Times, serif;
+ font-size: 1.5em;
+}
+
+/* fix anchors for headers */
+h1, h2, h3 {
+ margin-top: -40px;
+ padding-top: 60px;
+}
+
+h4, h5, h6 {
+ margin-top: -50px;
+ padding-top: 60px;
+}
diff --git a/nikola/data/themes/bootstrap/templates/bootstrap_helper.tmpl b/nikola/data/themes/bootstrap/templates/bootstrap_helper.tmpl
index 763ac20..f0d1986 100644
--- a/nikola/data/themes/bootstrap/templates/bootstrap_helper.tmpl
+++ b/nikola/data/themes/bootstrap/templates/bootstrap_helper.tmpl
@@ -29,6 +29,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]-->
@@ -79,7 +80,7 @@
<ul class="dropdown-menu">
%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
@@ -87,7 +88,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
diff --git a/nikola/data/themes/bootstrap/templates/gallery.tmpl b/nikola/data/themes/bootstrap/templates/gallery.tmpl
index 17ae61c..0dd5eea 100644
--- a/nikola/data/themes/bootstrap/templates/gallery.tmpl
+++ b/nikola/data/themes/bootstrap/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>&nbsp;${folder}</a></li>
+ % for folder, ftitle in folders:
+ <li><a href="${folder}"><i
+ class="icon-folder-open"></i>&nbsp;${ftitle}</a></li>
% endfor
</ul>
diff --git a/nikola/filters.py b/nikola/filters.py
index 04703cb..aa7ba8a 100644
--- a/nikola/filters.py
+++ b/nikola/filters.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -26,6 +26,7 @@
"""Utility functions to help you run filters on files."""
+from .utils import req_missing
from functools import wraps
import os
import re
@@ -37,7 +38,7 @@ import shlex
try:
import typogrify.filters as typo
except ImportError:
- typo = None
+ typo = None # NOQA
def apply_to_file(f):
@@ -102,7 +103,21 @@ def runinplace(command, infile):
def yui_compressor(infile):
- return runinplace(r'yui-compressor --nomunge %1 -o %2', infile)
+ yuicompressor = False
+ try:
+ subprocess.call('yui-compressor', stdout=open(os.devnull, 'w'), stderr=open(os.devnull, 'w'))
+ yuicompressor = 'yui-compressor'
+ except Exception:
+ pass
+ if not yuicompressor:
+ try:
+ subprocess.call('yuicompressor', stdout=open(os.devnull, 'w'), stderr=open(os.devnull, 'w'))
+ yuicompressor = 'yuicompressor'
+ except:
+ raise Exception("yui-compressor is not installed.")
+ return False
+
+ return runinplace(r'{} --nomunge %1 -o %2'.format(yuicompressor), infile)
def optipng(infile):
@@ -114,7 +129,7 @@ def jpegoptim(infile):
def tidy(inplace):
- # Goggle site verifcation files are no HTML
+ # Google site verifcation files are not HTML
if re.match(r"google[a-f0-9]+.html", os.path.basename(inplace)) \
and open(inplace).readline().startswith(
"google-site-verification:"):
@@ -161,7 +176,8 @@ def tidy(inplace):
def typogrify(data):
global typogrify_filter
if typo is None:
- raise Exception("To use the typogrify filter, you need to install typogrify.")
+ req_missing(['typogrify', 'use the typogrify filter'])
+
data = typo.amp(data)
data = typo.widont(data)
data = typo.smartypants(data)
diff --git a/nikola/nikola.py b/nikola/nikola.py
index 13c91a7..6971c0c 100644
--- a/nikola/nikola.py
+++ b/nikola/nikola.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -43,7 +43,9 @@ except ImportError:
pyphen = None
import logging
-if os.getenv('NIKOLA_DEBUG'):
+from . import DEBUG
+
+if DEBUG:
logging.basicConfig(level=logging.DEBUG)
else:
logging.basicConfig(level=logging.ERROR)
@@ -105,6 +107,7 @@ class Nikola(object):
self._scanned = False
self._template_system = None
self._THEMES = None
+ self.debug = DEBUG
self.loghandlers = []
if not config:
self.configured = False
@@ -143,6 +146,7 @@ class Nikola(object):
'DEFAULT_LANG': "en",
'DEPLOY_COMMANDS': [],
'DISABLED_PLUGINS': (),
+ 'EXTRA_PLUGINS_DIRS': [],
'COMMENT_SYSTEM_ID': 'nikolademo',
'ENABLED_EXTRAS': (),
'EXTRA_HEAD_DATA': '',
@@ -165,8 +169,10 @@ class Nikola(object):
'INDEX_TEASERS': False,
'INDEXES_TITLE': "",
'INDEXES_PAGES': "",
+ 'INDEXES_PAGES_MAIN': False,
'INDEX_PATH': '',
'IPYNB_CONFIG': {},
+ 'LESS_COMPILER': 'lessc',
'LICENSE': '',
'LINK_CHECK_WHITELIST': [],
'LISTINGS_FOLDER': 'listings',
@@ -185,6 +191,7 @@ class Nikola(object):
'RSS_LINK': None,
'RSS_PATH': '',
'RSS_TEASERS': True,
+ 'SASS_COMPILER': 'sass',
'SEARCH_FORM': '',
'SLUG_TAG_PATH': True,
'SOCIAL_BUTTONS_CODE': SOCIAL_BUTTONS_CODE,
@@ -198,16 +205,19 @@ class Nikola(object):
'THEME_REVEAL_CONFIG_SUBTHEME': 'sky',
'THEME_REVEAL_CONFIG_TRANSITION': 'cube',
'THUMBNAIL_SIZE': 180,
+ 'URL_TYPE': 'rel_path',
'USE_BUNDLES': True,
'USE_CDN': False,
'USE_FILENAME_AS_TITLE': True,
- 'TIMEZONE': None,
+ 'TIMEZONE': 'UTC',
'DEPLOY_DRAFTS': True,
'DEPLOY_FUTURE': False,
'SCHEDULE_ALL': False,
'SCHEDULE_RULE': '',
'SCHEDULE_FORCE_TODAY': False,
'LOGGING_HANDLERS': {'stderr': {'loglevel': 'WARNING', 'bubble': True}},
+ 'DEMOTE_HEADERS': 1,
+ 'TRANSLATIONS_PATTERN': '{path}.{ext}.{lang}',
}
self.config.update(config)
@@ -337,16 +347,18 @@ class Nikola(object):
"SignalHandler": SignalHandler,
})
self.plugin_manager.setPluginInfoExtension('plugin')
+ extra_plugins_dirs = self.config['EXTRA_PLUGINS_DIRS']
if sys.version_info[0] == 3:
places = [
os.path.join(os.path.dirname(__file__), 'plugins'),
os.path.join(os.getcwd(), 'plugins'),
- ]
+ ] + [path for path in extra_plugins_dirs if path]
else:
places = [
os.path.join(os.path.dirname(__file__), utils.sys_encode('plugins')),
os.path.join(os.getcwd(), utils.sys_encode('plugins')),
- ]
+ ] + [utils.sys_encode(path) for path in extra_plugins_dirs if path]
+
self.plugin_manager.setPluginPlaces(places)
self.plugin_manager.collectPlugins()
@@ -590,6 +602,8 @@ class Nikola(object):
local_context["template_name"] = template_name
local_context.update(self.GLOBAL_CONTEXT)
local_context.update(context)
+ # string, arguments
+ local_context["formatmsg"] = lambda s, *a: s % a
data = self.template_system.render_template(
template_name, None, local_context)
@@ -617,14 +631,35 @@ class Nikola(object):
else:
return dst
+ # Refuse to replace links that consist of a fragment only
+ if ((not dst_url.scheme) and (not dst_url.netloc) and
+ (not dst_url.path) and (not dst_url.params) and
+ (not dst_url.query) and dst_url.fragment):
+ return dst
+
# Normalize
dst = urljoin(src, dst)
+
# Avoid empty links.
if src == dst:
- return "#"
+ if self.config.get('URL_TYPE') == 'absolute':
+ dst = urljoin(self.config['BASE_URL'], dst)
+ return dst
+ elif self.config.get('URL_TYPE') == 'full_path':
+ return dst
+ else:
+ return "#"
+
# Check that link can be made relative, otherwise return dest
parsed_dst = urlsplit(dst)
if parsed_src[:2] != parsed_dst[:2]:
+ if self.config.get('URL_TYPE') == 'absolute':
+ dst = urljoin(self.config['BASE_URL'], dst)
+ return dst
+
+ if self.config.get('URL_TYPE') in ('full_path', 'absolute'):
+ if self.config.get('URL_TYPE') == 'absolute':
+ dst = urljoin(self.config['BASE_URL'], dst)
return dst
# Now both paths are on the same site and absolute
@@ -733,7 +768,7 @@ class Nikola(object):
# Normalize
dst = urljoin(self.config['BASE_URL'], dst)
- return urlparse(dst).path
+ return urlparse(dst).geturl()
def rel_link(self, src, dst):
# Normalize
@@ -825,13 +860,16 @@ class Nikola(object):
full_list = glob.glob(dir_glob)
# Now let's look for things that are not in default_lang
for lang in self.config['TRANSLATIONS'].keys():
- lang_glob = dir_glob + "." + lang
+ lang_glob = utils.get_translation_candidate(self.config, dir_glob, lang)
translated_list = glob.glob(lang_glob)
- for fname in translated_list:
- orig_name = os.path.splitext(fname)[0]
- if orig_name in full_list:
- continue
- full_list.append(orig_name)
+ # dir_glob could have put it already in full_list
+ full_list = list(set(full_list + translated_list))
+ # Eliminate translations from full_list (even from dir_glob)
+ for fname in full_list:
+ translation = utils.get_translation_candidate(self.config, fname, lang)
+ if translation in full_list:
+ full_list.remove(translation)
+
# We eliminate from the list the files inside any .ipynb folder
full_list = [p for p in full_list
if not any([x.startswith('.')
@@ -849,7 +887,7 @@ class Nikola(object):
use_in_feeds,
self.MESSAGES,
template_name,
- self.get_compiler(base_path).compile_html
+ self.get_compiler(base_path)
)
self.global_data[post.source_path] = post
if post.use_in_feeds:
@@ -873,8 +911,6 @@ class Nikola(object):
self.posts_per_category[post.meta('category')].append(post.source_path)
else:
self.pages.append(post)
- if self.config['OLD_THEME_SUPPORT']:
- post._add_old_metadata()
self.post_per_file[post.destination_path(lang=lang)] = post
self.post_per_file[post.destination_path(lang=lang, extension=post.source_ext())] = post
diff --git a/nikola/plugin_categories.py b/nikola/plugin_categories.py
index 23ca287..68327aa 100644
--- a/nikola/plugin_categories.py
+++ b/nikola/plugin_categories.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -42,6 +42,12 @@ from doit.cmd_base import Command as DoitCommand
from .utils import LOGGER, first_line
+try:
+ # ordereddict does not exist in py2.6
+ from collections import OrderedDict
+except ImportError:
+ OrderedDict = None # NOQA
+
class BasePlugin(IPlugin):
"""Base plugin class."""
@@ -178,14 +184,22 @@ class PageCompiler(BasePlugin):
"""Plugins that compile text files into HTML."""
name = "dummy compiler"
- default_metadata = {
- 'title': '',
- 'slug': '',
- 'date': '',
- 'tags': '',
- 'link': '',
- 'description': '',
- }
+ demote_headers = False
+ if OrderedDict is not None:
+ default_metadata = OrderedDict()
+ else:
+ # Graceful fallback. We could use a backport, but it is
+ # not going to change anything, other than a bit uglier
+ # and nonsensical layout. Not enough to care.
+ default_metadata = {}
+
+ default_metadata['title'] = ''
+ default_metadata['slug'] = ''
+ default_metadata['date'] = ''
+ default_metadata['tags'] = ''
+ default_metadata['link'] = ''
+ default_metadata['description'] = ''
+ default_metadata['type'] = 'text'
def compile_html(self, source, dest, is_two_file=False):
"""Compile the source, save it on dest."""
diff --git a/nikola/plugins/basic_import.py b/nikola/plugins/basic_import.py
index e368fca..0d94d16 100644
--- a/nikola/plugins/basic_import.py
+++ b/nikola/plugins/basic_import.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/nikola/plugins/command/__init__.py b/nikola/plugins/command/__init__.py
index 9be4d63..6ad8bac 100644
--- a/nikola/plugins/command/__init__.py
+++ b/nikola/plugins/command/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/nikola/plugins/command/auto.py b/nikola/plugins/command/auto.py
index cb726d9..01116d1 100644
--- a/nikola/plugins/command/auto.py
+++ b/nikola/plugins/command/auto.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -26,30 +26,13 @@
from __future__ import print_function, unicode_literals
-import codecs
-import json
import os
import subprocess
+import webbrowser
from nikola.plugin_categories import Command
from nikola.utils import req_missing
-GUARDFILE = """#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-from livereload.task import Task
-import json
-import subprocess
-
-def f():
- import subprocess
- subprocess.call(("nikola", "build"))
-
-fdata = json.loads('''{0}''')
-
-for watch in fdata:
- Task.add(watch, f)
-"""
-
class Auto(Command):
"""Start debugging console."""
@@ -76,9 +59,9 @@ class Auto(Command):
def _execute(self, options, args):
"""Start the watcher."""
try:
- from livereload.server import start
+ from livereload import Server
except ImportError:
- req_missing(['livereload'], 'use the "auto" command')
+ req_missing(['livereload>=2.0.0'], 'use the "auto" command')
return
# Run an initial build so we are uptodate
@@ -86,18 +69,18 @@ class Auto(Command):
port = options and options.get('port')
- # Create a Guardfile
- with codecs.open("Guardfile", "wb+", "utf8") as guardfile:
- l = ["conf.py", "themes", "templates", self.site.config['GALLERY_PATH']]
- for item in self.site.config['post_pages']:
- l.append(os.path.dirname(item[0]))
- for item in self.site.config['FILES_FOLDERS']:
- l.append(os.path.dirname(item))
- data = GUARDFILE.format(json.dumps(l))
- guardfile.write(data)
+ server = Server()
+ server.watch('conf.py')
+ server.watch('themes/')
+ server.watch('templates/')
+ server.watch(self.site.config['GALLERY_PATH'])
+ for item in self.site.config['post_pages']:
+ server.watch(os.path.dirname(item[0]))
+ for item in self.site.config['FILES_FOLDERS']:
+ server.watch(os.path.dirname(item))
out_folder = self.site.config['OUTPUT_FOLDER']
+ if options and options.get('browser'):
+ webbrowser.open('http://localhost:{0}'.format(port))
- os.chmod("Guardfile", 0o755)
-
- start(port, out_folder, options and options.get('browser'))
+ server.serve(port, out_folder)
diff --git a/nikola/plugins/command/bootswatch_theme.py b/nikola/plugins/command/bootswatch_theme.py
index eb27f94..94f37f2 100644
--- a/nikola/plugins/command/bootswatch_theme.py
+++ b/nikola/plugins/command/bootswatch_theme.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/nikola/plugins/command/check.py b/nikola/plugins/command/check.py
index 5c7e49a..a7e8c13 100644
--- a/nikola/plugins/command/check.py
+++ b/nikola/plugins/command/check.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -40,6 +40,29 @@ from nikola.plugin_categories import Command
from nikola.utils import get_logger
+def real_scan_files(site):
+ task_fnames = set([])
+ real_fnames = set([])
+ output_folder = site.config['OUTPUT_FOLDER']
+ # First check that all targets are generated in the right places
+ for task in os.popen('nikola list --all', 'r').readlines():
+ task = task.strip()
+ if output_folder in task and ':' in task:
+ fname = task.split(':', 1)[-1]
+ task_fnames.add(fname)
+ # And now check that there are no non-target files
+ for root, dirs, files in os.walk(output_folder):
+ for src_name in files:
+ fname = os.path.join(root, src_name)
+ real_fnames.add(fname)
+
+ only_on_output = list(real_fnames - task_fnames)
+
+ only_on_input = list(task_fnames - real_fnames)
+
+ return (only_on_output, only_on_input)
+
+
class CommandCheck(Command):
"""Check the generated site."""
@@ -63,7 +86,7 @@ class CommandCheck(Command):
'long': 'check-files',
'type': bool,
'default': False,
- 'help': 'Check for unknown files',
+ 'help': 'Check for unknown (orphaned and not generated) files',
},
{
'name': 'clean',
@@ -154,7 +177,7 @@ class CommandCheck(Command):
failure = False
self.logger.notice("Checking Files:")
self.logger.notice("===============\n")
- only_on_output, only_on_input = self.real_scan_files()
+ only_on_output, only_on_input = real_scan_files(self.site)
# Ignore folders
only_on_output = [p for p in only_on_output if not os.path.isdir(p)]
@@ -162,7 +185,7 @@ class CommandCheck(Command):
if only_on_output:
only_on_output.sort()
- self.logger.warn("Files from unknown origins:")
+ self.logger.warn("Files from unknown origins (orphans):")
for f in only_on_output:
self.logger.warn(f)
failure = True
@@ -180,25 +203,3 @@ class CommandCheck(Command):
for f in only_on_output:
os.unlink(f)
return True
-
- def real_scan_files(self):
- task_fnames = set([])
- real_fnames = set([])
- output_folder = self.site.config['OUTPUT_FOLDER']
- # First check that all targets are generated in the right places
- for task in os.popen('nikola list --all', 'r').readlines():
- task = task.strip()
- if output_folder in task and ':' in task:
- fname = task.split(':', 1)[-1]
- task_fnames.add(fname)
- # And now check that there are no non-target files
- for root, dirs, files in os.walk(output_folder):
- for src_name in files:
- fname = os.path.join(root, src_name)
- real_fnames.add(fname)
-
- only_on_output = list(real_fnames - task_fnames)
-
- only_on_input = list(task_fnames - real_fnames)
-
- return (only_on_output, only_on_input)
diff --git a/nikola/plugins/command/console.plugin b/nikola/plugins/command/console.plugin
index a2be9ca..2eeedae 100644
--- a/nikola/plugins/command/console.plugin
+++ b/nikola/plugins/command/console.plugin
@@ -3,7 +3,7 @@ Name = console
Module = console
[Documentation]
-Author = Roberto Alsina
+Author = Chris Warrick, Roberto Alsina
Version = 0.1
Website = http://getnikola.com
Description = Start a debugging python console
diff --git a/nikola/plugins/command/console.py b/nikola/plugins/command/console.py
index fe17dfc..e66b650 100644
--- a/nikola/plugins/command/console.py
+++ b/nikola/plugins/command/console.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Chris Warrick, Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -39,8 +39,21 @@ class Console(Command):
"""Start debugging console."""
name = "console"
shells = ['ipython', 'bpython', 'plain']
- doc_purpose = "Start an interactive Python (IPython->bpython->plain) console with access to your site and configuration"
+ doc_purpose = "start an interactive Python console with access to your site"
+ doc_description = """\
+Order of resolution: IPython → bpython [deprecated] → plain Python interpreter
+The site engine is accessible as `SITE`, and the config as `conf`."""
header = "Nikola v" + __version__ + " -- {0} Console (conf = configuration, SITE = site engine)"
+ cmd_options = [
+ {
+ 'name': 'plain',
+ 'short': 'p',
+ 'long': 'plain',
+ 'type': bool,
+ 'default': False,
+ 'help': 'Force the plain Python console',
+ }
+ ]
def ipython(self):
"""IPython shell."""
@@ -102,9 +115,12 @@ class Console(Command):
def _execute(self, options, args):
"""Start the console."""
- for shell in self.shells:
- try:
- return getattr(self, shell)()
- except ImportError:
- pass
- raise ImportError
+ if options['plain']:
+ self.plain()
+ else:
+ for shell in self.shells:
+ try:
+ return getattr(self, shell)()
+ except ImportError:
+ pass
+ raise ImportError
diff --git a/nikola/plugins/command/deploy.py b/nikola/plugins/command/deploy.py
index efb909d..eb5787e 100644
--- a/nikola/plugins/command/deploy.py
+++ b/nikola/plugins/command/deploy.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -85,18 +85,17 @@ class Deploy(Command):
sys.exit(e.returncode)
self.logger.notice("Successful deployment")
- if self.site.config['TIMEZONE'] is not None:
- tzinfo = pytz.timezone(self.site.config['TIMEZONE'])
- else:
- tzinfo = pytz.UTC
+ tzinfo = pytz.timezone(self.site.config['TIMEZONE'])
try:
with open(timestamp_path, 'rb') as inf:
last_deploy = literal_eval(inf.read().strip())
- # this might ignore DST
- last_deploy = last_deploy.replace(tzinfo=tzinfo)
+ if tzinfo:
+ last_deploy = last_deploy.replace(tzinfo=tzinfo)
clean = False
except Exception:
- last_deploy = datetime(1970, 1, 1).replace(tzinfo=tzinfo)
+ last_deploy = datetime(1970, 1, 1)
+ if tzinfo:
+ last_deploy = last_deploy.replace(tzinfo=tzinfo)
clean = True
new_deploy = datetime.now()
diff --git a/nikola/plugins/command/import_blogger.py b/nikola/plugins/command/import_blogger.py
index 53618b4..ea12b4a 100644
--- a/nikola/plugins/command/import_blogger.py
+++ b/nikola/plugins/command/import_blogger.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/nikola/plugins/command/import_feed.py b/nikola/plugins/command/import_feed.py
index b25d9ec..70a5cd5 100644
--- a/nikola/plugins/command/import_feed.py
+++ b/nikola/plugins/command/import_feed.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/nikola/plugins/command/import_wordpress.py b/nikola/plugins/command/import_wordpress.py
index 4f32198..0c9915a 100644
--- a/nikola/plugins/command/import_wordpress.py
+++ b/nikola/plugins/command/import_wordpress.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -145,7 +145,7 @@ class CommandImportWordpress(Command, ImportMixin):
rendered_template = re.sub('# REDIRECTIONS = ', 'REDIRECTIONS = ',
rendered_template)
if self.timezone:
- rendered_template = re.sub('# TIMEZONE = \'Europe/Zurich\'',
+ rendered_template = re.sub('# TIMEZONE = \'UTC\'',
'TIMEZONE = \'' + self.timezone + '\'',
rendered_template)
self.write_configuration(self.get_configuration_output_path(),
diff --git a/nikola/plugins/command/init.py b/nikola/plugins/command/init.py
index 1873ec4..96caad8 100644
--- a/nikola/plugins/command/init.py
+++ b/nikola/plugins/command/init.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/nikola/plugins/command/install_plugin.py b/nikola/plugins/command/install_plugin.py
index fdbd0b7..1d6584d 100644
--- a/nikola/plugins/command/install_plugin.py
+++ b/nikola/plugins/command/install_plugin.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -27,6 +27,7 @@
from __future__ import print_function
import codecs
import os
+import sys
import json
import shutil
import subprocess
@@ -145,7 +146,6 @@ class CommandInstallPlugin(Command):
shutil.copytree(plugin_path, dest_path)
reqpath = os.path.join(dest_path, 'requirements.txt')
- print(reqpath)
if os.path.exists(reqpath):
LOGGER.notice('This plugin has Python dependencies.')
LOGGER.notice('Installing dependencies with pip...')
@@ -180,6 +180,10 @@ class CommandInstallPlugin(Command):
LOGGER.notice('This plugin has a sample config file.')
print('Contents of the conf.py.sample file:\n')
with codecs.open(confpypath, 'rb', 'utf-8') as fh:
- print(indent(pygments.highlight(
- fh.read(), PythonLexer(), TerminalFormatter()), 4 * ' '))
+ if sys.platform == 'win32':
+ print(indent(pygments.highlight(
+ fh.read(), PythonLexer(), TerminalFormatter()),
+ 4 * ' '))
+ else:
+ print(indent(fh.read(), 4 * ' '))
return True
diff --git a/nikola/plugins/command/install_theme.py b/nikola/plugins/command/install_theme.py
index a9d835a..569397b 100644
--- a/nikola/plugins/command/install_theme.py
+++ b/nikola/plugins/command/install_theme.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -26,9 +26,10 @@
from __future__ import print_function
import os
+import sys
+import codecs
import json
import shutil
-import codecs
from io import BytesIO
import pygments
@@ -116,18 +117,22 @@ class CommandInstallTheme(Command):
print(theme)
return True
else:
- self.do_install(name, data)
- # See if the theme's parent is available. If not, install it
- while True:
- parent_name = utils.get_parent_theme_name(name)
- if parent_name is None:
- break
- try:
- utils.get_theme_path(parent_name)
- break
- except: # Not available
- self.do_install(parent_name, data)
- name = parent_name
+ # `name` may be modified by the while loop.
+ origname = name
+ installstatus = self.do_install(name, data)
+ # See if the theme's parent is available. If not, install it
+ while True:
+ parent_name = utils.get_parent_theme_name(name)
+ if parent_name is None:
+ break
+ try:
+ utils.get_theme_path(parent_name)
+ break
+ except: # Not available
+ self.do_install(parent_name, data)
+ name = parent_name
+ if installstatus:
+ LOGGER.notice('Remember to set THEME="{0}" in conf.py to use this theme.'.format(origname))
def do_install(self, name, data):
if name in data:
@@ -155,9 +160,13 @@ class CommandInstallTheme(Command):
shutil.copytree(theme_path, dest_path)
confpypath = os.path.join(dest_path, 'conf.py.sample')
if os.path.exists(confpypath):
- LOGGER.notice('This plugin has a sample config file.')
+ LOGGER.notice('This plugin has a sample config file. Integrate it with yours in order to make this theme work!')
print('Contents of the conf.py.sample file:\n')
with codecs.open(confpypath, 'rb', 'utf-8') as fh:
- print(indent(pygments.highlight(
- fh.read(), PythonLexer(), TerminalFormatter()), 4 * ' '))
- return True
+ if sys.platform == 'win32':
+ print(indent(pygments.highlight(
+ fh.read(), PythonLexer(), TerminalFormatter()),
+ 4 * ' '))
+ else:
+ print(indent(fh.read(), 4 * ' '))
+ return True
diff --git a/nikola/plugins/command/mincss.py b/nikola/plugins/command/mincss.py
index 5c9a7cb..0193458 100644
--- a/nikola/plugins/command/mincss.py
+++ b/nikola/plugins/command/mincss.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/nikola/plugins/command/new_post.py b/nikola/plugins/command/new_post.py
index ea0f3de..a5c551d 100644
--- a/nikola/plugins/command/new_post.py
+++ b/nikola/plugins/command/new_post.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/nikola/plugins/command/orphans.plugin b/nikola/plugins/command/orphans.plugin
new file mode 100644
index 0000000..408578b
--- /dev/null
+++ b/nikola/plugins/command/orphans.plugin
@@ -0,0 +1,10 @@
+[Core]
+Name = orphans
+Module = orphans
+
+[Documentation]
+Author = Roberto Alsina, Chris Warrick
+Version = 0.1
+Website = http://getnikola.com
+Description = List all orphans
+
diff --git a/nikola/plugins/command/orphans.py b/nikola/plugins/command/orphans.py
new file mode 100644
index 0000000..ff114b4
--- /dev/null
+++ b/nikola/plugins/command/orphans.py
@@ -0,0 +1,45 @@
+# -*- coding: utf-8 -*-
+
+# Copyright © 2012-2014 Roberto Alsina, Chris Warrick and others.
+
+# Permission is hereby granted, free of charge, to any
+# person obtaining a copy of this software and associated
+# documentation files (the "Software"), to deal in the
+# Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the
+# Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice
+# shall be included in all copies or substantial portions of
+# the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+# PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
+# OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+from __future__ import print_function
+import os
+
+from nikola.plugin_categories import Command
+from nikola.plugins.command.check import real_scan_files
+
+
+class CommandOrphans(Command):
+ name = "orphans"
+ doc_purpose = "list all orphans"
+ doc_description = """\
+List all orphans, i.e. all files that are in the output directory,
+but are not generated by Nikola.
+
+Output contains filenames only (it is passable to `xargs rm` or the like)."""
+
+ def _execute(self, options, args):
+ orphans = real_scan_files(self.site)[0]
+ print('\n'.join([p for p in orphans if not os.path.isdir(p)]))
diff --git a/nikola/plugins/command/planetoid/__init__.py b/nikola/plugins/command/planetoid/__init__.py
index 369862b..ff5dd13 100644
--- a/nikola/plugins/command/planetoid/__init__.py
+++ b/nikola/plugins/command/planetoid/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/nikola/plugins/command/serve.py b/nikola/plugins/command/serve.py
index 07403d4..2dd15c1 100644
--- a/nikola/plugins/command/serve.py
+++ b/nikola/plugins/command/serve.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/nikola/plugins/command/version.py b/nikola/plugins/command/version.py
index 65896e9..9b42423 100644
--- a/nikola/plugins/command/version.py
+++ b/nikola/plugins/command/version.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -41,4 +41,4 @@ class CommandVersion(Command):
def _execute(self, options={}, args=None):
"""Print the version number."""
- print("Nikola version " + __version__)
+ print("Nikola v" + __version__)
diff --git a/nikola/plugins/compile/__init__.py b/nikola/plugins/compile/__init__.py
index e69de29..6ad8bac 100644
--- a/nikola/plugins/compile/__init__.py
+++ b/nikola/plugins/compile/__init__.py
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+
+# Copyright © 2012-2014 Roberto Alsina and others.
+
+# Permission is hereby granted, free of charge, to any
+# person obtaining a copy of this software and associated
+# documentation files (the "Software"), to deal in the
+# Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the
+# Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice
+# shall be included in all copies or substantial portions of
+# the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+# PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
+# OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/nikola/plugins/compile/asciidoc.py b/nikola/plugins/compile/asciidoc.py
index 67dfe1a..12cb4bf 100644
--- a/nikola/plugins/compile/asciidoc.py
+++ b/nikola/plugins/compile/asciidoc.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -37,11 +37,17 @@ import subprocess
from nikola.plugin_categories import PageCompiler
from nikola.utils import makedirs, req_missing
+try:
+ from collections import OrderedDict
+except ImportError:
+ OrderedDict = None # NOQA
+
class CompileAsciiDoc(PageCompiler):
"""Compile asciidoc into HTML."""
name = "asciidoc"
+ demote_headers = True
def compile_html(self, source, dest, is_two_file=True):
makedirs(os.path.dirname(dest))
@@ -52,7 +58,10 @@ class CompileAsciiDoc(PageCompiler):
req_missing(['asciidoc'], 'build this site (compile with asciidoc)', python=False)
def create_post(self, path, onefile=False, **kw):
- metadata = {}
+ if OrderedDict is not None:
+ metadata = OrderedDict()
+ else:
+ metadata = {}
metadata.update(self.default_metadata)
metadata.update(kw)
makedirs(os.path.dirname(path))
diff --git a/nikola/plugins/compile/bbcode.py b/nikola/plugins/compile/bbcode.py
index e998417..5345be3 100644
--- a/nikola/plugins/compile/bbcode.py
+++ b/nikola/plugins/compile/bbcode.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -37,6 +37,10 @@ except ImportError:
from nikola.plugin_categories import PageCompiler
from nikola.utils import makedirs, req_missing
+try:
+ from collections import OrderedDict
+except ImportError:
+ OrderedDict = None # NOQA
class CompileBbcode(PageCompiler):
@@ -63,7 +67,10 @@ class CompileBbcode(PageCompiler):
out_file.write(output)
def create_post(self, path, onefile=False, **kw):
- metadata = {}
+ if OrderedDict is not None:
+ metadata = OrderedDict()
+ else:
+ metadata = {}
metadata.update(self.default_metadata)
metadata.update(kw)
makedirs(os.path.dirname(path))
diff --git a/nikola/plugins/compile/html.py b/nikola/plugins/compile/html.py
index a309960..5352f00 100644
--- a/nikola/plugins/compile/html.py
+++ b/nikola/plugins/compile/html.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -27,25 +27,40 @@
"""Implementation of compile_html for HTML source files."""
import os
-import shutil
+import re
import codecs
from nikola.plugin_categories import PageCompiler
from nikola.utils import makedirs
+try:
+ from collections import OrderedDict
+except ImportError:
+ OrderedDict = None # NOQA
+
+
+_META_SEPARATOR = '(' + os.linesep * 2 + '|' + ('\n' * 2) + '|' + ("\r\n" * 2) + ')'
+
class CompileHtml(PageCompiler):
"""Compile HTML into HTML."""
-
name = "html"
def compile_html(self, source, dest, is_two_file=True):
makedirs(os.path.dirname(dest))
- shutil.copyfile(source, dest)
+ with codecs.open(dest, "w+", "utf8") as out_file:
+ with codecs.open(source, "r", "utf8") as in_file:
+ data = in_file.read()
+ if not is_two_file:
+ data = re.split(_META_SEPARATOR, data, maxsplit=1)[-1]
+ out_file.write(data)
return True
def create_post(self, path, onefile=False, **kw):
- metadata = {}
+ if OrderedDict is not None:
+ metadata = OrderedDict()
+ else:
+ metadata = {}
metadata.update(self.default_metadata)
metadata.update(kw)
makedirs(os.path.dirname(path))
@@ -55,4 +70,4 @@ class CompileHtml(PageCompiler):
for k, v in metadata.items():
fd.write('.. {0}: {1}\n'.format(k, v))
fd.write('-->\n\n')
- fd.write("\n<p>Write your post here.</p>")
+ fd.write("\n<p>Write your post here.</p>\n")
diff --git a/nikola/plugins/compile/ipynb/__init__.py b/nikola/plugins/compile/ipynb/__init__.py
index 7c318ca..5f2f0b3 100644
--- a/nikola/plugins/compile/ipynb/__init__.py
+++ b/nikola/plugins/compile/ipynb/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2013 Damian Avila.
+# Copyright © 2013-2014 Damián Avila and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -41,6 +41,11 @@ except ImportError:
from nikola.plugin_categories import PageCompiler
from nikola.utils import makedirs, req_missing
+try:
+ from collections import OrderedDict
+except ImportError:
+ OrderedDict = None # NOQA
+
class CompileIPynb(PageCompiler):
"""Compile IPynb into HTML."""
@@ -49,7 +54,7 @@ class CompileIPynb(PageCompiler):
def compile_html(self, source, dest, is_two_file=True):
if flag is None:
- req_missing(['ipython>=1.0.0'], 'build this site (compile ipynb)')
+ req_missing(['ipython>=1.1.0'], 'build this site (compile ipynb)')
makedirs(os.path.dirname(dest))
HTMLExporter.default_template = 'basic'
c = Config(self.site.config['IPYNB_CONFIG'])
@@ -62,18 +67,20 @@ class CompileIPynb(PageCompiler):
out_file.write(body)
def create_post(self, path, onefile=False, **kw):
- metadata = {}
+ if OrderedDict is not None:
+ metadata = OrderedDict()
+ else:
+ metadata = {}
metadata.update(self.default_metadata)
metadata.update(kw)
d_name = os.path.dirname(path)
makedirs(os.path.dirname(path))
meta_path = os.path.join(d_name, kw['slug'] + ".meta")
with codecs.open(meta_path, "wb+", "utf8") as fd:
- if onefile:
- fd.write('%s\n' % kw['title'])
- fd.write('%s\n' % kw['slug'])
- fd.write('%s\n' % kw['date'])
- fd.write('%s\n' % kw['tags'])
+ fd.write('\n'.join((metadata['title'], metadata['slug'],
+ metadata['date'], metadata['tags'],
+ metadata['link'],
+ metadata['description'], metadata['type'])))
print("Your post's metadata is at: ", meta_path)
with codecs.open(path, "wb+", "utf8") as fd:
fd.write("""{
diff --git a/nikola/plugins/compile/markdown/__init__.py b/nikola/plugins/compile/markdown/__init__.py
index b41c6b5..1376b11 100644
--- a/nikola/plugins/compile/markdown/__init__.py
+++ b/nikola/plugins/compile/markdown/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -50,6 +50,12 @@ except ImportError:
gist_extension = None
podcast_extension = None
+
+try:
+ from collections import OrderedDict
+except ImportError:
+ OrderedDict = None # NOQA
+
from nikola.plugin_categories import PageCompiler
from nikola.utils import makedirs, req_missing
@@ -58,6 +64,7 @@ class CompileMarkdown(PageCompiler):
"""Compile markdown into HTML."""
name = "markdown"
+ demote_headers = True
extensions = [gist_extension, nikola_extension, podcast_extension]
site = None
@@ -75,7 +82,10 @@ class CompileMarkdown(PageCompiler):
out_file.write(output)
def create_post(self, path, onefile=False, **kw):
- metadata = {}
+ if OrderedDict is not None:
+ metadata = OrderedDict()
+ else:
+ metadata = {}
metadata.update(self.default_metadata)
metadata.update(kw)
makedirs(os.path.dirname(path))
diff --git a/nikola/plugins/compile/markdown/mdx_gist.py b/nikola/plugins/compile/markdown/mdx_gist.py
index 3c3bef9..d92295d 100644
--- a/nikola/plugins/compile/markdown/mdx_gist.py
+++ b/nikola/plugins/compile/markdown/mdx_gist.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (c) 2013 Michael Rabbitt.
+# Copyright © 2013 Michael Rabbitt.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
diff --git a/nikola/plugins/compile/markdown/mdx_nikola.py b/nikola/plugins/compile/markdown/mdx_nikola.py
index b0ad2f7..b7c29a5 100644
--- a/nikola/plugins/compile/markdown/mdx_nikola.py
+++ b/nikola/plugins/compile/markdown/mdx_nikola.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -34,10 +34,6 @@ from markdown.extensions import Extension
class NikolaPostProcessor(Postprocessor):
def run(self, text):
output = text
- # h1 is reserved for the title so increment all header levels
- for n in reversed(range(1, 9)):
- output = re.sub('<h%i>' % n, '<h%i>' % (n + 1), output)
- output = re.sub('</h%i>' % n, '</h%i>' % (n + 1), output)
# python-markdown's highlighter uses the class 'codehilite' to wrap
# code, instead of the standard 'code'. None of the standard
diff --git a/nikola/plugins/compile/markdown/mdx_podcast.py b/nikola/plugins/compile/markdown/mdx_podcast.py
index be8bb6b..b38b969 100644
--- a/nikola/plugins/compile/markdown/mdx_podcast.py
+++ b/nikola/plugins/compile/markdown/mdx_podcast.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
-# Copyright (c) 2013 Michael Rabbitt, Roberto Alsina
+# Copyright © 2013-2014 Michael Rabbitt, Roberto Alsina and others.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
diff --git a/nikola/plugins/compile/misaka.py b/nikola/plugins/compile/misaka.py
index 3733a85..8777ffc 100644
--- a/nikola/plugins/compile/misaka.py
+++ b/nikola/plugins/compile/misaka.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright (c) 2013 Chris Lee
+# Copyright © 2013-2014 Chris Lee and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -37,6 +37,11 @@ try:
except ImportError:
misaka = None # NOQA
nikola_extension = None
+try:
+ from collections import OrderedDict
+except ImportError:
+ OrderedDict = None # NOQA
+
gist_extension = None
podcast_extension = None
@@ -48,6 +53,7 @@ class CompileMisaka(PageCompiler):
"""Compile Misaka into HTML."""
name = "misaka"
+ demote_headers = True
def __init__(self, *args, **kwargs):
super(CompileMisaka, self).__init__(*args, **kwargs)
@@ -68,7 +74,10 @@ class CompileMisaka(PageCompiler):
out_file.write(output)
def create_post(self, path, onefile=False, **kw):
- metadata = {}
+ if OrderedDict is not None:
+ metadata = OrderedDict()
+ else:
+ metadata = {}
metadata.update(self.default_metadata)
metadata.update(kw)
makedirs(os.path.dirname(path))
diff --git a/nikola/plugins/compile/pandoc.py b/nikola/plugins/compile/pandoc.py
index 3a2911f..57c7d71 100644
--- a/nikola/plugins/compile/pandoc.py
+++ b/nikola/plugins/compile/pandoc.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -37,6 +37,11 @@ import subprocess
from nikola.plugin_categories import PageCompiler
from nikola.utils import req_missing, makedirs
+try:
+ from collections import OrderedDict
+except ImportError:
+ OrderedDict = None # NOQA
+
class CompilePandoc(PageCompiler):
"""Compile markups into HTML using pandoc."""
@@ -52,7 +57,10 @@ class CompilePandoc(PageCompiler):
req_missing(['pandoc'], 'build this site (compile with pandoc)', python=False)
def create_post(self, path, onefile=False, **kw):
- metadata = {}
+ if OrderedDict is not None:
+ metadata = OrderedDict()
+ else:
+ metadata = {}
metadata.update(self.default_metadata)
metadata.update(kw)
makedirs(os.path.dirname(path))
diff --git a/nikola/plugins/compile/php.py b/nikola/plugins/compile/php.py
index 44701c8..14b80e8 100644
--- a/nikola/plugins/compile/php.py
+++ b/nikola/plugins/compile/php.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -35,6 +35,11 @@ import codecs
from nikola.plugin_categories import PageCompiler
from nikola.utils import makedirs
+try:
+ from collections import OrderedDict
+except ImportError:
+ OrderedDict = None # NOQA
+
class CompilePhp(PageCompiler):
"""Compile PHP into PHP."""
@@ -46,7 +51,10 @@ class CompilePhp(PageCompiler):
shutil.copyfile(source, dest)
def create_post(self, path, onefile=False, **kw):
- metadata = {}
+ if OrderedDict is not None:
+ metadata = OrderedDict()
+ else:
+ metadata = {}
metadata.update(self.default_metadata)
metadata.update(kw)
os.makedirs(os.path.dirname(path))
diff --git a/nikola/plugins/compile/rest/__init__.py b/nikola/plugins/compile/rest/__init__.py
index c71a5f8..50b37cf 100644
--- a/nikola/plugins/compile/rest/__init__.py
+++ b/nikola/plugins/compile/rest/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -35,10 +35,16 @@ try:
import docutils.utils
import docutils.io
import docutils.readers.standalone
+ import docutils.writers.html4css1
has_docutils = True
except ImportError:
has_docutils = False
+try:
+ from collections import OrderedDict
+except ImportError:
+ OrderedDict = None # NOQA
+
from nikola.plugin_categories import PageCompiler
from nikola.utils import get_logger, makedirs, req_missing
@@ -47,6 +53,7 @@ class CompileRest(PageCompiler):
"""Compile reSt into HTML."""
name = "rest"
+ demote_headers = True
logger = None
def compile_html(self, source, dest, is_two_file=True):
@@ -71,14 +78,16 @@ class CompileRest(PageCompiler):
# author).
add_ln = len(spl[0].splitlines()) + 1
+ default_template_path = os.path.join(os.path.dirname(__file__), 'template.txt')
output, error_level, deps = rst2html(
data, settings_overrides={
- 'initial_header_level': 2,
+ 'initial_header_level': 1,
'record_dependencies': True,
'stylesheet_path': None,
'link_stylesheet': True,
'syntax_highlight': 'short',
'math_output': 'mathjax',
+ 'template': default_template_path,
}, logger=self.logger, l_source=source, l_add_ln=add_ln)
out_file.write(output)
deps_path = dest + '.dep'
@@ -94,7 +103,10 @@ class CompileRest(PageCompiler):
return False
def create_post(self, path, onefile=False, **kw):
- metadata = {}
+ if OrderedDict is not None:
+ metadata = OrderedDict()
+ else:
+ metadata = {}
metadata.update(self.default_metadata)
metadata.update(kw)
makedirs(os.path.dirname(path))
@@ -117,6 +129,9 @@ class CompileRest(PageCompiler):
plugin_info.plugin_object.short_help = plugin_info.description
self.logger = get_logger('compile_rest', site.loghandlers)
+ if not site.debug:
+ self.logger.level = 4
+
return super(CompileRest, self).set_site(site)
@@ -139,7 +154,10 @@ def get_observer(settings):
"""
errormap = {0: 1, 1: 2, 2: 4, 3: 5, 4: 6}
text = docutils.nodes.Element.astext(msg)
- out = '[{source}:{line}] {text}'.format(source=settings['source'], line=msg['line'] + settings['add_ln'], text=text)
+ line = msg['line'] + settings['add_ln'] if 'line' in msg else 0
+ out = '[{source}{colon}{line}] {text}'.format(
+ source=settings['source'], colon=(':' if line else ''),
+ line=line, text=text)
settings['logger'].log(errormap[msg['level']], out)
return observer
@@ -155,6 +173,14 @@ class NikolaReader(docutils.readers.standalone.Reader):
return document
+def add_node(node, visit_function=None, depart_function=None):
+ docutils.nodes._add_node_class_names([node.__name__])
+ if visit_function:
+ setattr(docutils.writers.html4css1.HTMLTranslator, 'visit_' + node.__name__, visit_function)
+ if depart_function:
+ setattr(docutils.writers.html4css1.HTMLTranslator, 'depart_' + node.__name__, depart_function)
+
+
def rst2html(source, source_path=None, source_class=docutils.io.StringInput,
destination_path=None, reader=None,
parser=None, parser_name='restructuredtext', writer=None,
diff --git a/nikola/plugins/compile/rest/chart.py b/nikola/plugins/compile/rest/chart.py
index ee917b9..03878a3 100644
--- a/nikola/plugins/compile/rest/chart.py
+++ b/nikola/plugins/compile/rest/chart.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/nikola/plugins/compile/rest/doc.py b/nikola/plugins/compile/rest/doc.py
index 915a7e1..a150a81 100644
--- a/nikola/plugins/compile/rest/doc.py
+++ b/nikola/plugins/compile/rest/doc.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/nikola/plugins/compile/rest/listing.py b/nikola/plugins/compile/rest/listing.py
index 31975bb..ecf885f 100644
--- a/nikola/plugins/compile/rest/listing.py
+++ b/nikola/plugins/compile/rest/listing.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/nikola/plugins/compile/rest/media.py b/nikola/plugins/compile/rest/media.py
index d1930dd..ccda559 100644
--- a/nikola/plugins/compile/rest/media.py
+++ b/nikola/plugins/compile/rest/media.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/nikola/plugins/compile/rest/post_list.py b/nikola/plugins/compile/rest/post_list.py
index eae4016..6804b58 100644
--- a/nikola/plugins/compile/rest/post_list.py
+++ b/nikola/plugins/compile/rest/post_list.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2013 Udo Spallek, Roberto Alsina and others.
+# Copyright © 2013-2014 Udo Spallek, Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -33,6 +33,9 @@ from docutils.parsers.rst import Directive, directives
from nikola import utils
from nikola.plugin_categories import RestExtension
+# WARNING: the directive name is post-list
+# (with a DASH instead of an UNDERSCORE)
+
class Plugin(RestExtension):
name = "rest_post_list"
diff --git a/nikola/plugins/compile/rest/slides.py b/nikola/plugins/compile/rest/slides.py
index 41c3314..203ae51 100644
--- a/nikola/plugins/compile/rest/slides.py
+++ b/nikola/plugins/compile/rest/slides.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/nikola/plugins/compile/rest/soundcloud.py b/nikola/plugins/compile/rest/soundcloud.py
index 6fb3e99..a26806c 100644
--- a/nikola/plugins/compile/rest/soundcloud.py
+++ b/nikola/plugins/compile/rest/soundcloud.py
@@ -15,12 +15,13 @@ class Plugin(RestExtension):
def set_site(self, site):
self.site = site
directives.register_directive('soundcloud', SoundCloud)
+ directives.register_directive('soundcloud_playlist', SoundCloudPlaylist)
return super(Plugin, self).set_site(site)
CODE = ("""<iframe width="{width}" height="{height}"
scrolling="no" frameborder="no"
-src="https://w.soundcloud.com/player/?url=http://api.soundcloud.com/tracks/"""
+src="https://w.soundcloud.com/player/?url=http://api.soundcloud.com/{preslug}/"""
"""{sid}">
</iframe>""")
@@ -40,6 +41,7 @@ class SoundCloud(Directive):
'width': directives.positive_int,
'height': directives.positive_int,
}
+ preslug = "tracks"
def run(self):
""" Required by the Directive interface. Create docutils nodes """
@@ -48,6 +50,7 @@ class SoundCloud(Directive):
'sid': self.arguments[0],
'width': 600,
'height': 160,
+ 'preslug': self.preslug,
}
options.update(self.options)
return [nodes.raw('', CODE.format(**options), format='html')]
@@ -58,3 +61,7 @@ class SoundCloud(Directive):
raise self.warning("This directive does not accept content. The "
"'key=value' format for options is deprecated, "
"use ':key: value' instead")
+
+
+class SoundCloudPlaylist(SoundCloud):
+ preslug = "playlists"
diff --git a/nikola/plugins/compile/rest/template.txt b/nikola/plugins/compile/rest/template.txt
new file mode 100644
index 0000000..2591bce
--- /dev/null
+++ b/nikola/plugins/compile/rest/template.txt
@@ -0,0 +1,8 @@
+%(head_prefix)s
+%(head)s
+%(stylesheet)s
+%(body_prefix)s
+%(body_pre_docinfo)s
+%(docinfo)s
+%(body)s
+%(body_suffix)s
diff --git a/nikola/plugins/compile/rest/vimeo.py b/nikola/plugins/compile/rest/vimeo.py
index 6d66648..82c4dc1 100644
--- a/nikola/plugins/compile/rest/vimeo.py
+++ b/nikola/plugins/compile/rest/vimeo.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/nikola/plugins/compile/rest/youtube.py b/nikola/plugins/compile/rest/youtube.py
index 3d4bdd3..19e12d1 100644
--- a/nikola/plugins/compile/rest/youtube.py
+++ b/nikola/plugins/compile/rest/youtube.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/nikola/plugins/compile/textile.py b/nikola/plugins/compile/textile.py
index b402329..73f35c0 100644
--- a/nikola/plugins/compile/textile.py
+++ b/nikola/plugins/compile/textile.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -38,11 +38,17 @@ except ImportError:
from nikola.plugin_categories import PageCompiler
from nikola.utils import makedirs, req_missing
+try:
+ from collections import OrderedDict
+except ImportError:
+ OrderedDict = None # NOQA
+
class CompileTextile(PageCompiler):
"""Compile textile into HTML."""
name = "textile"
+ demote_headers = True
def compile_html(self, source, dest, is_two_file=True):
if textile is None:
@@ -57,7 +63,10 @@ class CompileTextile(PageCompiler):
out_file.write(output)
def create_post(self, path, onefile=False, **kw):
- metadata = {}
+ if OrderedDict is not None:
+ metadata = OrderedDict()
+ else:
+ metadata = {}
metadata.update(self.default_metadata)
metadata.update(kw)
makedirs(os.path.dirname(path))
diff --git a/nikola/plugins/compile/txt2tags.py b/nikola/plugins/compile/txt2tags.py
index 2f62f04..8c9724e 100644
--- a/nikola/plugins/compile/txt2tags.py
+++ b/nikola/plugins/compile/txt2tags.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -40,14 +40,20 @@ try:
except ImportError:
txt2tags = None # NOQA
+try:
+ from collections import OrderedDict
+except ImportError:
+ OrderedDict = None # NOQA
+
from nikola.plugin_categories import PageCompiler
from nikola.utils import makedirs, req_missing
-class CompileTextile(PageCompiler):
+class CompileTxt2tags(PageCompiler):
"""Compile txt2tags into HTML."""
name = "txt2tags"
+ demote_headers = True
def compile_html(self, source, dest, is_two_file=True):
if txt2tags is None:
@@ -57,7 +63,10 @@ class CompileTextile(PageCompiler):
txt2tags(cmd)
def create_post(self, path, onefile=False, **kw):
- metadata = {}
+ if OrderedDict is not None:
+ metadata = OrderedDict()
+ else:
+ metadata = {}
metadata.update(self.default_metadata)
metadata.update(kw)
makedirs(os.path.dirname(path))
diff --git a/nikola/plugins/compile/wiki.py b/nikola/plugins/compile/wiki.py
index b2c4afc..9a365fa 100644
--- a/nikola/plugins/compile/wiki.py
+++ b/nikola/plugins/compile/wiki.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -37,6 +37,11 @@ except ImportError:
creole = None
from nikola.plugin_categories import PageCompiler
+try:
+ from collections import OrderedDict
+except ImportError:
+ OrderedDict = None # NOQA
+
from nikola.utils import makedirs, req_missing
@@ -44,6 +49,7 @@ class CompileWiki(PageCompiler):
"""Compile CreoleWiki into HTML."""
name = "wiki"
+ demote_headers = True
def compile_html(self, source, dest, is_two_file=True):
if creole is None:
@@ -57,7 +63,10 @@ class CompileWiki(PageCompiler):
out_file.write(output)
def create_post(self, path, onefile=False, **kw):
- metadata = {}
+ if OrderedDict is not None:
+ metadata = OrderedDict()
+ else:
+ metadata = {}
metadata.update(self.default_metadata)
metadata.update(kw)
makedirs(os.path.dirname(path))
diff --git a/nikola/plugins/loghandler/__init__.py b/nikola/plugins/loghandler/__init__.py
new file mode 100644
index 0000000..6ad8bac
--- /dev/null
+++ b/nikola/plugins/loghandler/__init__.py
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+
+# Copyright © 2012-2014 Roberto Alsina and others.
+
+# Permission is hereby granted, free of charge, to any
+# person obtaining a copy of this software and associated
+# documentation files (the "Software"), to deal in the
+# Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the
+# Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice
+# shall be included in all copies or substantial portions of
+# the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+# PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
+# OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/nikola/plugins/loghandler/smtp.py b/nikola/plugins/loghandler/smtp.py
index deb8f4e..2c9fd9c 100644
--- a/nikola/plugins/loghandler/smtp.py
+++ b/nikola/plugins/loghandler/smtp.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Daniel Devine and others.
+# Copyright © 2012-2014 Daniel Devine and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/nikola/plugins/loghandler/stderr.py b/nikola/plugins/loghandler/stderr.py
index 71f1de5..75acffc 100644
--- a/nikola/plugins/loghandler/stderr.py
+++ b/nikola/plugins/loghandler/stderr.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Daniel Devine and others.
+# Copyright © 2012-2014 Daniel Devine and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -29,6 +29,8 @@ from blinker import signal
import logbook
import os
+from nikola import DEBUG
+
class StderrHandler(SignalHandler):
"""Logs messages to stderr."""
@@ -39,7 +41,7 @@ class StderrHandler(SignalHandler):
conf = self.site.config.get('LOGGING_HANDLERS').get('stderr')
if conf or os.getenv('NIKOLA_DEBUG'):
self.site.loghandlers.append(logbook.StderrHandler(
- level='DEBUG' if os.getenv('NIKOLA_DEBUG') else conf.get('loglevel', 'WARNING').upper(),
+ level='DEBUG' if DEBUG else conf.get('loglevel', 'WARNING').upper(),
format_string=u'[{record.time:%Y-%m-%dT%H:%M:%SZ}] {record.level_name}: {record.channel}: {record.message}'
))
diff --git a/nikola/plugins/task/__init__.py b/nikola/plugins/task/__init__.py
index e69de29..6ad8bac 100644
--- a/nikola/plugins/task/__init__.py
+++ b/nikola/plugins/task/__init__.py
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+
+# Copyright © 2012-2014 Roberto Alsina and others.
+
+# Permission is hereby granted, free of charge, to any
+# person obtaining a copy of this software and associated
+# documentation files (the "Software"), to deal in the
+# Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the
+# Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice
+# shall be included in all copies or substantial portions of
+# the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+# PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
+# OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/nikola/plugins/task/archive.py b/nikola/plugins/task/archive.py
index 3afbea1..a65a63f 100644
--- a/nikola/plugins/task/archive.py
+++ b/nikola/plugins/task/archive.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -92,7 +92,8 @@ class Archive(Task):
kw['filters'],
context,
)
- task_cfg = {1: task['uptodate'][0].config, 2: kw}
+ n = len(post_list) if 'posts' in context else len(months)
+ task_cfg = {1: task['uptodate'][0].config, 2: kw, 3: n}
task['uptodate'] = [config_changed(task_cfg)]
task['basename'] = self.name
yield task
@@ -123,7 +124,7 @@ class Archive(Task):
kw['filters'],
context,
)
- task_cfg = {1: task['uptodate'][0].config, 2: kw}
+ task_cfg = {1: task['uptodate'][0].config, 2: kw, 3: len(post_list)}
task['uptodate'] = [config_changed(task_cfg)]
task['basename'] = self.name
yield task
@@ -151,7 +152,7 @@ class Archive(Task):
kw['filters'],
context,
)
- task_cfg = {1: task['uptodate'][0].config, 2: kw}
+ task_cfg = {1: task['uptodate'][0].config, 2: kw, 3: len(years)}
task['uptodate'] = [config_changed(task_cfg)]
task['basename'] = self.name
yield task
diff --git a/nikola/plugins/task/build_less.py b/nikola/plugins/task/build_less.py
index 8889cbe..14a53f9 100644
--- a/nikola/plugins/task/build_less.py
+++ b/nikola/plugins/task/build_less.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -29,6 +29,7 @@ from __future__ import unicode_literals
import codecs
import glob
import os
+import sys
import subprocess
from nikola.plugin_categories import Task
@@ -41,10 +42,10 @@ class BuildLess(Task):
name = "build_less"
sources_folder = "less"
sources_ext = ".less"
- compiler_name = "lessc"
def gen_tasks(self):
"""Generate CSS out of LESS sources."""
+ self.compiler_name = self.site.config['LESS_COMPILER']
kw = {
'cache_folder': self.site.config['CACHE_FOLDER'],
@@ -79,7 +80,13 @@ class BuildLess(Task):
def compile_target(target, dst):
utils.makedirs(dst_dir)
src = os.path.join(kw['cache_folder'], self.sources_folder, target)
- compiled = subprocess.check_output([self.compiler_name, src])
+ run_in_shell = sys.platform == 'win32'
+ try:
+ compiled = subprocess.check_output([self.compiler_name, src], shell=run_in_shell)
+ except OSError:
+ utils.req_missing([self.compiler_name],
+ 'build LESS files (and use this theme)',
+ False, False)
with open(dst, "wb+") as outf:
outf.write(compiled)
diff --git a/nikola/plugins/task/build_sass.py b/nikola/plugins/task/build_sass.py
index a5d22fb..7575505 100644
--- a/nikola/plugins/task/build_sass.py
+++ b/nikola/plugins/task/build_sass.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -29,6 +29,7 @@ from __future__ import unicode_literals
import codecs
import glob
import os
+import sys
import subprocess
from nikola.plugin_categories import Task
@@ -41,11 +42,11 @@ class BuildSass(Task):
name = "build_sass"
sources_folder = "sass"
sources_ext = (".sass", ".scss")
- compiler_name = "sass"
def gen_tasks(self):
"""Generate CSS out of Sass sources."""
self.logger = utils.get_logger('build_sass', self.site.loghandlers)
+ self.compiler_name = self.site.config['SASS_COMPILER']
kw = {
'cache_folder': self.site.config['CACHE_FOLDER'],
@@ -79,8 +80,14 @@ class BuildSass(Task):
def compile_target(target, dst):
utils.makedirs(dst_dir)
+ run_in_shell = sys.platform == 'win32'
src = os.path.join(kw['cache_folder'], self.sources_folder, target)
- compiled = subprocess.check_output([self.compiler_name, src])
+ try:
+ compiled = subprocess.check_output([self.compiler_name, src], shell=run_in_shell)
+ except OSError:
+ utils.req_missing([self.compiler_name],
+ 'build Sass files (and use this theme)',
+ False, False)
with open(dst, "wb+") as outf:
outf.write(compiled)
@@ -99,7 +106,7 @@ class BuildSass(Task):
if base in seennames:
self.logger.error(
- 'Duplicate filenames for SASS compiled files: {0} and '
+ 'Duplicate filenames for Sass compiled files: {0} and '
'{1} (both compile to {2})'.format(
seennames[base], target, base + ".css"))
else:
diff --git a/nikola/plugins/task/bundles.py b/nikola/plugins/task/bundles.py
index 488f96f..b035b97 100644
--- a/nikola/plugins/task/bundles.py
+++ b/nikola/plugins/task/bundles.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -44,7 +44,9 @@ class BuildBundles(LateTask):
def set_site(self, site):
super(BuildBundles, self).set_site(site)
- if webassets is None:
+ if webassets is None and self.site.config['USE_BUNDLES']:
+ utils.req_missing(['webassets'], 'USE_BUNDLES', optional=True)
+ utils.LOGGER.warn('Setting USE_BUNDLES to False.')
self.site.config['USE_BUNDLES'] = False
def gen_tasks(self):
@@ -111,6 +113,6 @@ def get_theme_bundles(themes):
for line in fd:
name, files = line.split('=')
files = [f.strip() for f in files.split(',')]
- bundles[name.strip()] = files
+ bundles[name.strip().replace('/', os.sep)] = files
break
return bundles
diff --git a/nikola/plugins/task/copy_assets.py b/nikola/plugins/task/copy_assets.py
index f3d85df..21f1f85 100644
--- a/nikola/plugins/task/copy_assets.py
+++ b/nikola/plugins/task/copy_assets.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/nikola/plugins/task/copy_files.py b/nikola/plugins/task/copy_files.py
index 88e89eb..9846ca0 100644
--- a/nikola/plugins/task/copy_files.py
+++ b/nikola/plugins/task/copy_files.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/nikola/plugins/task/galleries.py b/nikola/plugins/task/galleries.py
index cf670e0..6977eab 100644
--- a/nikola/plugins/task/galleries.py
+++ b/nikola/plugins/task/galleries.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -51,6 +51,7 @@ import PyRSS2Gen as rss
from nikola.plugin_categories import Task
from nikola import utils
from nikola.post import Post
+from nikola.utils import req_missing
class Galleries(Task):
@@ -77,6 +78,9 @@ class Galleries(Task):
def gen_tasks(self):
"""Render image galleries."""
+ if Image is None:
+ req_missing(['pillow'], 'render galleries')
+
self.logger = utils.get_logger('render_galleries', self.site.loghandlers)
self.image_ext_list = ['.jpg', '.png', '.jpeg', '.gif', '.svg', '.bmp', '.tiff']
self.image_ext_list.extend(self.site.config.get('EXTRA_IMAGE_EXTENSIONS', []))
@@ -111,7 +115,7 @@ class Galleries(Task):
for gallery in self.gallery_list:
# Create subfolder list
- folder_list = [x.split(os.sep)[-2] for x in
+ folder_list = [(x, x.split(os.sep)[-2]) for x in
glob.glob(os.path.join(gallery, '*') + os.sep)]
# Parse index into a post (with translations)
@@ -137,7 +141,7 @@ class Galleries(Task):
for task in self.remove_excluded_image(image):
yield task
- crumbs = utils.get_crumbs(gallery)
+ crumbs = utils.get_crumbs(gallery, index_folder=self)
# Create index.html for each language
for lang in self.kw['translations']:
@@ -173,9 +177,20 @@ class Galleries(Task):
thumbs = ['.thumbnail'.join(os.path.splitext(p)) for p in image_list]
thumbs = [os.path.join(self.kw['output_folder'], t) for t in thumbs]
+ folders = []
+
+ # Generate friendly gallery names
+ for path, folder in folder_list:
+ fpost = self.parse_index(path)
+ if fpost:
+ ft = fpost.title(lang) or folder
+ else:
+ ft = folder
+ folders.append((folder, ft))
+
## TODO: in v7 remove images from context, use photo_array
context["images"] = list(zip(image_name_list, thumbs, img_titles))
- context["folders"] = folder_list
+ context["folders"] = folders
context["crumbs"] = crumbs
context["permalink"] = self.site.link(
"gallery", os.path.basename(gallery), lang)
@@ -288,8 +303,14 @@ class Galleries(Task):
False,
self.site.MESSAGES,
'story.tmpl',
- self.site.get_compiler(index_path).compile_html
+ self.site.get_compiler(index_path)
)
+ # If this did not exist, galleries without a title in the
+ # index.txt file would be errorneously named `index`
+ # (warning: galleries titled index and filenamed differently
+ # may break)
+ if post.title == 'index':
+ post.title = os.path.split(gallery)[1]
else:
post = None
return post
@@ -460,7 +481,7 @@ class Galleries(Task):
os.path.join(
self.site.config['OUTPUT_FOLDER'], img)).st_size
args = {
- 'title': full_title.split('"')[-2],
+ 'title': full_title.split('"')[-2] if full_title else '',
'link': make_url(img),
'guid': rss.Guid(img, False),
'pubDate': self.image_date(img),
@@ -477,7 +498,7 @@ class Galleries(Task):
description='',
lastBuildDate=datetime.datetime.now(),
items=items,
- generator='nikola',
+ generator='Nikola <http://getnikola.com/>',
language=lang
)
rss_obj.self_url = make_url(permalink)
@@ -523,8 +544,9 @@ class Galleries(Task):
try:
im.thumbnail(size, Image.ANTIALIAS)
im.save(dst)
- except Exception:
- self.logger.warn("Can't thumbnail {0}, using original image as thumbnail".format(src))
+ except Exception as e:
+ self.logger.warn("Can't thumbnail {0}, using original "
+ "image as thumbnail ({1})".format(src, e))
utils.copy_file(src, dst)
else: # Image is small
utils.copy_file(src, dst)
diff --git a/nikola/plugins/task/gzip.py b/nikola/plugins/task/gzip.py
index 738d52c..bcc9637 100644
--- a/nikola/plugins/task/gzip.py
+++ b/nikola/plugins/task/gzip.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/nikola/plugins/task/indexes.py b/nikola/plugins/task/indexes.py
index 0d20422..3f45161 100644
--- a/nikola/plugins/task/indexes.py
+++ b/nikola/plugins/task/indexes.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -57,6 +57,7 @@ class Indexes(Task):
"hide_untranslated_posts": self.site.config['HIDE_UNTRANSLATED_POSTS'],
"indexes_title": self.site.config['INDEXES_TITLE'],
"indexes_pages": self.site.config['INDEXES_PAGES'],
+ "indexes_pages_main": self.site.config['INDEXES_PAGES_MAIN'],
"blog_title": self.site.config["BLOG_TITLE"],
}
@@ -78,12 +79,18 @@ class Indexes(Task):
for i, post_list in enumerate(lists):
context = {}
indexes_title = kw['indexes_title'] or kw['blog_title']
+ if kw["indexes_pages_main"]:
+ ipages_i = i + 1
+ ipages_msg = "page %d"
+ else:
+ ipages_i = i
+ ipages_msg = "old posts, page %d"
if kw["indexes_pages"]:
- indexes_pages = kw["indexes_pages"] % i
+ indexes_pages = kw["indexes_pages"] % ipages_i
else:
indexes_pages = " (" + \
- kw["messages"][lang]["old posts page %d"] % i + ")"
- if i > 0:
+ kw["messages"][lang][ipages_msg] % ipages_i + ")"
+ if i > 0 or kw["indexes_pages_main"]:
context["title"] = indexes_title + indexes_pages
else:
context["title"] = indexes_title
diff --git a/nikola/plugins/task/listings.py b/nikola/plugins/task/listings.py
index ab62e74..d8ed43b 100644
--- a/nikola/plugins/task/listings.py
+++ b/nikola/plugins/task/listings.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/nikola/plugins/task/localsearch/__init__.py b/nikola/plugins/task/localsearch/__init__.py
index 9162604..c501d80 100644
--- a/nikola/plugins/task/localsearch/__init__.py
+++ b/nikola/plugins/task/localsearch/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/nikola/plugins/task/mustache/__init__.py b/nikola/plugins/task/mustache/__init__.py
index c392e3b..5be98f0 100644
--- a/nikola/plugins/task/mustache/__init__.py
+++ b/nikola/plugins/task/mustache/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -31,7 +31,9 @@ import json
import os
from nikola.plugin_categories import Task
-from nikola.utils import config_changed, copy_file, unicode_str, makedirs
+from nikola.utils import (
+ config_changed, copy_file, LocaleBorg, makedirs, unicode_str,
+)
class Mustache(Task):
@@ -106,7 +108,7 @@ class Mustache(Task):
})
# Comments
- context = dict(post=post, lang=self.site.current_lang())
+ context = dict(post=post, lang=LocaleBorg().current_lang)
context.update(self.site.GLOBAL_CONTEXT)
data["comment_html"] = self.site.template_system.render_template(
'mustache-comment-form.tmpl', None, context).strip()
diff --git a/nikola/plugins/task/pages.py b/nikola/plugins/task/pages.py
index eb5b49e..f4c0469 100644
--- a/nikola/plugins/task/pages.py
+++ b/nikola/plugins/task/pages.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/nikola/plugins/task/posts.py b/nikola/plugins/task/posts.py
index 18d61b8..a502b81 100644
--- a/nikola/plugins/task/posts.py
+++ b/nikola/plugins/task/posts.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/nikola/plugins/task/redirect.py b/nikola/plugins/task/redirect.py
index ade878a..6fafd13 100644
--- a/nikola/plugins/task/redirect.py
+++ b/nikola/plugins/task/redirect.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/nikola/plugins/task/rss.py b/nikola/plugins/task/rss.py
index bcca4da..e5f7548 100644
--- a/nikola/plugins/task/rss.py
+++ b/nikola/plugins/task/rss.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/nikola/plugins/task/sitemap/__init__.py b/nikola/plugins/task/sitemap/__init__.py
index f34bc0a..0164000 100644
--- a/nikola/plugins/task/sitemap/__init__.py
+++ b/nikola/plugins/task/sitemap/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/nikola/plugins/task/sources.py b/nikola/plugins/task/sources.py
index 672f354..2324af2 100644
--- a/nikola/plugins/task/sources.py
+++ b/nikola/plugins/task/sources.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -66,7 +66,7 @@ class Sources(Task):
if dest_ext == post.source_ext():
continue
if lang != kw["default_lang"]:
- source_lang = source + '.' + lang
+ source_lang = utils.get_translation_candidate(self.site.config, source, lang)
if os.path.exists(source_lang):
source = source_lang
if os.path.isfile(source):
diff --git a/nikola/plugins/task/tags.py b/nikola/plugins/task/tags.py
index 299dca4..a2444ec 100644
--- a/nikola/plugins/task/tags.py
+++ b/nikola/plugins/task/tags.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -110,8 +110,14 @@ class RenderTags(Task):
# Tag cloud json file
tag_cloud_data = {}
for tag, posts in self.site.posts_per_tag.items():
+ tag_posts = dict(posts=[{'title': post.meta[post.default_lang]['title'],
+ 'date': post.date.strftime('%m/%d/%Y'),
+ 'isodate': post.date.isoformat(),
+ 'url': post.base_path.replace('cache', '')}
+ for post in reversed(sorted(self.site.timeline, key=lambda post: post.date))
+ if tag in post.alltags])
tag_cloud_data[tag] = [len(posts), self.site.link(
- 'tag', tag, self.site.config['DEFAULT_LANG'])]
+ 'tag', tag, self.site.config['DEFAULT_LANG']), tag_posts]
output_name = os.path.join(kw['output_folder'],
'assets', 'js', 'tag_cloud_data.json')
@@ -124,6 +130,7 @@ class RenderTags(Task):
'basename': str(self.name),
'name': str(output_name)
}
+
task['uptodate'] = [utils.config_changed(tag_cloud_data)]
task['targets'] = [output_name]
task['actions'] = [(write_tag_data, [tag_cloud_data])]
@@ -189,7 +196,7 @@ class RenderTags(Task):
return name
# FIXME: deduplicate this with render_indexes
- template_name = "index.tmpl"
+ template_name = "tagindex.tmpl"
# Split in smaller lists
lists = []
while post_list:
diff --git a/nikola/plugins/template/__init__.py b/nikola/plugins/template/__init__.py
index e69de29..6ad8bac 100644
--- a/nikola/plugins/template/__init__.py
+++ b/nikola/plugins/template/__init__.py
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+
+# Copyright © 2012-2014 Roberto Alsina and others.
+
+# Permission is hereby granted, free of charge, to any
+# person obtaining a copy of this software and associated
+# documentation files (the "Software"), to deal in the
+# Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the
+# Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice
+# shall be included in all copies or substantial portions of
+# the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+# PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
+# OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/nikola/plugins/template/jinja.py b/nikola/plugins/template/jinja.py
index a40a476..17c33d4 100644
--- a/nikola/plugins/template/jinja.py
+++ b/nikola/plugins/template/jinja.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -55,7 +55,7 @@ class JinjaTemplates(TemplateSystem):
self.lookup.globals['enumerate'] = enumerate
def set_directories(self, directories, cache_folder):
- """Createa template lookup."""
+ """Create a template lookup."""
if jinja2 is None:
req_missing(['jinja2'], 'use this theme')
self.lookup.loader = jinja2.FileSystemLoader(directories,
@@ -74,9 +74,8 @@ class JinjaTemplates(TemplateSystem):
return output
def render_template_to_string(self, template, context):
- """ Render template to a string using context. """
-
- return jinja2.Template(template).render(**context)
+ """Render template to a string using context."""
+ return self.lookup.from_string(template).render(**context)
def template_deps(self, template_name):
# Cache the lists of dependencies for each template name.
diff --git a/nikola/plugins/template/mako.py b/nikola/plugins/template/mako.py
index ae51cac..45f4335 100644
--- a/nikola/plugins/template/mako.py
+++ b/nikola/plugins/template/mako.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/nikola/post.py b/nikola/post.py
index a41901d..810474b 100644
--- a/nikola/post.py
+++ b/nikola/post.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -54,6 +54,8 @@ from .utils import (
slugify,
to_datetime,
unicode_str,
+ demote_headers,
+ get_translation_candidate,
)
from .rc4 import rc4
@@ -83,11 +85,11 @@ class Post(object):
the meta file, as well as any translations available, and
the .html fragment file path.
"""
- self.compiler = compiler
self.config = config
- tzinfo = None
- if self.config['TIMEZONE'] is not None:
- tzinfo = pytz.timezone(self.config['TIMEZONE'])
+ self.compiler = compiler
+ self.compile_html = self.compiler.compile_html
+ self.demote_headers = self.compiler.demote_headers and self.config['DEMOTE_HEADERS']
+ tzinfo = pytz.timezone(self.config['TIMEZONE'])
if self.config['FUTURE_IS_NOW']:
self.current_time = None
else:
@@ -127,7 +129,7 @@ class Post(object):
# Load internationalized metadata
for lang in self.translations:
if lang != self.default_lang:
- if os.path.isfile(self.source_path + "." + lang):
+ if os.path.isfile(get_translation_candidate(self.config, self.source_path, lang)):
self.translated_to.add(lang)
meta = defaultdict(lambda: '')
@@ -146,11 +148,7 @@ class Post(object):
if 'date' not in default_metadata and not use_in_feeds:
# For stories we don't *really* need a date
default_metadata['date'] = datetime.datetime.utcfromtimestamp(
- os.stat(self.source_path).st_ctime)
-
- if tzinfo:
- default_metadata['date'] = default_metadata['date'].replace(
- tzinfo=pytz.UTC).astimezone(tzinfo)
+ os.stat(self.source_path).st_ctime).replace(tzinfo=pytz.UTC).astimezone(tzinfo)
if 'title' not in default_metadata or 'slug' not in default_metadata \
or 'date' not in default_metadata:
@@ -161,7 +159,11 @@ class Post(object):
default_metadata.get('date', None),
source_path))
- # If timezone is set, build localized datetime.
+ if 'type' not in default_metadata:
+ # default value is 'text'
+ default_metadata['type'] = 'text'
+
+ # If time zone is set, build localized datetime.
self.date = to_datetime(self.meta[self.default_lang]['date'], tzinfo)
self.publish_later = False if self.current_time is None else self.date >= self.current_time
@@ -185,6 +187,7 @@ class Post(object):
# While draft comes from the tags, it's not really a tag
self.is_draft = is_draft
self.is_retired = is_retired
+ self.is_post = use_in_feeds
self.use_in_feeds = use_in_feeds and not is_draft and not is_retired \
and not self.publish_later
@@ -253,15 +256,6 @@ class Post(object):
def template_name(self):
return self.meta('template') or self._template_name
- def _add_old_metadata(self):
- # Compatibility for themes up to Nikola 5.4.1
- # TODO: remove before Nikola 6
- self.pagenames = {}
- self.titles = {}
- for lang in self.translations:
- self.pagenames[lang] = self.meta[lang]['slug']
- self.titles[lang] = self.meta[lang]['title']
-
def formatted_date(self, date_format):
"""Return the formatted date, as unicode."""
fmt_date = self.date.strftime(date_format)
@@ -292,7 +286,7 @@ class Post(object):
if self.default_lang in self.translated_to:
deps.append(self.base_path)
if lang != self.default_lang:
- deps += [self.base_path + "." + lang]
+ deps += [get_translation_candidate(self.config, self.base_path, lang)]
deps += self.fragment_deps(lang)
return deps
@@ -312,7 +306,7 @@ class Post(object):
if not self.is_translation_available(lang) and self.config['HIDE_UNTRANSLATED_POSTS']:
return
else:
- self.compiler(
+ self.compile_html(
self.translated_source_path(lang),
dest,
self.is_two_file),
@@ -333,11 +327,11 @@ class Post(object):
if os.path.isfile(dep_path):
with codecs.open(dep_path, 'rb+', 'utf8') as depf:
deps.extend([l.strip() for l in depf.readlines()])
+ lang_deps = []
if lang != self.default_lang:
- lang_deps = list(filter(os.path.exists, [x + "." + lang for x in
- deps]))
+ lang_deps = [get_translation_candidate(self.config, d, lang) for d in deps]
deps += lang_deps
- return deps
+ return [d for d in deps if os.path.exists(d)]
def is_translation_available(self, lang):
"""Return true if the translation actually exists."""
@@ -349,18 +343,18 @@ class Post(object):
if lang == self.default_lang:
return self.source_path
else:
- return '.'.join((self.source_path, lang))
+ return get_translation_candidate(self.config, self.source_path, lang)
elif lang != self.default_lang:
return self.source_path
else:
- return '.'.join((self.source_path, sorted(self.translated_to)[0]))
+ return get_translation_candidate(self.config, self.source_path, sorted(self.translated_to)[0])
def translated_base_path(self, lang):
"""Return path to the translation's base_path file."""
if lang == self.default_lang:
return self.base_path
else:
- return '.'.join((self.base_path, lang))
+ return get_translation_candidate(self.config, self.base_path, lang)
def _translated_file_path(self, lang):
"""Return path to the translation's file, or to the original."""
@@ -368,11 +362,11 @@ class Post(object):
if lang == self.default_lang:
return self.base_path
else:
- return '.'.join((self.base_path, lang))
+ return get_translation_candidate(self.config, self.base_path, lang)
elif lang != self.default_lang:
return self.base_path
else:
- return '.'.join((self.base_path, sorted(self.translated_to)[0]))
+ return get_translation_candidate(self.config, self.base_path, sorted(self.translated_to)[0])
def text(self, lang=None, teaser_only=False, strip_html=False, really_absolute=False):
"""Read the post file for that language and return its contents.
@@ -438,6 +432,16 @@ class Post(object):
data = content.text_content().strip() # No whitespace wanted.
except lxml.etree.ParserError:
data = ""
+ elif data:
+ if self.demote_headers:
+ # see above
+ try:
+ document = lxml.html.fromstring(data)
+ demote_headers(document, self.demote_headers)
+ data = lxml.html.tostring(document, encoding='unicode')
+ except lxml.etree.ParserError:
+ pass
+
return data
@property
@@ -536,11 +540,13 @@ def _get_metadata_from_filename_by_regex(filename, metadata_regexp):
return meta
-def get_metadata_from_file(source_path, lang=None):
+def get_metadata_from_file(source_path, config=None, lang=None):
"""Extracts metadata from the file itself, by parsing contents."""
try:
- if lang:
- source_path = "{0}.{1}".format(source_path, lang)
+ if lang and config:
+ source_path = get_translation_candidate(config, source_path, lang)
+ elif lang:
+ source_path += '.' + lang
with codecs.open(source_path, "r", "utf8") as meta_file:
meta_data = [x.strip() for x in meta_file.readlines()]
return _get_metadata_from_file(meta_data)
@@ -601,18 +607,20 @@ def _get_metadata_from_file(meta_data):
return meta
-def get_metadata_from_meta_file(path, lang=None):
+def get_metadata_from_meta_file(path, config=None, lang=None):
"""Takes a post path, and gets data from a matching .meta file."""
meta_path = os.path.splitext(path)[0] + '.meta'
- if lang:
+ if lang and config:
+ meta_path = get_translation_candidate(config, meta_path, lang)
+ elif lang:
meta_path += '.' + lang
if os.path.isfile(meta_path):
with codecs.open(meta_path, "r", "utf8") as meta_file:
meta_data = meta_file.readlines()
- while len(meta_data) < 6:
+ while len(meta_data) < 7:
meta_data.append("")
- (title, slug, date, tags, link, description) = [
- x.strip() for x in meta_data][:6]
+ (title, slug, date, tags, link, description, _type) = [
+ x.strip() for x in meta_data][:7]
meta = {}
@@ -628,6 +636,8 @@ def get_metadata_from_meta_file(path, lang=None):
meta['link'] = link
if description:
meta['description'] = description
+ if _type:
+ meta['type'] = _type
return meta
@@ -635,7 +645,7 @@ def get_metadata_from_meta_file(path, lang=None):
# Metadata file doesn't exist, but not default language,
# So, if default language metadata exists, return that.
# This makes the 2-file format detection more reliable (Issue #525)
- return get_metadata_from_meta_file(path, lang=None)
+ return get_metadata_from_meta_file(path, config, lang=None)
else:
return {}
@@ -650,7 +660,12 @@ def get_meta(post, file_metadata_regexp=None, lang=None):
"""
meta = defaultdict(lambda: '')
- meta.update(get_metadata_from_meta_file(post.metadata_path, lang))
+ try:
+ config = post.config
+ except AttributeError:
+ config = None
+
+ meta.update(get_metadata_from_meta_file(post.metadata_path, config, lang))
if meta:
return meta
@@ -660,7 +675,7 @@ def get_meta(post, file_metadata_regexp=None, lang=None):
meta.update(_get_metadata_from_filename_by_regex(post.source_path,
file_metadata_regexp))
- meta.update(get_metadata_from_file(post.source_path, lang))
+ meta.update(get_metadata_from_file(post.source_path, config, lang))
if lang is None:
# Only perform these checks for the default language
diff --git a/nikola/rc4.py b/nikola/rc4.py
index fe2ab17..b46d602 100644
--- a/nikola/rc4.py
+++ b/nikola/rc4.py
@@ -1,5 +1,7 @@
# -*- coding: utf-8 -*-
"""
+ A RC4 encryption library (used for password-protected posts)
+ ---
Copyright (C) 2012 Bo Zhu http://about.bozhu.me
Permission is hereby granted, free of charge, to any person obtaining a
diff --git a/nikola/utils.py b/nikola/utils.py
index 0a615f8..0c3b4c0 100644
--- a/nikola/utils.py
+++ b/nikola/utils.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
@@ -50,6 +50,8 @@ import logbook
from logbook.more import ExceptionHandler
import pytz
+from . import DEBUG
+
class ApplicationWarning(Exception):
pass
@@ -67,13 +69,13 @@ def get_logger(name, handlers):
STDERR_HANDLER = [logbook.StderrHandler(
- level=logbook.NOTICE if not os.getenv('NIKOLA_DEBUG') else logbook.DEBUG,
+ level=logbook.NOTICE if not DEBUG else logbook.DEBUG,
format_string=u'[{record.time:%Y-%m-%dT%H:%M:%SZ}] {record.level_name}: {record.channel}: {record.message}'
)]
LOGGER = get_logger('Nikola', STDERR_HANDLER)
STRICT_HANDLER = ExceptionHandler(ApplicationWarning, level='WARNING')
-if os.getenv('NIKOLA_DEBUG'):
+if DEBUG:
logging.basicConfig(level=logging.DEBUG)
else:
logging.basicConfig(level=logging.WARNING)
@@ -101,7 +103,8 @@ def req_missing(names, purpose, python=True, optional=False):
LOGGER.warn(msg)
else:
LOGGER.error(msg)
- raise Exception('Missing dependencies: {0}'.format(', '.join(names)))
+ LOGGER.error('Exiting due to missing dependencies.')
+ sys.exit(5)
return msg
@@ -127,7 +130,8 @@ __all__ = ['get_theme_path', 'get_theme_chain', 'load_messages', 'copy_tree',
'to_datetime', 'apply_filters', 'config_changed', 'get_crumbs',
'get_tzname', 'get_asset_path', '_reload', 'unicode_str', 'bytes_str',
'unichr', 'Functionary', 'LocaleBorg', 'sys_encode', 'sys_decode',
- 'makedirs', 'get_parent_theme_name', 'ExtendedRSS2']
+ 'makedirs', 'get_parent_theme_name', 'ExtendedRSS2', 'demote_headers',
+ 'get_translation_candidate']
ENCODING = sys.getfilesystemencoding() or sys.stdin.encoding
@@ -346,7 +350,7 @@ def generic_rss_renderer(lang, title, link, description, timeline, output_path,
description=description,
lastBuildDate=datetime.datetime.now(),
items=items,
- generator='nikola',
+ generator='Nikola <http://getnikola.com/>',
language=lang
)
rss_obj.self_url = feed_url
@@ -477,7 +481,7 @@ def to_datetime(value, tzinfo=None):
dt = datetime.datetime.strptime(value, format)
if tzinfo is None:
return dt
- # Build a localized time by using a given timezone.
+ # Build a localized time by using a given time zone.
return tzinfo.localize(dt)
except ValueError:
pass
@@ -496,7 +500,7 @@ def to_datetime(value, tzinfo=None):
def get_tzname(dt):
"""
- Give a datetime value, find the name of the timezone
+ Given a datetime value, find the name of the time zone.
"""
try:
from dateutil import tz
@@ -555,8 +559,10 @@ def apply_filters(task, filters):
return task
-def get_crumbs(path, is_file=False):
+def get_crumbs(path, is_file=False, index_folder=None):
"""Create proper links for a crumb bar.
+ index_folder is used if you want to use title from index file
+ instead of folder name as breadcrumb text.
>>> crumbs = get_crumbs('galleries')
>>> len(crumbs)
@@ -595,6 +601,16 @@ def get_crumbs(path, is_file=False):
for i, crumb in enumerate(crumbs[::-1]):
_path = '/'.join(['..'] * i) or '#'
_crumbs.append([_path, crumb])
+ if index_folder and hasattr(index_folder, 'parse_index'):
+ folder = path
+ for i, crumb in enumerate(crumbs[::-1]):
+ if folder[-1] == os.sep:
+ folder = folder[:-1]
+ index_post = index_folder.parse_index(folder)
+ folder = folder.replace(crumb, '')
+ if index_post:
+ crumb = index_post.title() or crumb
+ _crumbs[i][1] = crumb
return list(reversed(_crumbs))
@@ -792,3 +808,46 @@ def first_line(doc):
if striped:
return striped
return ''
+
+
+def demote_headers(doc, level=1):
+ """Demote <hN> elements by one."""
+ if level == 0:
+ return doc
+ elif level > 0:
+ r = range(1, 7 - level)
+ elif level < 0:
+ r = range(1 + level, 7)
+ for i in reversed(r):
+ # html headers go to 6, so we can’t “lower” beneath five
+ elements = doc.xpath('//h' + str(i))
+ for e in elements:
+ e.tag = 'h' + str(i + level)
+
+
+def get_root_dir():
+ """Find root directory of nikola installation by looking for conf.py"""
+ root = os.getcwd()
+
+ while True:
+ if os.path.exists(os.path.join(root, 'conf.py')):
+ return root
+ else:
+ basedir = os.path.split(root)[0]
+ # Top directory, already checked
+ if basedir == root:
+ break
+ root = basedir
+
+ return None
+
+
+def get_translation_candidate(config, path, lang):
+ """
+ Return a possible path where we can find the translated version of some page
+ based on the TRANSLATIONS_PATTERN configuration variable
+ """
+ pattern = config['TRANSLATIONS_PATTERN']
+ path, ext = os.path.splitext(path)
+ ext = ext[1:] if len(ext) > 0 else ext
+ return pattern.format(path=path, lang=lang, ext=ext)
diff --git a/nikola/winutils.py b/nikola/winutils.py
index 291c99d..517a326 100644
--- a/nikola/winutils.py
+++ b/nikola/winutils.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
-# Copyright © 2012-2013 Roberto Alsina and others.
+# Copyright © 2012-2014 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
diff --git a/requirements-full.txt b/requirements-full.txt
index 0740c23..f7be8cf 100644
--- a/requirements-full.txt
+++ b/requirements-full.txt
@@ -4,7 +4,7 @@ requests>=1.0
markdown
Jinja2>=2.7
bbcode
-https://github.com/lepture/python-livereload/archive/master.zip
+livereload>=2.0.0
pyphen
python-dateutil
micawber
diff --git a/requirements-tests.txt b/requirements-tests.txt
index 5c94a5c..168a927 100644
--- a/requirements-tests.txt
+++ b/requirements-tests.txt
@@ -1,6 +1,5 @@
-r requirements-full.txt
coverage
nose
-flake8
freezegun
python-coveralls
diff --git a/requirements.txt b/requirements.txt
index 6df3a0e..94e4ae7 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -5,8 +5,9 @@ docutils
mako>=0.6
unidecode
lxml
-yapsy==1.10.2-pythons2n3
+yapsy
PyRSS2Gen
pytz
logbook
blinker
+setuptools
diff --git a/scripts/capty b/scripts/capty
index 56c424c..a467489 100755
--- a/scripts/capty
+++ b/scripts/capty
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python2
# -*- coding: utf-8 -*-
"""This tries to do more or less the same thing as CutyCapt, but as a
@@ -54,7 +54,7 @@ class Capturer(object):
def capture(self):
"""Captures url as an image to the file specified"""
self.wb = QtWebKit.QWebPage()
- self.wb.setPreferredContentsSize(QtCore.QSize(900, 700))
+ self.wb.setPreferredContentsSize(QtCore.QSize(1024, 768))
self.wb.mainFrame().setScrollBarPolicy(
QtCore.Qt.Horizontal, QtCore.Qt.ScrollBarAlwaysOff)
self.wb.mainFrame().setScrollBarPolicy(
@@ -67,10 +67,10 @@ class Capturer(object):
self.wb.mainFrame().load(QtCore.QUrl(self.url))
def doCapture(self):
- print "Capturando"
+ print("Capturing...")
self.wb.setViewportSize(self.wb.mainFrame().contentsSize())
img = QtGui.QImage(self.wb.viewportSize(), QtGui.QImage.Format_ARGB32)
- print self.wb.viewportSize()
+ print(self.wb.viewportSize())
painter = QtGui.QPainter(img)
self.wb.mainFrame().render(painter)
painter.end()
diff --git a/scripts/import_po.py b/scripts/import_po.py
index 89e1089..224826c 100755
--- a/scripts/import_po.py
+++ b/scripts/import_po.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+# -*- coding: utf-8 -*-
"""Download translations from transifex and regenerate files."""
from __future__ import unicode_literals, print_function
@@ -22,6 +23,22 @@ MESSAGES = {""".splitlines()
lines2 = []
for entry in po:
lines2.append(' "{0}": "{1}",'. format(entry.msgid, entry.msgstr))
+ ### BACKWARDS COMPATIBILITY PATCH START
+ ### TODO: remove in v7
+ if entry.msgid in ["Posted:", "Also available in:"]:
+ fid = entry.msgid
+ fid = fid.replace(':', '')
+ fstr = entry.msgstr
+ fstr = fstr.replace(':', '').replace(':', '')
+ lines2.append(' "{0}": "{1}",'. format(fid, fstr))
+ elif entry.msgid == 'More posts about %s':
+ fid = entry.msgid
+ fid = fid.replace(' %s', '')
+ fstr = entry.msgstr
+ fstr = fstr.replace(' %s', '').replace('%s', '')
+ lines2.append(' "{0}": "{1}",'. format(fid, fstr))
+ ### BACKWARDS COMPATIBILITY PATCH END
+ ### TODO: remove in v7
lines.extend(sorted(lines2))
lines.append("}\n")
print("Generating:", outf)
diff --git a/scripts/nikola b/scripts/nikola
index a3e5d72..16ac701 100755
--- a/scripts/nikola
+++ b/scripts/nikola
@@ -31,7 +31,7 @@ else:
# LIBDIR trick end (marker for removal on platforms that don't need it)
-from nikola import main
+from nikola import __main__
if __name__ == "__main__":
- sys.exit(main.main(sys.argv[1:]))
+ sys.exit(__main__.main(sys.argv[1:]))
diff --git a/scripts/set_version.py b/scripts/set_version.py
index e34c7ae..289aaef 100755
--- a/scripts/set_version.py
+++ b/scripts/set_version.py
@@ -31,6 +31,8 @@ if __name__ == "__main__":
sed_like_thing(":Version: .*", ":Version: {0}".format(version), doc)
sed_like_thing("version='.+'", "version='{0}'".format(version), 'setup.py')
+ sed_like_thing("version = '.+'", "version = '{0}'".format(version), os.path.join('docs', 'sphinx', 'conf.py'))
+ sed_like_thing("release = '.+'", "release = '{0}'".format(version), os.path.join('docs', 'sphinx', 'conf.py'))
sed_like_thing('__version__ = ".*"', '__version__ = "{0}"'.format(version), os.path.join('nikola', '__init__.py'))
sed_like_thing('New in Master', 'New in {0}'.format(version), 'CHANGES.txt')
os.system("help2man -h help -N --version-string='{0}' nikola > {1}".format(version, os.path.join('docs', 'man', 'nikola.1')))
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..5e40900
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,2 @@
+[wheel]
+universal = 1
diff --git a/setup.py b/setup.py
index 3cf70eb..8cd113e 100755
--- a/setup.py
+++ b/setup.py
@@ -12,23 +12,9 @@ import os
import subprocess
import sys
import shutil
-from fnmatch import fnmatchcase
-
-try:
- # Prefer setuptools for the installation to have no problem with the
- # "--single-version-externally-managed" option that pip uses when
- # installing packages.
- from setuptools import setup
- from setuptools import convert_path
-
- from setuptools.command.install import install
-except ImportError:
- print('\n*** setuptools not found! Falling back to distutils\n\n')
- from distutils.core import setup # NOQA
-
- from distutils.command.install import install
- from distutils.util import convert_path # NOQA
+from setuptools import setup
+from setuptools.command.install import install
with open('requirements.txt', 'r') as fh:
dependencies = [l.strip() for l in fh]
@@ -148,88 +134,8 @@ class nikola_install(install):
install_manpages(self.root, self.prefix)
-def find_package_data(
- where='.', package='',
- exclude=standard_exclude,
- exclude_directories=standard_exclude_directories,
- only_in_packages=True,
- show_ignored=False):
- """
- Return a dictionary suitable for use in ``package_data``
- in a distutils ``setup.py`` file.
-
- The dictionary looks like::
-
- {'package': [files]}
-
- Where ``files`` is a list of all the files in that package that
- don't match anything in ``exclude``.
-
- If ``only_in_packages`` is true, then top-level directories that
- are not packages won't be included (but directories under packages
- will).
-
- Directories matching any pattern in ``exclude_directories`` will
- be ignored; by default directories with leading ``.``, ``CVS``,
- and ``_darcs`` will be ignored.
-
- If ``show_ignored`` is true, then all the files that aren't
- included in package data are shown on stderr (for debugging
- purposes).
-
- Note patterns use wildcards, or can be exact paths (including
- leading ``./``), and all searching is case-insensitive.
- """
-
- out = {}
- stack = [(convert_path(where), '', package, only_in_packages)]
- while stack:
- where, prefix, package, only_in_packages = stack.pop(0)
- for name in os.listdir(where):
- fn = os.path.join(where, name)
- if os.path.isdir(fn):
- bad_name = False
- for pattern in exclude_directories:
- if (fnmatchcase(name, pattern)
- or fn.lower() == pattern.lower()):
- bad_name = True
- if show_ignored:
- print >> sys.stderr, (
- "Directory %s ignored by pattern %s"
- % (fn, pattern))
- break
- if bad_name:
- continue
- if (os.path.isfile(os.path.join(fn, '__init__.py'))
- and not prefix):
- if not package:
- new_package = name
- else:
- new_package = package + '.' + name
- stack.append((fn, '', new_package, False))
- else:
- stack.append((fn, prefix + name + '/',
- package, only_in_packages))
- elif package or not only_in_packages:
- # is a file
- bad_name = False
- for pattern in exclude:
- if (fnmatchcase(name, pattern)
- or fn.lower() == pattern.lower()):
- bad_name = True
- if show_ignored:
- print >> sys.stderr, (
- "File %s ignored by pattern %s"
- % (fn, pattern))
- break
- if bad_name:
- continue
- out.setdefault(package, []).append(prefix + name)
- return out
-
-
setup(name='Nikola',
- version='6.2.1',
+ version='6.3.0',
description='A modular, fast, simple, static website generator',
long_description=open('README.rst').read(),
author='Roberto Alsina and others',
@@ -271,7 +177,7 @@ setup(name='Nikola',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Text Processing :: Markup'),
install_requires=dependencies,
- package_data=find_package_data(),
+ include_package_data=True,
cmdclass={'install': nikola_install},
data_files=[
('share/doc/nikola', [
diff --git a/tests/README.rst b/tests/README.rst
index 2b3afb8..8b2199a 100644
--- a/tests/README.rst
+++ b/tests/README.rst
@@ -38,33 +38,33 @@ You need:
How to set the locale for Nikola tests?
---------------------------------------
-For testing nikola needs to specify two languages, each one with a supported locale. By default, the test suite uses ``en`` and ``es`` as languages, and their respective default locale for them.
+For testing nikola needs to specify two languages, each one with a supported locale. By default, the test suite uses ``en`` and ``pl`` as languages, and their respective default locale for them.
-You can set the language - locale pairs by exporting two shell variables, like in::
+The choice of Polish is due to having one locale to generate instead of 20 (Spanish) and you can happily ignore it — just set the language–locale pairs by exporting two shell variables, for example::
export NIKOLA_LOCALE_DEFAULT=en,en_US.utf8
- export NIKOLA_LOCALE_OTHER=es,es_ES.utf8
+ export NIKOLA_LOCALE_OTHER=pl,pl_PL.utf8
In Windows that would be::
- set NIKOLA_LOCALE_DEFAULT=en,English
- set NIKOLA_LOCALE_OTHER=es,Spanish
-
+ set NIKOLA_LOCALE_DEFAULT=en,English
+ set NIKOLA_LOCALE_OTHER=pl,Polish
+
Replace the part before the comma with a Nikola translation selector (see ``nikola/conf.py.in`` for details), and the part after the comma with an *installed* glibc locale.
To check if the desired locale is supported in your host you can, in a python console::
- import locale
- locale.setlocale(locale.LC_ALL, 'locale_name')
- # by example, 'en_US.utf8' (posix) 'English' (windows)
- # if it does not traceback, then python can use that locale
+ import locale
+ locale.setlocale(locale.LC_ALL, 'locale_name')
+ # for example, 'en_US.utf8' (posix) 'English' (windows)
+ # if it does not traceback, then python can use that locale
Alternatively, if you have some disk space to spare, you can install
the two default locales. Here is how to do that in Ubuntu::
- sudo apt-get install language-pack-en language-pack-es
+ sudo apt-get install language-pack-en language-pack-pl
+
-
How to execute the tests
------------------------
@@ -90,3 +90,17 @@ Travis CI
We also run our tests on `Travis CI <https://travis-ci.org/>`_.
You can check the `current build status <https://travis-ci.org/getnikola/nikola>`_ there.
+
+
+Writing tests
+-------------
+
+* When adding new *.py files under tests/ , remember to include at the begining the lines::
+
+ # This code is so you can run the samples without installing the package,
+ # and should be before any import touching nikola, in any file under tests/
+ import os
+ import sys
+ sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
+
+ Those lines allow to run the tests without installing nikola.
diff --git a/tests/__init__.py b/tests/__init__.py
index e69de29..6ad8bac 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -0,0 +1,25 @@
+# -*- coding: utf-8 -*-
+
+# Copyright © 2012-2014 Roberto Alsina and others.
+
+# Permission is hereby granted, free of charge, to any
+# person obtaining a copy of this software and associated
+# documentation files (the "Software"), to deal in the
+# Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the
+# Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice
+# shall be included in all copies or substantial portions of
+# the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+# PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
+# OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/tests/base.py b/tests/base.py
index 00f7486..f3e3545 100644
--- a/tests/base.py
+++ b/tests/base.py
@@ -8,10 +8,16 @@
__all__ = ["BaseTestCase", "cd", "LocaleSupportInTesting"]
-from contextlib import contextmanager
-import locale
+
+# This code is so you can run the samples without installing the package,
+# and should be before any import touching nikola, in any file under tests/
import os
import sys
+sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
+
+
+from contextlib import contextmanager
+import locale
import unittest
import logbook
@@ -106,18 +112,18 @@ class LocaleSupportInTesting(object):
if hasattr(cls, 'langlocales'):
return
defaults = {
- 'linux': {
+ 'posix': {
# non-windows defaults, must be two locales suported by .travis.yml
'default': ("en", str("en_US.utf8")),
- 'other': ("es", str("es_ES.utf8")),
+ 'other': ("pl", str("pl_PL.utf8")),
},
'windows': {
# windows defaults
'default': ("en", str("English")),
- 'other': ("es", str("Spanish")),
+ 'other': ("pl", str("Polish")),
},
}
- os_id = 'windows' if sys.platform == 'win32' else 'linux'
+ os_id = 'windows' if sys.platform == 'win32' else 'posix'
langlocales = {}
for suffix in ['other', 'default']:
try:
diff --git a/tests/context.py b/tests/context.py
deleted file mode 100644
index 28eb872..0000000
--- a/tests/context.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Path hack as shown by Kenneth Reitz at http://kennethreitz.com/repository-structure-and-python.html
-
-import os
-import sys
-sys.path.insert(0, os.path.abspath('..'))
-
-import nikola # NOQA
diff --git a/tests/data/translated_titles/conf.py b/tests/data/translated_titles/conf.py
index b445ba9..edfce3e 100644
--- a/tests/data/translated_titles/conf.py
+++ b/tests/data/translated_titles/conf.py
@@ -47,9 +47,23 @@ DEFAULT_LANG = "en"
TRANSLATIONS = {
"en": "",
# Example for another language:
- "es": "./es",
+ "pl": "./pl",
}
+# What will translated input files be named like?
+
+# If you have a page something.rst, then something.rst.pl will be considered
+# its Polish translation.
+# (in the above example: path == "something", lang == "pl", ext == "rst")
+# this pattern is also used for metadata:
+# something.meta -> something.meta.pl
+
+TRANSLATIONS_PATTERN = "{path}.{ext}.{lang}"
+
+# If you don't want your Polish files to be considered Perl code, use this:
+# TRANSLATIONS_PATTERN = "{path}.{lang}.{ext}"
+# Note that this pattern will become the default in v7.0.0.
+
# Links for the sidebar / navigation bar.
# You should provide a key-value pair for each used language.
SIDEBAR_LINKS = {
@@ -57,7 +71,7 @@ SIDEBAR_LINKS = {
('/archive.html', 'Archives'),
('/categories/index.html', 'Tags'),
),
- "es": ()
+ "pl": ()
}
diff --git a/tests/data/translated_titles/stories/1.txt.es b/tests/data/translated_titles/stories/1.txt.pl
index a888c1f..a888c1f 100644
--- a/tests/data/translated_titles/stories/1.txt.es
+++ b/tests/data/translated_titles/stories/1.txt.pl
diff --git a/tests/test_command_import_wordpress.py b/tests/test_command_import_wordpress.py
index f215705..d12c7f6 100644
--- a/tests/test_command_import_wordpress.py
+++ b/tests/test_command_import_wordpress.py
@@ -1,11 +1,17 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
-from .context import nikola
+# This code is so you can run the samples without installing the package,
+# and should be before any import touching nikola, in any file under tests/
import os
+import sys
+sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
+
+
import unittest
import mock
+import nikola
import nikola.plugins.command.import_wordpress
from .base import BaseTestCase
diff --git a/tests/test_command_init.py b/tests/test_command_init.py
index a9ec208..04e7d5f 100644
--- a/tests/test_command_init.py
+++ b/tests/test_command_init.py
@@ -1,10 +1,17 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
-from .context import nikola
+# This code is so you can run the samples without installing the package,
+# and should be before any import touching nikola, in any file under tests/
+import os
+import sys
+sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
+
import unittest
import mock
+import nikola
+
class CommandInitCallTest(unittest.TestCase):
def setUp(self):
diff --git a/tests/test_compile_markdown.py b/tests/test_compile_markdown.py
index a8252d8..d51d3aa 100644
--- a/tests/test_compile_markdown.py
+++ b/tests/test_compile_markdown.py
@@ -1,5 +1,13 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
+
+# This code is so you can run the samples without installing the package,
+# and should be before any import touching nikola, in any file under tests/
+import os
+import sys
+sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
+
+
import codecs
import shutil
import tempfile
@@ -45,27 +53,6 @@ class CompileMarkdownTests(unittest.TestCase):
actual_output = self.compile(input_str)
self.assertEquals(actual_output, '')
- def test_compile_html_heading_tags(self):
- input_str = '''\
-# header 1
-## header 2
-### header 3
-#### header 4
-##### header 5
-###### header 6
-'''
- expected_output = '''\
-<h2>header 1</h2>
-<h3>header 2</h3>
-<h4>header 3</h4>
-<h5>header 4</h5>
-<h6>header 5</h6>
-<h7>header 6</h7>
-'''
-
- actual_output = self.compile(input_str)
- self.assertEquals(actual_output.strip(), expected_output.strip())
-
def test_compile_html_code_hilite(self):
input_str = '''\
#!python
diff --git a/tests/test_integration.py b/tests/test_integration.py
index fdb2494..85d7892 100644
--- a/tests/test_integration.py
+++ b/tests/test_integration.py
@@ -1,19 +1,23 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function, absolute_import
+# This code is so you can run the samples without installing the package,
+# and should be before any import touching nikola, in any file under tests/
+import os
+import sys
+sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
+
+
import codecs
import locale
-import os
import shutil
-import subprocess
-import sys
import tempfile
import unittest
import lxml.html
from nose.plugins.skip import SkipTest
-from nikola import main
+from nikola import __main__
import nikola
import nikola.plugins.command
import nikola.plugins.command.init
@@ -60,7 +64,7 @@ class EmptyBuildTest(BaseTestCase):
def build(self):
"""Build the site."""
with cd(self.target_dir):
- main.main(["build"])
+ __main__.main(["build"])
@classmethod
def tearDownClass(self):
@@ -163,7 +167,7 @@ class FuturePostTest(EmptyBuildTest):
# Run deploy command to see if future post is deleted
with cd(self.target_dir):
- main.main(["deploy"])
+ __main__.main(["deploy"])
self.assertTrue(os.path.isfile(index_path))
self.assertTrue(os.path.isfile(foo_path))
@@ -178,26 +182,62 @@ class TranslatedBuildTest(EmptyBuildTest):
def __init__(self, *a, **kw):
super(TranslatedBuildTest, self).__init__(*a, **kw)
try:
- locale.setlocale(locale.LC_ALL, ("es", "utf8"))
+ locale.setlocale(locale.LC_ALL, ("pl_PL", "utf8"))
except:
raise SkipTest
def test_translated_titles(self):
"""Check that translated title is picked up."""
en_file = os.path.join(self.target_dir, "output", "stories", "1.html")
- es_file = os.path.join(self.target_dir, "output", "es", "stories", "1.html")
+ pl_file = os.path.join(self.target_dir, "output", "pl", "stories", "1.html")
# Files should be created
self.assertTrue(os.path.isfile(en_file))
- self.assertTrue(os.path.isfile(es_file))
+ self.assertTrue(os.path.isfile(pl_file))
# And now let's check the titles
with codecs.open(en_file, 'r', 'utf8') as inf:
doc = lxml.html.parse(inf)
self.assertEqual(doc.find('//title').text, 'Foo | Demo Site')
- with codecs.open(es_file, 'r', 'utf8') as inf:
+ with codecs.open(pl_file, 'r', 'utf8') as inf:
doc = lxml.html.parse(inf)
self.assertEqual(doc.find('//title').text, 'Bar | Demo Site')
+class TranslationsPatternTest1(TranslatedBuildTest):
+ """Check that the path.lang.ext TRANSLATIONS_PATTERN works too"""
+
+ @classmethod
+ def patch_site(self):
+ """Set the TRANSLATIONS_PATTERN to the new v7 default"""
+ os.rename(os.path.join(self.target_dir, "stories", "1.txt.pl"),
+ os.path.join(self.target_dir, "stories", "1.pl.txt")
+ )
+ conf_path = os.path.join(self.target_dir, "conf.py")
+ with codecs.open(conf_path, "rb", "utf-8") as inf:
+ data = inf.read()
+ data = data.replace('TRANSLATIONS_PATTERN = "{path}.{ext}.{lang}"',
+ 'TRANSLATIONS_PATTERN = "{path}.{lang}.{ext}"')
+ with codecs.open(conf_path, "wb+", "utf8") as outf:
+ outf.write(data)
+
+
+class TranslationsPatternTest2(TranslatedBuildTest):
+ """Check that the path_lang.ext TRANSLATIONS_PATTERN works too"""
+
+ @classmethod
+ def patch_site(self):
+ """Set the TRANSLATIONS_PATTERN to the new v7 default"""
+ conf_path = os.path.join(self.target_dir, "conf.py")
+ os.rename(os.path.join(self.target_dir, "stories", "1.txt.pl"),
+ os.path.join(self.target_dir, "stories", "1_pl.txt")
+ )
+ with codecs.open(conf_path, "rb", "utf-8") as inf:
+ data = inf.read()
+ data = data.replace('TRANSLATIONS_PATTERN = "{path}.{ext}.{lang}"',
+ 'TRANSLATIONS_PATTERN = "{path}_{lang}.{ext}"')
+ with codecs.open(conf_path, "wb+", "utf8") as outf:
+ outf.write(data)
+
+
class RelativeLinkTest(DemoBuildTest):
"""Check that SITE_URL with a path doesn't break links."""
@@ -234,22 +274,22 @@ class RelativeLinkTest(DemoBuildTest):
self.assertTrue('<loc>http://getnikola.com/foo/bar/index.html</loc>' in sitemap_data)
-if sys.version_info[0] == 2 and sys.version_info[1] < 7:
- check_output = subprocess.check_call
-else:
- check_output = subprocess.check_output
-
-
class TestCheck(DemoBuildTest):
"""The demo build should pass 'nikola check'"""
def test_check_links(self):
with cd(self.target_dir):
- check_output("nikola check -l", shell=True, stderr=subprocess.STDOUT)
+ try:
+ __main__.main(['check', '-l'])
+ except SystemExit as e:
+ self.assertEqual(e.code, 0)
def test_check_files(self):
with cd(self.target_dir):
- check_output("nikola check -f", shell=True, stderr=subprocess.STDOUT)
+ try:
+ __main__.main(['check', '-f'])
+ except SystemExit as e:
+ self.assertEqual(e.code, 0)
class TestCheckFailure(DemoBuildTest):
@@ -258,19 +298,19 @@ class TestCheckFailure(DemoBuildTest):
def test_check_links_fail(self):
with cd(self.target_dir):
os.unlink(os.path.join("output", "archive.html"))
- self.assertRaises(
- subprocess.CalledProcessError,
- check_output, "nikola check -f", shell=True
- )
+ try:
+ __main__.main(['check', '-l'])
+ except SystemExit as e:
+ self.assertNotEqual(e.code, 0)
def test_check_files_fail(self):
with cd(self.target_dir):
with codecs.open(os.path.join("output", "foobar"), "wb+", "utf8") as outf:
outf.write("foo")
- self.assertRaises(
- subprocess.CalledProcessError,
- check_output, "nikola check -f", shell=True
- )
+ try:
+ __main__.main(['check', '-f'])
+ except SystemExit as e:
+ self.assertNotEqual(e.code, 0)
class RelativeLinkTest2(DemoBuildTest):
@@ -334,5 +374,16 @@ class MonthlyArchiveTest(DemoBuildTest):
self.assertTrue(os.path.isfile(os.path.join(self.tmpdir, 'target', 'output', '2012', '03', 'index.html')))
+class SubdirRunningTest(DemoBuildTest):
+ """Check that running nikola from subdir works."""
+
+ def test_subdir_run(self):
+ """Check whether build works from posts/"""
+
+ with cd(os.path.join(self.target_dir, 'posts')):
+ result = __main__.main(['build'])
+ self.assertEquals(result, 0)
+
+
if __name__ == "__main__":
unittest.main()
diff --git a/tests/test_locale.py b/tests/test_locale.py
index 93df2ae..90f9edb 100644
--- a/tests/test_locale.py
+++ b/tests/test_locale.py
@@ -1,6 +1,12 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
+
+# This code is so you can run the samples without installing the package,
+# and should be before any import touching nikola, in any file under tests/
+import os
import sys
+sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
+
# needed if @unittest.expectedFailure is used
try:
diff --git a/tests/test_plugin_importing.py b/tests/test_plugin_importing.py
index 5009f88..aaba113 100644
--- a/tests/test_plugin_importing.py
+++ b/tests/test_plugin_importing.py
@@ -1,7 +1,13 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
-from .context import nikola # NOQA
+# This code is so you can run the samples without installing the package,
+# and should be before any import touching nikola, in any file under tests/
+import os
+import sys
+sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
+
+
import unittest
diff --git a/tests/test_rss_feeds.py b/tests/test_rss_feeds.py
index 169e1e7..d1404d8 100644
--- a/tests/test_rss_feeds.py
+++ b/tests/test_rss_feeds.py
@@ -1,6 +1,14 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
+
+# This code is so you can run the samples without installing the package,
+# and should be before any import touching nikola, in any file under tests/
+import os
+import sys
+sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
+
+
from collections import defaultdict
from io import StringIO
import os
@@ -9,18 +17,23 @@ import unittest
import mock
-from .context import nikola # NOQA
from lxml import etree
from .base import LocaleSupportInTesting
+import nikola
fake_conf = defaultdict(str)
-fake_conf['TIMEZONE'] = None
+fake_conf['TIMEZONE'] = 'UTC'
fake_conf['DEFAULT_LANG'] = 'en'
fake_conf['TRANSLATIONS'] = {'en': ''}
fake_conf['BASE_URL'] = 'http://some.blog/'
+class FakeCompiler(object):
+ demote_headers = False
+ compile_html = None
+
+
class RSSFeedTest(unittest.TestCase):
def setUp(self):
LocaleSupportInTesting.initialize_locales_for_testing('unilingual')
@@ -46,7 +59,7 @@ class RSSFeedTest(unittest.TestCase):
True,
{'en': ''},
'post.tmpl',
- lambda *a: None)
+ FakeCompiler())
opener_mock = mock.mock_open()
diff --git a/tests/test_rst_compiler.py b/tests/test_rst_compiler.py
index c5db8dd..ae4ac06 100644
--- a/tests/test_rst_compiler.py
+++ b/tests/test_rst_compiler.py
@@ -27,13 +27,18 @@ always unquoted.
from __future__ import unicode_literals, absolute_import
+# This code is so you can run the samples without installing the package,
+# and should be before any import touching nikola, in any file under tests/
+import os
+import sys
+sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
+
+
import codecs
try:
from io import StringIO
except ImportError:
from StringIO import StringIO # NOQA
-import os
-import sys
import tempfile
import docutils
@@ -113,6 +118,7 @@ class FakeSite(object):
FakePost(title='Fake post',
slug='fake-post')
]
+ self.debug = True
def render_template(self, name, _, context):
return('<img src="IMG.jpg">')
diff --git a/tests/test_scheduling.py b/tests/test_scheduling.py
index 264d1c5..c9cda42 100644
--- a/tests/test_scheduling.py
+++ b/tests/test_scheduling.py
@@ -1,5 +1,13 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
+
+# This code is so you can run the samples without installing the package,
+# and should be before any import touching nikola, in any file under tests/
+import os
+import sys
+sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
+
+
from .base import BaseTestCase
import datetime
from nose.plugins.skip import SkipTest
@@ -24,6 +32,17 @@ class TestScheduling(BaseTestCase):
if not _freeze_time:
raise SkipTest('freezegun not installed')
+ d = [name for name in sys.modules if name.startswith("six.moves.")]
+ self.deleted = {}
+ for name in d:
+ self.deleted[name] = sys.modules[name]
+ del sys.modules[name]
+
+ @classmethod
+ def tearDown(self):
+ for name, mod in self.deleted.items():
+ sys.modules[name] = mod
+
@freeze_time(NOW)
def test_get_date(self):
from nikola.plugins.command.new_post import get_date
diff --git a/tests/test_utils.py b/tests/test_utils.py
index 4f3fd72..3e66157 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -1,9 +1,18 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
+# This code is so you can run the samples without installing the package,
+# and should be before any import touching nikola, in any file under tests/
+import os
+import sys
+sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
+
+
import unittest
import mock
+import lxml.html
from nikola.post import get_meta
+from nikola.utils import demote_headers
class dummy(object):
@@ -117,8 +126,9 @@ class GetMetaTest(unittest.TestCase):
post.source_path = '2013-01-23-the_slug-dubdubtitle.md'
post.metadata_path = '2013-01-23-the_slug-dubdubtitle.meta'
with mock.patch('nikola.post.codecs.open', create=True):
- meta = get_meta(post,
- '(?P<date>\d{4}-\d{2}-\d{2})-(?P<slug>.*)-(?P<title>.*)\.md')
+ meta = get_meta(
+ post,
+ '(?P<date>\d{4}-\d{2}-\d{2})-(?P<slug>.*)-(?P<title>.*)\.md')
self.assertEqual('dubdubtitle', meta['title'])
self.assertEqual('the_slug', meta['slug'])
@@ -133,5 +143,96 @@ class GetMetaTest(unittest.TestCase):
self.assertEqual('the_slug', meta['slug'])
+
+class HeaderDemotionTest(unittest.TestCase):
+ def demote_by_zero(self):
+ input_str = '''\
+<h1>header 1</h1>
+<h2>header 2</h2>
+<h3>header 3</h3>
+<h4>header 4</h4>
+<h5>header 5</h5>
+<h6>header 6</h6>
+'''
+ expected_output = '''\
+<h1>header 1</h1>
+<h2>header 2</h2>
+<h3>header 3</h3>
+<h4>header 4</h4>
+<h5>header 5</h5>
+<h6>header 6</h6>
+'''
+ doc = lxml.html.fromstring(input_str)
+ outdoc = lxml.html.fromstring(expected_output)
+ demote_headers(doc, 0)
+ self.assertEquals(lxml.html.tostring(outdoc), lxml.html.tostring(doc))
+
+ def demote_by_one(self):
+ input_str = '''\
+<h1>header 1</h1>
+<h2>header 2</h2>
+<h3>header 3</h3>
+<h4>header 4</h4>
+<h5>header 5</h5>
+<h6>header 6</h6>
+'''
+ expected_output = '''\
+<h2>header 1</h2>
+<h3>header 2</h3>
+<h4>header 3</h4>
+<h5>header 4</h5>
+<h6>header 5</h6>
+<h6>header 6</h6>
+'''
+ doc = lxml.html.fromstring(input_str)
+ outdoc = lxml.html.fromstring(expected_output)
+ demote_headers(doc, 1)
+ self.assertEquals(lxml.html.tostring(outdoc), lxml.html.tostring(doc))
+
+ def demote_by_two(self):
+ input_str = '''\
+<h1>header 1</h1>
+<h2>header 2</h2>
+<h3>header 3</h3>
+<h4>header 4</h4>
+<h5>header 5</h5>
+<h6>header 6</h6>
+'''
+ expected_output = '''\
+<h3>header 1</h3>
+<h4>header 2</h4>
+<h5>header 3</h5>
+<h6>header 4</h6>
+<h6>header 5</h6>
+<h6>header 6</h6>
+'''
+ doc = lxml.html.fromstring(input_str)
+ outdoc = lxml.html.fromstring(expected_output)
+ demote_headers(doc, 2)
+ self.assertEquals(lxml.html.tostring(outdoc), lxml.html.tostring(doc))
+
+ def demote_by_minus_one(self):
+ input_str = '''\
+<h1>header 1</h1>
+<h2>header 2</h2>
+<h3>header 3</h3>
+<h4>header 4</h4>
+<h5>header 5</h5>
+<h6>header 6</h6>
+'''
+ expected_output = '''\
+<h1>header 1</h1>
+<h1>header 2</h1>
+<h2>header 3</h2>
+<h3>header 4</h3>
+<h4>header 5</h4>
+<h5>header 6</h5>
+'''
+ doc = lxml.html.fromstring(input_str)
+ outdoc = lxml.html.fromstring(expected_output)
+ demote_headers(doc, -1)
+ self.assertEquals(lxml.html.tostring(outdoc), lxml.html.tostring(doc))
+
+
if __name__ == '__main__':
unittest.main()
diff --git a/translations/nikola.messages/bg.po b/translations/nikola.messages/bg.po
index 25f02cd..bd5bb65 100644
--- a/translations/nikola.messages/bg.po
+++ b/translations/nikola.messages/bg.po
@@ -11,7 +11,7 @@ msgstr ""
"Project-Id-Version: Nikola\n"
"Report-Msgid-Bugs-To: ralsina@netmanagers.com.ar\n"
"POT-Creation-Date: 2013-03-15 12:24-0300\n"
-"PO-Revision-Date: 2013-10-25 09:00+0000\n"
+"PO-Revision-Date: 2014-01-22 13:11+0000\n"
"Last-Translator: Kwpolska <kwpolska@gmail.com>\n"
"Language-Team: Bulgarian (http://www.transifex.com/projects/p/nikola/language/bg/)\n"
"MIME-Version: 1.0\n"
@@ -20,8 +20,8 @@ msgstr ""
"Language: bg\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-msgid "More posts about"
-msgstr "Още публикации относно "
+msgid "More posts about %s"
+msgstr "Още публикации относно %s"
msgid "LANGUAGE"
msgstr "Български"
@@ -44,13 +44,16 @@ msgstr "Публикации относно %s"
msgid "Next post"
msgstr "Следваща публикация"
-msgid "old posts page %d"
-msgstr "стари публикации страница %d"
+msgid "old posts, page %d"
+msgstr "стари публикации, страница %d"
+
+msgid "page %d"
+msgstr "страница %d"
msgid "Source"
msgstr "Source"
-#. Here your translation should not say ENglish but the name of your language
+#. Here your translation should not say English but the name of your language
#. instead
msgid "Read in English"
msgstr "Прочетете на български"
@@ -64,8 +67,8 @@ msgstr "Нови публикации"
msgid "Previous post"
msgstr "Предишна публикация"
-msgid "Also available in"
-msgstr "Също достъпно в"
+msgid "Also available in:"
+msgstr "Също достъпно в:"
msgid "Original site"
msgstr "Оригиналния сайт"
@@ -76,8 +79,8 @@ msgstr "Стари публикации"
msgid "Archive"
msgstr "Архив"
-msgid "Posted"
-msgstr "Публиковано"
+msgid "Posted:"
+msgstr "Публиковано:"
msgid "Posts for {month} {year}"
msgstr "Публикации за {month} {year}"
diff --git a/translations/nikola.messages/ca.po b/translations/nikola.messages/ca.po
index de98c52..1e8db82 100644
--- a/translations/nikola.messages/ca.po
+++ b/translations/nikola.messages/ca.po
@@ -11,7 +11,7 @@ msgstr ""
"Project-Id-Version: Nikola\n"
"Report-Msgid-Bugs-To: ralsina@netmanagers.com.ar\n"
"POT-Creation-Date: 2013-03-15 12:24-0300\n"
-"PO-Revision-Date: 2013-10-25 09:00+0000\n"
+"PO-Revision-Date: 2014-01-22 13:11+0000\n"
"Last-Translator: Kwpolska <kwpolska@gmail.com>\n"
"Language-Team: Catalan (http://www.transifex.com/projects/p/nikola/language/ca/)\n"
"MIME-Version: 1.0\n"
@@ -20,8 +20,8 @@ msgstr ""
"Language: ca\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-msgid "More posts about"
-msgstr "Més entrades sobre"
+msgid "More posts about %s"
+msgstr "Més entrades sobre %s"
msgid "LANGUAGE"
msgstr "Català"
@@ -44,13 +44,16 @@ msgstr "Entrades sobre %s"
msgid "Next post"
msgstr "Entrada següent"
-msgid "old posts page %d"
-msgstr "entrades antigues pàgina %d"
+msgid "old posts, page %d"
+msgstr "entrades antigues, pàgina %d"
+
+msgid "page %d"
+msgstr "pàgina %d"
msgid "Source"
msgstr "Codi"
-#. Here your translation should not say ENglish but the name of your language
+#. Here your translation should not say English but the name of your language
#. instead
msgid "Read in English"
msgstr "Llegeix-ho en català"
@@ -64,8 +67,8 @@ msgstr "Entrades posteriors"
msgid "Previous post"
msgstr "Entrada anterior"
-msgid "Also available in"
-msgstr "També disponibles en"
+msgid "Also available in:"
+msgstr "També disponibles en:"
msgid "Original site"
msgstr "Lloc original"
@@ -76,8 +79,8 @@ msgstr "Entrades anteriors"
msgid "Archive"
msgstr "Arxiu"
-msgid "Posted"
-msgstr "Publicat"
+msgid "Posted:"
+msgstr "Publicat:"
msgid "Posts for {month} {year}"
msgstr ""
diff --git a/translations/nikola.messages/cs.po b/translations/nikola.messages/cs.po
new file mode 100644
index 0000000..b920038
--- /dev/null
+++ b/translations/nikola.messages/cs.po
@@ -0,0 +1,85 @@
+# Messages in Nikola
+# Copyright (C) 2012-2013
+# This file is distributed under the same license as the Nikola package.
+#
+# Translators:
+# Translators:
+# Ondřej Grover <ondrej.grover@gmail.com>, 2014
+msgid ""
+msgstr ""
+"Project-Id-Version: Nikola\n"
+"Report-Msgid-Bugs-To: ralsina@netmanagers.com.ar\n"
+"POT-Creation-Date: 2013-03-15 12:24-0300\n"
+"PO-Revision-Date: 2014-01-22 13:09+0000\n"
+"Last-Translator: Kwpolska <kwpolska@gmail.com>\n"
+"Language-Team: Czech (http://www.transifex.com/projects/p/nikola/language/cs/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: cs\n"
+"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
+
+msgid "More posts about %s"
+msgstr "Další příspěvky o %s"
+
+msgid "LANGUAGE"
+msgstr "Čeština"
+
+msgid "Tags"
+msgstr "Štítky"
+
+msgid "Categories"
+msgstr "Kategorie"
+
+msgid "Tags and Categories"
+msgstr "Štítky a kategorie"
+
+msgid "Read more"
+msgstr "Číst dál"
+
+msgid "Posts about %s"
+msgstr "Příspěvky o %s"
+
+msgid "Next post"
+msgstr "Další příspěvek"
+
+msgid "old posts, page %d"
+msgstr "staré příspěvky, strana %d"
+
+msgid "page %d"
+msgstr "strana %d"
+
+msgid "Source"
+msgstr "Zdroj"
+
+#. Here your translation should not say English but the name of your language
+#. instead
+msgid "Read in English"
+msgstr "Číst v češtině"
+
+msgid "Posts for year %s"
+msgstr "Příspěvky v roce %s"
+
+msgid "Newer posts"
+msgstr "Novější příspěvky"
+
+msgid "Previous post"
+msgstr "Předchozí příspěvek"
+
+msgid "Also available in:"
+msgstr "Dostupné také v"
+
+msgid "Original site"
+msgstr "Původní stránka"
+
+msgid "Older posts"
+msgstr "Starší příspěvky"
+
+msgid "Archive"
+msgstr "Archiv"
+
+msgid "Posted:"
+msgstr "Zveřejněno:"
+
+msgid "Posts for {month} {year}"
+msgstr "Příspěvky v {month} {year}"
diff --git a/translations/nikola.messages/de.po b/translations/nikola.messages/de.po
index d10b470..fdbb033 100644
--- a/translations/nikola.messages/de.po
+++ b/translations/nikola.messages/de.po
@@ -18,7 +18,7 @@ msgstr ""
"Project-Id-Version: Nikola\n"
"Report-Msgid-Bugs-To: ralsina@netmanagers.com.ar\n"
"POT-Creation-Date: 2013-03-15 12:24-0300\n"
-"PO-Revision-Date: 2013-10-25 09:00+0000\n"
+"PO-Revision-Date: 2014-01-22 13:11+0000\n"
"Last-Translator: Kwpolska <kwpolska@gmail.com>\n"
"Language-Team: German (http://www.transifex.com/projects/p/nikola/language/de/)\n"
"MIME-Version: 1.0\n"
@@ -27,8 +27,8 @@ msgstr ""
"Language: de\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-msgid "More posts about"
-msgstr "Weitere Einträge über"
+msgid "More posts about %s"
+msgstr "Weitere Einträge über %s"
msgid "LANGUAGE"
msgstr "Deutsch"
@@ -51,13 +51,16 @@ msgstr "Einträge über %s"
msgid "Next post"
msgstr "Nächster Eintrag"
-msgid "old posts page %d"
-msgstr "Vorherige Einträge %d"
+msgid "old posts, page %d"
+msgstr "Vorherige Einträge, Seite %d"
+
+msgid "page %d"
+msgstr "Seite %d"
msgid "Source"
msgstr "Source"
-#. Here your translation should not say ENglish but the name of your language
+#. Here your translation should not say English but the name of your language
#. instead
msgid "Read in English"
msgstr "Auf Deutsch lesen"
@@ -71,8 +74,8 @@ msgstr "Neuere Einträge"
msgid "Previous post"
msgstr "Vorheriger Eintrag"
-msgid "Also available in"
-msgstr "Auch verfügbar in"
+msgid "Also available in:"
+msgstr "Auch verfügbar in:"
msgid "Original site"
msgstr "Original-Seite"
@@ -83,8 +86,8 @@ msgstr "Ältere Einträge"
msgid "Archive"
msgstr "Archiv"
-msgid "Posted"
-msgstr "Veröffentlicht"
+msgid "Posted:"
+msgstr "Veröffentlicht:"
msgid "Posts for {month} {year}"
msgstr "Einträge aus {month} {year}"
diff --git a/translations/nikola.messages/el.po b/translations/nikola.messages/el.po
index 04547e1..549a76f 100644
--- a/translations/nikola.messages/el.po
+++ b/translations/nikola.messages/el.po
@@ -13,7 +13,7 @@ msgstr ""
"Project-Id-Version: Nikola\n"
"Report-Msgid-Bugs-To: ralsina@netmanagers.com.ar\n"
"POT-Creation-Date: 2013-03-15 12:24-0300\n"
-"PO-Revision-Date: 2013-10-25 09:00+0000\n"
+"PO-Revision-Date: 2014-01-22 13:11+0000\n"
"Last-Translator: Kwpolska <kwpolska@gmail.com>\n"
"Language-Team: Greek (http://www.transifex.com/projects/p/nikola/language/el/)\n"
"MIME-Version: 1.0\n"
@@ -22,8 +22,8 @@ msgstr ""
"Language: el\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-msgid "More posts about"
-msgstr "Περισσότερες αναρτήσεις για"
+msgid "More posts about %s"
+msgstr "Περισσότερες αναρτήσεις για %s"
msgid "LANGUAGE"
msgstr "Ελληνικά"
@@ -35,7 +35,7 @@ msgid "Categories"
msgstr "Κατηγορίες"
msgid "Tags and Categories"
-msgstr ""
+msgstr "Ετικέτες και κατηγορίες"
msgid "Read more"
msgstr "Διαβάστε περισσότερα"
@@ -46,13 +46,16 @@ msgstr "Αναρτήσεις για %s"
msgid "Next post"
msgstr "Επόμενη ανάρτηση"
-msgid "old posts page %d"
+msgid "old posts, page %d"
msgstr "σελίδα παλαιότερων αναρτήσεων %d"
+msgid "page %d"
+msgstr "σελίδα %d"
+
msgid "Source"
msgstr "Πηγαίος κώδικας"
-#. Here your translation should not say ENglish but the name of your language
+#. Here your translation should not say English but the name of your language
#. instead
msgid "Read in English"
msgstr "Διαβάστε στα Ελληνικά"
@@ -66,8 +69,8 @@ msgstr "Νεότερες αναρτήσεις"
msgid "Previous post"
msgstr "Προηγούμενη ανάρτηση"
-msgid "Also available in"
-msgstr "Διαθέσιμο και στα"
+msgid "Also available in:"
+msgstr "Διαθέσιμο και στα:"
msgid "Original site"
msgstr "Ιστοσελίδα αρχικής ανάρτησης"
@@ -78,8 +81,8 @@ msgstr "Παλαιότερες αναρτήσεις"
msgid "Archive"
msgstr "Αρχείο"
-msgid "Posted"
-msgstr "Αναρτήθηκε"
+msgid "Posted:"
+msgstr "Αναρτήθηκε:"
msgid "Posts for {month} {year}"
msgstr "Αναρτήσεις για τον {month} του {year}"
diff --git a/translations/nikola.messages/en.po b/translations/nikola.messages/en.po
index 3a03df3..be110d5 100644
--- a/translations/nikola.messages/en.po
+++ b/translations/nikola.messages/en.po
@@ -17,8 +17,8 @@ msgstr ""
"Language: en\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-msgid "More posts about"
-msgstr "More posts about"
+msgid "More posts about %s"
+msgstr "More posts about %s"
msgid "LANGUAGE"
msgstr "English"
@@ -41,8 +41,11 @@ msgstr "Posts about %s"
msgid "Next post"
msgstr "Next post"
-msgid "old posts page %d"
-msgstr "old posts page %d"
+msgid "old posts, page %d"
+msgstr "old posts, page %d"
+
+msgid "page %d"
+msgstr "page %d"
msgid "Source"
msgstr "Source"
@@ -60,8 +63,8 @@ msgstr "Newer posts"
msgid "Previous post"
msgstr "Previous post"
-msgid "Also available in"
-msgstr "Also available in"
+msgid "Also available in:"
+msgstr "Also available in:"
msgid "Original site"
msgstr "Original site"
@@ -72,14 +75,8 @@ msgstr "Older posts"
msgid "Archive"
msgstr "Archive"
-msgid "Posted"
-msgstr "Posted"
+msgid "Posted:"
+msgstr "Posted:"
msgid "Posts for {month} {year}"
msgstr "Posts for {month} {year}"
-
-msgid "No title"
-msgstr ""
-
-msgid "No content"
-msgstr ""
diff --git a/translations/nikola.messages/eo.po b/translations/nikola.messages/eo.po
index d21b63b..e3ee650 100644
--- a/translations/nikola.messages/eo.po
+++ b/translations/nikola.messages/eo.po
@@ -11,7 +11,7 @@ msgstr ""
"Project-Id-Version: Nikola\n"
"Report-Msgid-Bugs-To: ralsina@netmanagers.com.ar\n"
"POT-Creation-Date: 2013-03-15 12:24-0300\n"
-"PO-Revision-Date: 2013-10-25 09:00+0000\n"
+"PO-Revision-Date: 2014-01-22 13:11+0000\n"
"Last-Translator: Kwpolska <kwpolska@gmail.com>\n"
"Language-Team: Esperanto (http://www.transifex.com/projects/p/nikola/language/eo/)\n"
"MIME-Version: 1.0\n"
@@ -20,8 +20,8 @@ msgstr ""
"Language: eo\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-msgid "More posts about"
-msgstr "Pli artikoloj pri..."
+msgid "More posts about %s"
+msgstr "Pli artikoloj pri %s"
msgid "LANGUAGE"
msgstr "Anglalingve"
@@ -44,13 +44,16 @@ msgstr "Artikoloj pri %s"
msgid "Next post"
msgstr "Venonta artikolo"
-msgid "old posts page %d"
+msgid "old posts, page %d"
msgstr "paĝo de malnovaj artikoloj %d"
+msgid "page %d"
+msgstr "paĝo %d"
+
msgid "Source"
msgstr "Fonto"
-#. Here your translation should not say ENglish but the name of your language
+#. Here your translation should not say English but the name of your language
#. instead
msgid "Read in English"
msgstr "Legu ĝin en Esperanto"
@@ -64,8 +67,8 @@ msgstr "Pli novaj artikoloj"
msgid "Previous post"
msgstr "Antaŭa artikolo"
-msgid "Also available in"
-msgstr "Ankaŭ disponebla en"
+msgid "Also available in:"
+msgstr "Ankaŭ disponebla en:"
msgid "Original site"
msgstr "Originala interretejo"
@@ -76,8 +79,8 @@ msgstr "Pli malnovaj artikoloj"
msgid "Archive"
msgstr "Arĥivo"
-msgid "Posted"
-msgstr "Skribita"
+msgid "Posted:"
+msgstr "Skribita:"
msgid "Posts for {month} {year}"
msgstr "Artikoloj skribitaj en {month} {year}"
diff --git a/translations/nikola.messages/es.po b/translations/nikola.messages/es.po
index 76a6925..c25a23f 100644
--- a/translations/nikola.messages/es.po
+++ b/translations/nikola.messages/es.po
@@ -11,7 +11,7 @@ msgstr ""
"Project-Id-Version: Nikola\n"
"Report-Msgid-Bugs-To: ralsina@netmanagers.com.ar\n"
"POT-Creation-Date: 2013-03-15 12:24-0300\n"
-"PO-Revision-Date: 2013-10-25 09:00+0000\n"
+"PO-Revision-Date: 2014-01-22 13:13+0000\n"
"Last-Translator: Kwpolska <kwpolska@gmail.com>\n"
"Language-Team: Spanish (http://www.transifex.com/projects/p/nikola/language/es/)\n"
"MIME-Version: 1.0\n"
@@ -20,8 +20,8 @@ msgstr ""
"Language: es\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-msgid "More posts about"
-msgstr "Más posts sobre"
+msgid "More posts about %s"
+msgstr "Más posts sobre %s"
msgid "LANGUAGE"
msgstr "Español"
@@ -44,13 +44,16 @@ msgstr "Posts sobre %s"
msgid "Next post"
msgstr "Siguiente post"
-msgid "old posts page %d"
-msgstr "posts antiguos página %d"
+msgid "old posts, page %d"
+msgstr "posts antiguos, página %d"
+
+msgid "page %d"
+msgstr "página %d"
msgid "Source"
msgstr "Código"
-#. Here your translation should not say ENglish but the name of your language
+#. Here your translation should not say English but the name of your language
#. instead
msgid "Read in English"
msgstr "Leer en español"
@@ -64,8 +67,8 @@ msgstr "Posts posteriores"
msgid "Previous post"
msgstr "Post anterior"
-msgid "Also available in"
-msgstr "También disponible en"
+msgid "Also available in:"
+msgstr "También disponible en:"
msgid "Original site"
msgstr "Sitio original"
@@ -76,8 +79,8 @@ msgstr "Posts anteriores"
msgid "Archive"
msgstr "Archivo"
-msgid "Posted"
-msgstr "Publicado"
+msgid "Posted:"
+msgstr "Publicado:"
msgid "Posts for {month} {year}"
msgstr "Posts de {month} {year}"
diff --git a/translations/nikola.messages/et.po b/translations/nikola.messages/et.po
new file mode 100644
index 0000000..d4301ba
--- /dev/null
+++ b/translations/nikola.messages/et.po
@@ -0,0 +1,87 @@
+# Messages in Nikola
+# Copyright (C) 2012-2013
+# This file is distributed under the same license as the Nikola package.
+#
+# Translators:
+# Translators:
+# Kwpolska <kwpolska@gmail.com>, 2014
+# Kwpolska <kwpolska@gmail.com>, 2014
+# Lauri Võsandi <lauri.vosandi@gmail.com>, 2013
+msgid ""
+msgstr ""
+"Project-Id-Version: Nikola\n"
+"Report-Msgid-Bugs-To: ralsina@netmanagers.com.ar\n"
+"POT-Creation-Date: 2013-03-15 12:24-0300\n"
+"PO-Revision-Date: 2014-01-22 13:12+0000\n"
+"Last-Translator: Kwpolska <kwpolska@gmail.com>\n"
+"Language-Team: Estonian (http://www.transifex.com/projects/p/nikola/language/et/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: et\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgid "More posts about %s"
+msgstr "Veel postitusi %s kohta"
+
+msgid "LANGUAGE"
+msgstr "Eesti"
+
+msgid "Tags"
+msgstr "Märksõnad"
+
+msgid "Categories"
+msgstr "Kategooriad"
+
+msgid "Tags and Categories"
+msgstr "Sildid ja kategooriad"
+
+msgid "Read more"
+msgstr "Loe veel"
+
+msgid "Posts about %s"
+msgstr "Postitused %s kohta"
+
+msgid "Next post"
+msgstr "Järgmine postitus"
+
+msgid "old posts, page %d"
+msgstr "vanade postituste, leht %d"
+
+msgid "page %d"
+msgstr "leht %d"
+
+msgid "Source"
+msgstr "Lähtekood"
+
+#. Here your translation should not say English but the name of your language
+#. instead
+msgid "Read in English"
+msgstr "Loe eesti keeles"
+
+msgid "Posts for year %s"
+msgstr "Postitused aastast %s"
+
+msgid "Newer posts"
+msgstr "Uued postitused"
+
+msgid "Previous post"
+msgstr "Eelmine postitus"
+
+msgid "Also available in:"
+msgstr "Saadaval ka:"
+
+msgid "Original site"
+msgstr "Algallikas"
+
+msgid "Older posts"
+msgstr "Vanemad postitused"
+
+msgid "Archive"
+msgstr "Arhiiv"
+
+msgid "Posted:"
+msgstr "Postitatud:"
+
+msgid "Posts for {month} {year}"
+msgstr "Postitused {year} aasta kuust {month} "
diff --git a/translations/nikola.messages/eu.po b/translations/nikola.messages/eu.po
new file mode 100644
index 0000000..3447ee5
--- /dev/null
+++ b/translations/nikola.messages/eu.po
@@ -0,0 +1,86 @@
+# Messages in Nikola
+# Copyright (C) 2012-2013
+# This file is distributed under the same license as the Nikola package.
+#
+# Translators:
+# Translators:
+# aitorp <aitorp@gmail.com>, 2013
+# aitorp <aitorp@gmail.com>, 2013
+msgid ""
+msgstr ""
+"Project-Id-Version: Nikola\n"
+"Report-Msgid-Bugs-To: ralsina@netmanagers.com.ar\n"
+"POT-Creation-Date: 2013-03-15 12:24-0300\n"
+"PO-Revision-Date: 2014-01-22 13:12+0000\n"
+"Last-Translator: Kwpolska <kwpolska@gmail.com>\n"
+"Language-Team: Basque (http://www.transifex.com/projects/p/nikola/language/eu/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: eu\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgid "More posts about %s"
+msgstr "%s-ri buruzko post gehiago"
+
+msgid "LANGUAGE"
+msgstr "Euskara"
+
+msgid "Tags"
+msgstr "Etiketak"
+
+msgid "Categories"
+msgstr "Kategoriak"
+
+msgid "Tags and Categories"
+msgstr "Etiketak eta Kategoriak"
+
+msgid "Read more"
+msgstr "Irakurri gehiago"
+
+msgid "Posts about %s"
+msgstr "%s-ri buruzko postak"
+
+msgid "Next post"
+msgstr "Hurrengo posta"
+
+msgid "old posts, page %d"
+msgstr "Post zaharren, orria %d"
+
+msgid "page %d"
+msgstr "orria %d"
+
+msgid "Source"
+msgstr "Iturria"
+
+#. Here your translation should not say English but the name of your language
+#. instead
+msgid "Read in English"
+msgstr "Euskaraz irakurri"
+
+msgid "Posts for year %s"
+msgstr "%s. urteko postak"
+
+msgid "Newer posts"
+msgstr "Post berrienak"
+
+msgid "Previous post"
+msgstr "Aurreko posta"
+
+msgid "Also available in:"
+msgstr "Eskuragarria hemen ere:"
+
+msgid "Original site"
+msgstr "Jatorrizko orria"
+
+msgid "Older posts"
+msgstr "Post zaharrenak"
+
+msgid "Archive"
+msgstr "Artxiboa"
+
+msgid "Posted:"
+msgstr "Argitaratuta:"
+
+msgid "Posts for {month} {year}"
+msgstr "{year}ko {month}ren postak"
diff --git a/translations/nikola.messages/fa.po b/translations/nikola.messages/fa.po
index 7b0bc84..87a3d26 100644
--- a/translations/nikola.messages/fa.po
+++ b/translations/nikola.messages/fa.po
@@ -13,7 +13,7 @@ msgstr ""
"Project-Id-Version: Nikola\n"
"Report-Msgid-Bugs-To: ralsina@netmanagers.com.ar\n"
"POT-Creation-Date: 2013-03-15 12:24-0300\n"
-"PO-Revision-Date: 2013-10-25 09:00+0000\n"
+"PO-Revision-Date: 2014-01-22 13:12+0000\n"
"Last-Translator: Kwpolska <kwpolska@gmail.com>\n"
"Language-Team: Persian (http://www.transifex.com/projects/p/nikola/language/fa/)\n"
"MIME-Version: 1.0\n"
@@ -22,8 +22,8 @@ msgstr ""
"Language: fa\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-msgid "More posts about"
-msgstr "ارسال‌های بیشتر دربارهٔ"
+msgid "More posts about %s"
+msgstr "ارسال‌های بیشتر دربارهٔ%s"
msgid "LANGUAGE"
msgstr "فارسی"
@@ -46,13 +46,16 @@ msgstr "ارسال‌ها دربارهٔ %s"
msgid "Next post"
msgstr "ارسال بعدی"
-msgid "old posts page %d"
+msgid "old posts, page %d"
msgstr "صفحهٔ ارسال‌های قدیمی %d"
+msgid "page %d"
+msgstr ""
+
msgid "Source"
msgstr "منبع"
-#. Here your translation should not say ENglish but the name of your language
+#. Here your translation should not say English but the name of your language
#. instead
msgid "Read in English"
msgstr "به فارسی بخوانید"
@@ -66,8 +69,8 @@ msgstr "ارسال‌های جدید‌تر"
msgid "Previous post"
msgstr "ارسال پیشین"
-msgid "Also available in"
-msgstr "همچنین قابل دسترس از"
+msgid "Also available in:"
+msgstr "همچنین قابل دسترس از:"
msgid "Original site"
msgstr "سایت اصلی"
@@ -78,8 +81,8 @@ msgstr "پست‌های قدیمی‌تر"
msgid "Archive"
msgstr "آرشیو"
-msgid "Posted"
-msgstr "ارسال شده"
+msgid "Posted:"
+msgstr "ارسال شده:"
msgid "Posts for {month} {year}"
msgstr "ارسال برای {month} {year}"
diff --git a/translations/nikola.messages/fi.po b/translations/nikola.messages/fi.po
index 4949cf2..13e840e 100644
--- a/translations/nikola.messages/fi.po
+++ b/translations/nikola.messages/fi.po
@@ -11,7 +11,7 @@ msgstr ""
"Project-Id-Version: Nikola\n"
"Report-Msgid-Bugs-To: ralsina@netmanagers.com.ar\n"
"POT-Creation-Date: 2013-03-15 12:24-0300\n"
-"PO-Revision-Date: 2013-10-25 09:00+0000\n"
+"PO-Revision-Date: 2014-01-22 13:12+0000\n"
"Last-Translator: Kwpolska <kwpolska@gmail.com>\n"
"Language-Team: Finnish (http://www.transifex.com/projects/p/nikola/language/fi/)\n"
"MIME-Version: 1.0\n"
@@ -20,8 +20,8 @@ msgstr ""
"Language: fi\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-msgid "More posts about"
-msgstr "Lisää postauksia aiheesta"
+msgid "More posts about %s"
+msgstr "Lisää postauksia aiheesta %s"
msgid "LANGUAGE"
msgstr "Suomi"
@@ -44,13 +44,16 @@ msgstr "Postauksia aiheesta %s"
msgid "Next post"
msgstr "Seuraava postaus"
-msgid "old posts page %d"
-msgstr "vanhojen postauksien sivu %d"
+msgid "old posts, page %d"
+msgstr "vanhojen postauksien, sivu %d"
+
+msgid "page %d"
+msgstr "sivu %d"
msgid "Source"
msgstr "Lähde"
-#. Here your translation should not say ENglish but the name of your language
+#. Here your translation should not say English but the name of your language
#. instead
msgid "Read in English"
msgstr "Lue suomeksi"
@@ -64,8 +67,8 @@ msgstr "Uudempia postauksia"
msgid "Previous post"
msgstr "Vanhempia postauksia"
-msgid "Also available in"
-msgstr "Saatavilla myös"
+msgid "Also available in:"
+msgstr "Saatavilla myös:"
msgid "Original site"
msgstr "Alkuperäinen sivusto"
@@ -76,8 +79,8 @@ msgstr "Vanhempia postauksia"
msgid "Archive"
msgstr "Arkisto"
-msgid "Posted"
-msgstr "Postattu"
+msgid "Posted:"
+msgstr "Postattu:"
msgid "Posts for {month} {year}"
msgstr "Postauksia ajalle {month} {year}"
diff --git a/translations/nikola.messages/fr.po b/translations/nikola.messages/fr.po
index 35edf36..118f410 100644
--- a/translations/nikola.messages/fr.po
+++ b/translations/nikola.messages/fr.po
@@ -4,6 +4,9 @@
#
# Translators:
# Translators:
+# JohnPreston <john.mille78@gmail.com>, 2014
+# JohnPreston <john.mille78@gmail.com>, 2014
+# pabluk <pablo@seminar.io>, 2013
# pabluk <pablo@seminar.io>, 2013
# pabluk <pablo@seminar.io>, 2013
# ralsina <ralsina@netmanagers.com.ar>, 2013
@@ -13,7 +16,7 @@ msgstr ""
"Project-Id-Version: Nikola\n"
"Report-Msgid-Bugs-To: ralsina@netmanagers.com.ar\n"
"POT-Creation-Date: 2013-03-15 12:24-0300\n"
-"PO-Revision-Date: 2013-10-25 09:00+0000\n"
+"PO-Revision-Date: 2014-01-22 13:12+0000\n"
"Last-Translator: Kwpolska <kwpolska@gmail.com>\n"
"Language-Team: French (http://www.transifex.com/projects/p/nikola/language/fr/)\n"
"MIME-Version: 1.0\n"
@@ -22,8 +25,8 @@ msgstr ""
"Language: fr\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-msgid "More posts about"
-msgstr "Plus de billets sur"
+msgid "More posts about %s"
+msgstr "Plus d'articles sur %s"
msgid "LANGUAGE"
msgstr "Français"
@@ -41,45 +44,48 @@ msgid "Read more"
msgstr "Lire la suite"
msgid "Posts about %s"
-msgstr "Billets sur %s"
+msgstr "Articles sur %s"
msgid "Next post"
-msgstr "Billet suivant"
+msgstr "Article suivant"
+
+msgid "old posts, page %d"
+msgstr "anciens articles, page %d"
-msgid "old posts page %d"
-msgstr "anciens billets page %d"
+msgid "page %d"
+msgstr "page %d"
msgid "Source"
msgstr "Source"
-#. Here your translation should not say ENglish but the name of your language
+#. Here your translation should not say English but the name of your language
#. instead
msgid "Read in English"
msgstr "Lire en français"
msgid "Posts for year %s"
-msgstr "Billets de l'année %s"
+msgstr "Articles de l'année %s"
msgid "Newer posts"
msgstr "Billets récents"
msgid "Previous post"
-msgstr "Billet précédent"
+msgstr "Article précédent"
-msgid "Also available in"
-msgstr "Disponible aussi en"
+msgid "Also available in:"
+msgstr "Egalement disponible en:"
msgid "Original site"
msgstr "Site d'origine"
msgid "Older posts"
-msgstr "Anciens billets"
+msgstr "Anciens articles"
msgid "Archive"
msgstr "Archives"
-msgid "Posted"
-msgstr "Publié"
+msgid "Posted:"
+msgstr "Publié:"
msgid "Posts for {month} {year}"
-msgstr "Billets de {month} {year}"
+msgstr "Articles de {month} {year}"
diff --git a/translations/nikola.messages/hr.po b/translations/nikola.messages/hr.po
index ccdfe61..fba7ddc 100644
--- a/translations/nikola.messages/hr.po
+++ b/translations/nikola.messages/hr.po
@@ -11,7 +11,7 @@ msgstr ""
"Project-Id-Version: Nikola\n"
"Report-Msgid-Bugs-To: ralsina@netmanagers.com.ar\n"
"POT-Creation-Date: 2013-03-15 12:24-0300\n"
-"PO-Revision-Date: 2013-10-25 09:00+0000\n"
+"PO-Revision-Date: 2014-01-22 13:11+0000\n"
"Last-Translator: Kwpolska <kwpolska@gmail.com>\n"
"Language-Team: Croatian (http://www.transifex.com/projects/p/nikola/language/hr/)\n"
"MIME-Version: 1.0\n"
@@ -20,8 +20,8 @@ msgstr ""
"Language: hr\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
-msgid "More posts about"
-msgstr "Više postova o"
+msgid "More posts about %s"
+msgstr "Više postova o %s"
msgid "LANGUAGE"
msgstr "hrvatski"
@@ -30,10 +30,10 @@ msgid "Tags"
msgstr "Tagovi"
msgid "Categories"
-msgstr ""
+msgstr "Kategorije"
msgid "Tags and Categories"
-msgstr ""
+msgstr "Tagovi i kategorije"
msgid "Read more"
msgstr "Čitaj dalje"
@@ -44,13 +44,16 @@ msgstr "Postovi o %s"
msgid "Next post"
msgstr "Sljedeći post"
-msgid "old posts page %d"
-msgstr "stari postovi stranice %d"
+msgid "old posts, page %d"
+msgstr "stari postovi, stranice %d"
+
+msgid "page %d"
+msgstr "stranice %d"
msgid "Source"
msgstr "Izvor"
-#. Here your translation should not say ENglish but the name of your language
+#. Here your translation should not say English but the name of your language
#. instead
msgid "Read in English"
msgstr "Čitaj na hrvatskom"
@@ -64,8 +67,8 @@ msgstr "Noviji postovi"
msgid "Previous post"
msgstr "Prethodni post"
-msgid "Also available in"
-msgstr "Također dostupno i u"
+msgid "Also available in:"
+msgstr "Također dostupno i u:"
msgid "Original site"
msgstr "Izvorna stranica"
@@ -76,8 +79,8 @@ msgstr "Stariji postovi"
msgid "Archive"
msgstr "Arhiva"
-msgid "Posted"
-msgstr "Objavljeno"
+msgid "Posted:"
+msgstr "Objavljeno:"
msgid "Posts for {month} {year}"
msgstr "Postovi za {month} {year}"
diff --git a/translations/nikola.messages/it.po b/translations/nikola.messages/it.po
index cd24846..27f1e33 100644
--- a/translations/nikola.messages/it.po
+++ b/translations/nikola.messages/it.po
@@ -5,6 +5,7 @@
# Translators:
# Translators:
# Alessandro Pisa <alessandro.pisa@gmail.com>, 2013
+# David Paleino <d.paleino@gmail.com>, 2013
# ralsina <ralsina@netmanagers.com.ar>, 2013
# ralsina <ralsina@netmanagers.com.ar>, 2013
msgid ""
@@ -12,7 +13,7 @@ msgstr ""
"Project-Id-Version: Nikola\n"
"Report-Msgid-Bugs-To: ralsina@netmanagers.com.ar\n"
"POT-Creation-Date: 2013-03-15 12:24-0300\n"
-"PO-Revision-Date: 2013-10-25 09:00+0000\n"
+"PO-Revision-Date: 2014-01-22 13:11+0000\n"
"Last-Translator: Kwpolska <kwpolska@gmail.com>\n"
"Language-Team: Italian (http://www.transifex.com/projects/p/nikola/language/it/)\n"
"MIME-Version: 1.0\n"
@@ -21,8 +22,8 @@ msgstr ""
"Language: it\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-msgid "More posts about"
-msgstr "Altri articoli collegati"
+msgid "More posts about %s"
+msgstr "Altri articoli collegati %s"
msgid "LANGUAGE"
msgstr "Italiano"
@@ -45,13 +46,16 @@ msgstr "Articoli su %s"
msgid "Next post"
msgstr "Articolo successivo"
-msgid "old posts page %d"
+msgid "old posts, page %d"
msgstr "pagina dei vecchi articoli %d"
+msgid "page %d"
+msgstr "pagina %d"
+
msgid "Source"
msgstr "Sorgente"
-#. Here your translation should not say ENglish but the name of your language
+#. Here your translation should not say English but the name of your language
#. instead
msgid "Read in English"
msgstr "Leggi in italiano"
@@ -65,8 +69,8 @@ msgstr "Articoli recenti"
msgid "Previous post"
msgstr "Articolo precedente"
-msgid "Also available in"
-msgstr "Anche disponibile in"
+msgid "Also available in:"
+msgstr "Anche disponibile in:"
msgid "Original site"
msgstr "Sito originale"
@@ -77,8 +81,8 @@ msgstr "Articoli precedenti"
msgid "Archive"
msgstr "Archivio"
-msgid "Posted"
-msgstr "Pubblicato"
+msgid "Posted:"
+msgstr "Pubblicato:"
msgid "Posts for {month} {year}"
msgstr "Articoli per {month} {year}"
diff --git a/translations/nikola.messages/ja.po b/translations/nikola.messages/ja.po
index f95eb24..0bbeda3 100644
--- a/translations/nikola.messages/ja.po
+++ b/translations/nikola.messages/ja.po
@@ -4,6 +4,8 @@
#
# Translators:
# Translators:
+# Kwpolska <kwpolska@gmail.com>, 2013
+# Kwpolska <kwpolska@gmail.com>, 2013
# quoth <4wordextinguisher@gmail.com>, 2013
# ralsina <ralsina@netmanagers.com.ar>, 2013
# ralsina <ralsina@netmanagers.com.ar>, 2013
@@ -13,7 +15,7 @@ msgstr ""
"Project-Id-Version: Nikola\n"
"Report-Msgid-Bugs-To: ralsina@netmanagers.com.ar\n"
"POT-Creation-Date: 2013-03-15 12:24-0300\n"
-"PO-Revision-Date: 2013-10-25 09:00+0000\n"
+"PO-Revision-Date: 2014-01-22 13:12+0000\n"
"Last-Translator: Kwpolska <kwpolska@gmail.com>\n"
"Language-Team: Japanese (http://www.transifex.com/projects/p/nikola/language/ja/)\n"
"MIME-Version: 1.0\n"
@@ -22,8 +24,8 @@ msgstr ""
"Language: ja\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-msgid "More posts about"
-msgstr "タグ"
+msgid "More posts about %s"
+msgstr "タグ: %s"
msgid "LANGUAGE"
msgstr "日本語"
@@ -32,10 +34,10 @@ msgid "Tags"
msgstr "タグ"
msgid "Categories"
-msgstr ""
+msgstr "カテゴリー"
msgid "Tags and Categories"
-msgstr ""
+msgstr "タグとカテゴリー"
msgid "Read more"
msgstr "続きを読む"
@@ -46,13 +48,16 @@ msgstr "%sについての記事"
msgid "Next post"
msgstr "次の記事"
-msgid "old posts page %d"
+msgid "old posts, page %d"
msgstr "前の記事 %dページ目"
+msgid "page %d"
+msgstr ""
+
msgid "Source"
msgstr "ソース"
-#. Here your translation should not say ENglish but the name of your language
+#. Here your translation should not say English but the name of your language
#. instead
msgid "Read in English"
msgstr "日本語で読む"
@@ -66,8 +71,8 @@ msgstr "新しい記事"
msgid "Previous post"
msgstr "前の記事"
-msgid "Also available in"
-msgstr "他の言語で読む"
+msgid "Also available in:"
+msgstr "他の言語で読む:"
msgid "Original site"
msgstr "元のサイト"
@@ -78,8 +83,8 @@ msgstr "過去の記事"
msgid "Archive"
msgstr "過去の記事"
-msgid "Posted"
-msgstr "投稿日時"
+msgid "Posted:"
+msgstr "投稿日時:"
msgid "Posts for {month} {year}"
msgstr "{year}年{month}月の記事"
diff --git a/translations/nikola.messages/nb.po b/translations/nikola.messages/nb.po
new file mode 100644
index 0000000..1446d53
--- /dev/null
+++ b/translations/nikola.messages/nb.po
@@ -0,0 +1,85 @@
+# Messages in Nikola
+# Copyright (C) 2012-2013
+# This file is distributed under the same license as the Nikola package.
+#
+# Translators:
+# Translators:
+# Daniel <i18n@daniel.priv.no>, 2013
+msgid ""
+msgstr ""
+"Project-Id-Version: Nikola\n"
+"Report-Msgid-Bugs-To: ralsina@netmanagers.com.ar\n"
+"POT-Creation-Date: 2013-03-15 12:24-0300\n"
+"PO-Revision-Date: 2014-01-22 13:13+0000\n"
+"Last-Translator: Kwpolska <kwpolska@gmail.com>\n"
+"Language-Team: Norwegian Bokmål (http://www.transifex.com/projects/p/nikola/language/nb/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: nb\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgid "More posts about %s"
+msgstr "Flere innlegg om %s"
+
+msgid "LANGUAGE"
+msgstr "norsk"
+
+msgid "Tags"
+msgstr "Merker"
+
+msgid "Categories"
+msgstr "Kategorier"
+
+msgid "Tags and Categories"
+msgstr "Merker og kategorier"
+
+msgid "Read more"
+msgstr "Les mer"
+
+msgid "Posts about %s"
+msgstr "Innlegg om %s"
+
+msgid "Next post"
+msgstr "Neste innlegg"
+
+msgid "old posts, page %d"
+msgstr "eldre innlegg, side %d"
+
+msgid "page %d"
+msgstr "side %d"
+
+msgid "Source"
+msgstr "Kilde"
+
+#. Here your translation should not say English but the name of your language
+#. instead
+msgid "Read in English"
+msgstr "Les på norsk"
+
+msgid "Posts for year %s"
+msgstr "Innlegg fra %s"
+
+msgid "Newer posts"
+msgstr "Nyere innlegg"
+
+msgid "Previous post"
+msgstr "Forrige innlegg"
+
+msgid "Also available in:"
+msgstr "Også tilgjengelig på:"
+
+msgid "Original site"
+msgstr "Opprinnelig side"
+
+msgid "Older posts"
+msgstr "Eldre innlegg"
+
+msgid "Archive"
+msgstr "Arkiv"
+
+msgid "Posted:"
+msgstr "Publisert:"
+
+msgid "Posts for {month} {year}"
+msgstr "Innlegg fra {month} {year}"
diff --git a/translations/nikola.messages/nl.po b/translations/nikola.messages/nl.po
index 82291ca..32c0faf 100644
--- a/translations/nikola.messages/nl.po
+++ b/translations/nikola.messages/nl.po
@@ -5,14 +5,14 @@
# Translators:
# Translators:
# Joes <joes@staalkemade.net>, 2013
-# Joes <joes@staalkemade.net>, 2013
+# Joes <joes@staalkemade.net>, 2013-2014
msgid ""
msgstr ""
"Project-Id-Version: Nikola\n"
"Report-Msgid-Bugs-To: ralsina@netmanagers.com.ar\n"
"POT-Creation-Date: 2013-03-15 12:24-0300\n"
-"PO-Revision-Date: 2013-10-25 09:00+0000\n"
-"Last-Translator: Kwpolska <kwpolska@gmail.com>\n"
+"PO-Revision-Date: 2014-01-22 10:30+0000\n"
+"Last-Translator: Joes <joes@staalkemade.net>\n"
"Language-Team: Dutch (http://www.transifex.com/projects/p/nikola/language/nl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -20,8 +20,8 @@ msgstr ""
"Language: nl\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-msgid "More posts about"
-msgstr "Meer berichten over"
+msgid "More posts about %s"
+msgstr "Meer berichten over %s"
msgid "LANGUAGE"
msgstr "Nederlands"
@@ -44,13 +44,16 @@ msgstr "Berichten over %s"
msgid "Next post"
msgstr "Volgend bericht"
-msgid "old posts page %d"
-msgstr "oude berichten pagina %d"
+msgid "old posts, page %d"
+msgstr "oude berichten, pagina %d"
+
+msgid "page %d"
+msgstr "pagina %d"
msgid "Source"
msgstr "Bron"
-#. Here your translation should not say ENglish but the name of your language
+#. Here your translation should not say English but the name of your language
#. instead
msgid "Read in English"
msgstr "Lees in het Nederlands"
@@ -64,8 +67,8 @@ msgstr "Nieuwere berichten"
msgid "Previous post"
msgstr "Vorig bericht"
-msgid "Also available in"
-msgstr "Ook beschikbaar in"
+msgid "Also available in:"
+msgstr "Ook beschikbaar in:"
msgid "Original site"
msgstr "Originele site"
@@ -76,8 +79,8 @@ msgstr "Oudere berichten"
msgid "Archive"
msgstr "Archief"
-msgid "Posted"
-msgstr "Geplaatst"
+msgid "Posted:"
+msgstr "Geplaatst:"
msgid "Posts for {month} {year}"
msgstr "Berichten voor {month} {year}"
diff --git a/translations/nikola.messages/pl.po b/translations/nikola.messages/pl.po
index 5b073c4..02048dc 100644
--- a/translations/nikola.messages/pl.po
+++ b/translations/nikola.messages/pl.po
@@ -6,6 +6,7 @@
# Translators:
# Kwpolska <kwpolska@gmail.com>, 2013
# Kwpolska <kwpolska@gmail.com>, 2013
+# Kwpolska <kwpolska@gmail.com>, 2013
# ralsina <ralsina@netmanagers.com.ar>, 2013
# ralsina <ralsina@netmanagers.com.ar>, 2013
msgid ""
@@ -13,7 +14,7 @@ msgstr ""
"Project-Id-Version: Nikola\n"
"Report-Msgid-Bugs-To: ralsina@netmanagers.com.ar\n"
"POT-Creation-Date: 2013-03-15 12:24-0300\n"
-"PO-Revision-Date: 2013-10-25 09:00+0000\n"
+"PO-Revision-Date: 2014-01-22 13:13+0000\n"
"Last-Translator: Kwpolska <kwpolska@gmail.com>\n"
"Language-Team: Polish (http://www.transifex.com/projects/p/nikola/language/pl/)\n"
"MIME-Version: 1.0\n"
@@ -22,8 +23,8 @@ msgstr ""
"Language: pl\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
-msgid "More posts about"
-msgstr "Więcej postów o"
+msgid "More posts about %s"
+msgstr "Więcej postów o %s"
msgid "LANGUAGE"
msgstr "polski"
@@ -46,13 +47,16 @@ msgstr "Posty o %s"
msgid "Next post"
msgstr "Następny post"
-msgid "old posts page %d"
+msgid "old posts, page %d"
msgstr "stare posty, strona %d"
+msgid "page %d"
+msgstr "strona %d"
+
msgid "Source"
msgstr "Źródło"
-#. Here your translation should not say ENglish but the name of your language
+#. Here your translation should not say English but the name of your language
#. instead
msgid "Read in English"
msgstr "Czytaj po polsku"
@@ -66,8 +70,8 @@ msgstr "Nowsze posty"
msgid "Previous post"
msgstr "Poprzedni post"
-msgid "Also available in"
-msgstr "Również dostępny w"
+msgid "Also available in:"
+msgstr "Również dostępny w językach:"
msgid "Original site"
msgstr "Oryginalna strona"
@@ -78,8 +82,8 @@ msgstr "Starsze posty"
msgid "Archive"
msgstr "Archiwum"
-msgid "Posted"
-msgstr "Opublikowany"
+msgid "Posted:"
+msgstr "Opublikowano:"
msgid "Posts for {month} {year}"
msgstr "Posty z {month} {year}"
diff --git a/translations/nikola.messages/pt_BR.po b/translations/nikola.messages/pt_BR.po
index f2b1556..c741862 100644
--- a/translations/nikola.messages/pt_BR.po
+++ b/translations/nikola.messages/pt_BR.po
@@ -15,7 +15,7 @@ msgstr ""
"Project-Id-Version: Nikola\n"
"Report-Msgid-Bugs-To: ralsina@netmanagers.com.ar\n"
"POT-Creation-Date: 2013-03-15 12:24-0300\n"
-"PO-Revision-Date: 2013-10-25 09:00+0000\n"
+"PO-Revision-Date: 2014-01-22 13:11+0000\n"
"Last-Translator: Kwpolska <kwpolska@gmail.com>\n"
"Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/nikola/language/pt_BR/)\n"
"MIME-Version: 1.0\n"
@@ -24,8 +24,8 @@ msgstr ""
"Language: pt_BR\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-msgid "More posts about"
-msgstr "Mais posts sobre"
+msgid "More posts about %s"
+msgstr "Mais posts sobre %s"
msgid "LANGUAGE"
msgstr "Português"
@@ -48,13 +48,16 @@ msgstr "Posts sobre %s"
msgid "Next post"
msgstr "Próximo post"
-msgid "old posts page %d"
-msgstr "Posts antigos página %d"
+msgid "old posts, page %d"
+msgstr "Posts antigos, página %d"
+
+msgid "page %d"
+msgstr "página %d"
msgid "Source"
msgstr "Código"
-#. Here your translation should not say ENglish but the name of your language
+#. Here your translation should not say English but the name of your language
#. instead
msgid "Read in English"
msgstr "Ler em português"
@@ -68,8 +71,8 @@ msgstr "Posts mais recentes"
msgid "Previous post"
msgstr "Post anterior"
-msgid "Also available in"
-msgstr "Também disponível em"
+msgid "Also available in:"
+msgstr "Também disponível em:"
msgid "Original site"
msgstr "Site original"
@@ -80,8 +83,8 @@ msgstr "Posts mais antigos"
msgid "Archive"
msgstr "Arquivo"
-msgid "Posted"
-msgstr "Publicado"
+msgid "Posted:"
+msgstr "Publicado:"
msgid "Posts for {month} {year}"
msgstr "Posts de {month} {year}"
diff --git a/translations/nikola.messages/ru.po b/translations/nikola.messages/ru.po
index 981b085..1b8904f 100644
--- a/translations/nikola.messages/ru.po
+++ b/translations/nikola.messages/ru.po
@@ -13,7 +13,7 @@ msgstr ""
"Project-Id-Version: Nikola\n"
"Report-Msgid-Bugs-To: ralsina@netmanagers.com.ar\n"
"POT-Creation-Date: 2013-03-15 12:24-0300\n"
-"PO-Revision-Date: 2013-10-25 09:00+0000\n"
+"PO-Revision-Date: 2014-01-22 13:13+0000\n"
"Last-Translator: Kwpolska <kwpolska@gmail.com>\n"
"Language-Team: Russian (http://www.transifex.com/projects/p/nikola/language/ru/)\n"
"MIME-Version: 1.0\n"
@@ -22,8 +22,8 @@ msgstr ""
"Language: ru\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
-msgid "More posts about"
-msgstr "Больше записей о"
+msgid "More posts about %s"
+msgstr "Больше записей о %s"
msgid "LANGUAGE"
msgstr "Русский"
@@ -46,13 +46,16 @@ msgstr "Записи о %s"
msgid "Next post"
msgstr "Следующая запись"
-msgid "old posts page %d"
+msgid "old posts, page %d"
msgstr "%d страница со старыми записями"
+msgid "page %d"
+msgstr "%d страница"
+
msgid "Source"
msgstr "Источник"
-#. Here your translation should not say ENglish but the name of your language
+#. Here your translation should not say English but the name of your language
#. instead
msgid "Read in English"
msgstr "Прочесть по-русски"
@@ -66,8 +69,8 @@ msgstr "Новые записи"
msgid "Previous post"
msgstr "Предыдущая запись"
-msgid "Also available in"
-msgstr "Также доступно на"
+msgid "Also available in:"
+msgstr "Также доступно на:"
msgid "Original site"
msgstr "Оригинальный сайт"
@@ -78,8 +81,8 @@ msgstr "Старые записи"
msgid "Archive"
msgstr "Архив"
-msgid "Posted"
-msgstr "Опубликовано"
+msgid "Posted:"
+msgstr "Опубликовано:"
msgid "Posts for {month} {year}"
msgstr "Записи за {month} {year}"
diff --git a/translations/nikola.messages/sl.po b/translations/nikola.messages/sl.po
index 19fb3b1..2e78b4c 100644
--- a/translations/nikola.messages/sl.po
+++ b/translations/nikola.messages/sl.po
@@ -5,14 +5,14 @@
# Translators:
# Translators:
# Venčeslav Vezjak <vezjakv@gmail.com>, 2013
-# Venčeslav Vezjak <vezjakv@gmail.com>, 2013
+# Venčeslav Vezjak <vezjakv@gmail.com>, 2013-2014
msgid ""
msgstr ""
"Project-Id-Version: Nikola\n"
"Report-Msgid-Bugs-To: ralsina@netmanagers.com.ar\n"
"POT-Creation-Date: 2013-03-15 12:24-0300\n"
-"PO-Revision-Date: 2013-10-25 09:00+0000\n"
-"Last-Translator: Kwpolska <kwpolska@gmail.com>\n"
+"PO-Revision-Date: 2014-01-22 10:36+0000\n"
+"Last-Translator: Venčeslav Vezjak <vezjakv@gmail.com>\n"
"Language-Team: Slovenian (http://www.transifex.com/projects/p/nikola/language/sl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -20,8 +20,8 @@ msgstr ""
"Language: sl\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n"
-msgid "More posts about"
-msgstr "Več objav o"
+msgid "More posts about %s"
+msgstr "Več objav o %s"
msgid "LANGUAGE"
msgstr "Slovenščina"
@@ -44,13 +44,16 @@ msgstr "Objave o %s"
msgid "Next post"
msgstr "Naslednja objava"
-msgid "old posts page %d"
+msgid "old posts, page %d"
msgstr "stare objave, stran %d"
+msgid "page %d"
+msgstr "stran %d"
+
msgid "Source"
msgstr "Izvor"
-#. Here your translation should not say ENglish but the name of your language
+#. Here your translation should not say English but the name of your language
#. instead
msgid "Read in English"
msgstr "Beri v slovenščini"
@@ -64,8 +67,8 @@ msgstr "Novejše objave"
msgid "Previous post"
msgstr "Prejšnja objava"
-msgid "Also available in"
-msgstr "Na voljo tudi v"
+msgid "Also available in:"
+msgstr "Na voljo tudi v:"
msgid "Original site"
msgstr "Izvorna spletna stran"
@@ -76,8 +79,8 @@ msgstr "Starejše objave"
msgid "Archive"
msgstr "Arhiv"
-msgid "Posted"
-msgstr "Objavljeno"
+msgid "Posted:"
+msgstr "Objavljeno:"
msgid "Posts for {month} {year}"
msgstr "Objave za {month} {year}"
diff --git a/translations/nikola.messages/tr_TR.po b/translations/nikola.messages/tr_TR.po
index adab203..22bece3 100644
--- a/translations/nikola.messages/tr_TR.po
+++ b/translations/nikola.messages/tr_TR.po
@@ -12,7 +12,7 @@ msgstr ""
"Project-Id-Version: Nikola\n"
"Report-Msgid-Bugs-To: ralsina@netmanagers.com.ar\n"
"POT-Creation-Date: 2013-03-15 12:24-0300\n"
-"PO-Revision-Date: 2013-10-25 09:00+0000\n"
+"PO-Revision-Date: 2014-01-22 13:12+0000\n"
"Last-Translator: Kwpolska <kwpolska@gmail.com>\n"
"Language-Team: Turkish (Turkey) (http://www.transifex.com/projects/p/nikola/language/tr_TR/)\n"
"MIME-Version: 1.0\n"
@@ -21,8 +21,8 @@ msgstr ""
"Language: tr_TR\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-msgid "More posts about"
-msgstr "ilgili diğer yazılar"
+msgid "More posts about %s"
+msgstr "%s ilgili diğer yazılar"
msgid "LANGUAGE"
msgstr "Türkçe"
@@ -45,13 +45,16 @@ msgstr "%s ile ilgili yazılar"
msgid "Next post"
msgstr "Sonraki yazı"
-msgid "old posts page %d"
-msgstr "eski yazılar sayfa %d"
+msgid "old posts, page %d"
+msgstr "eski yazılar, sayfa %d"
+
+msgid "page %d"
+msgstr "sayfa %d"
msgid "Source"
msgstr "Kaynak"
-#. Here your translation should not say ENglish but the name of your language
+#. Here your translation should not say English but the name of your language
#. instead
msgid "Read in English"
msgstr "Türkçe olarak oku"
@@ -65,7 +68,7 @@ msgstr "Daha yeni yazılar"
msgid "Previous post"
msgstr "Önceki yazı"
-msgid "Also available in"
+msgid "Also available in:"
msgstr "Şu dilde de mevcut:"
msgid "Original site"
@@ -77,8 +80,8 @@ msgstr "Daha eski yazılar"
msgid "Archive"
msgstr "Arşiv"
-msgid "Posted"
-msgstr "Yayın tarihi"
+msgid "Posted:"
+msgstr "Yayın tarihi:"
msgid "Posts for {month} {year}"
msgstr "{month} {year} göre yazılar"
diff --git a/translations/nikola.messages/ur.po b/translations/nikola.messages/ur.po
new file mode 100644
index 0000000..c5ff9fd
--- /dev/null
+++ b/translations/nikola.messages/ur.po
@@ -0,0 +1,87 @@
+# Messages in Nikola
+# Copyright (C) 2012-2013
+# This file is distributed under the same license as the Nikola package.
+#
+# Translators:
+# Translators:
+# saadat, 2013
+# saadat <nastaliq@gmail.com>, 2013
+# saadat <nastaliq@gmail.com>, 2013
+msgid ""
+msgstr ""
+"Project-Id-Version: Nikola\n"
+"Report-Msgid-Bugs-To: ralsina@netmanagers.com.ar\n"
+"POT-Creation-Date: 2013-03-15 12:24-0300\n"
+"PO-Revision-Date: 2014-01-22 13:13+0000\n"
+"Last-Translator: Kwpolska <kwpolska@gmail.com>\n"
+"Language-Team: Urdu (http://www.transifex.com/projects/p/nikola/language/ur/)\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Language: ur\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+msgid "More posts about %s"
+msgstr "%s کے بارے میں مزید تحاریر"
+
+msgid "LANGUAGE"
+msgstr "اردو"
+
+msgid "Tags"
+msgstr "ٹیگز"
+
+msgid "Categories"
+msgstr "زمرے"
+
+msgid "Tags and Categories"
+msgstr "ٹیگز اور زمرے"
+
+msgid "Read more"
+msgstr "مزید پڑھیے"
+
+msgid "Posts about %s"
+msgstr "%s کے بارے میں تحاریر"
+
+msgid "Next post"
+msgstr "اگلی تحریر"
+
+msgid "old posts, page %d"
+msgstr "پرانی تحاریر صفحہ %d"
+
+msgid "page %d"
+msgstr ""
+
+msgid "Source"
+msgstr "سورس"
+
+#. Here your translation should not say English but the name of your language
+#. instead
+msgid "Read in English"
+msgstr "اردو میں پڑھیے"
+
+msgid "Posts for year %s"
+msgstr "سال %s کی تحاریر"
+
+msgid "Newer posts"
+msgstr "نئی تحاریر"
+
+msgid "Previous post"
+msgstr "پچھلی تحریر"
+
+msgid "Also available in:"
+msgstr "ان زبانوں میں بھی دستیاب:"
+
+msgid "Original site"
+msgstr "اصلی سائٹ"
+
+msgid "Older posts"
+msgstr "پرانی تحاریر"
+
+msgid "Archive"
+msgstr "آرکائیو"
+
+msgid "Posted:"
+msgstr "اشاعت:"
+
+msgid "Posts for {month} {year}"
+msgstr "{month} {year} کی تحاریر"
diff --git a/translations/nikola.messages/zh_CN.po b/translations/nikola.messages/zh_CN.po
index f96b7a0..c1e37f7 100644
--- a/translations/nikola.messages/zh_CN.po
+++ b/translations/nikola.messages/zh_CN.po
@@ -4,6 +4,7 @@
#
# Translators:
# Translators:
+# Christopher Meng <cickumqt@gmail.com>, 2013
# kadefor <kadefor@gmail.com>, 2013
# kadefor <kadefor@gmail.com>, 2013
# ralsina <ralsina@netmanagers.com.ar>, 2013
@@ -13,7 +14,7 @@ msgstr ""
"Project-Id-Version: Nikola\n"
"Report-Msgid-Bugs-To: ralsina@netmanagers.com.ar\n"
"POT-Creation-Date: 2013-03-15 12:24-0300\n"
-"PO-Revision-Date: 2013-10-25 09:00+0000\n"
+"PO-Revision-Date: 2014-01-22 13:13+0000\n"
"Last-Translator: Kwpolska <kwpolska@gmail.com>\n"
"Language-Team: Chinese (China) (http://www.transifex.com/projects/p/nikola/language/zh_CN/)\n"
"MIME-Version: 1.0\n"
@@ -22,8 +23,8 @@ msgstr ""
"Language: zh_CN\n"
"Plural-Forms: nplurals=1; plural=0;\n"
-msgid "More posts about"
-msgstr "更多相关文章:"
+msgid "More posts about %s"
+msgstr "更多相关文章: %s"
msgid "LANGUAGE"
msgstr "简体中文"
@@ -32,10 +33,10 @@ msgid "Tags"
msgstr "标签"
msgid "Categories"
-msgstr ""
+msgstr "分类"
msgid "Tags and Categories"
-msgstr ""
+msgstr "标签和分类"
msgid "Read more"
msgstr "更多"
@@ -46,13 +47,16 @@ msgstr "文章分类:%s"
msgid "Next post"
msgstr "后一篇"
-msgid "old posts page %d"
+msgid "old posts, page %d"
msgstr "旧文章页 %d"
+msgid "page %d"
+msgstr ""
+
msgid "Source"
msgstr "源代码"
-#. Here your translation should not say ENglish but the name of your language
+#. Here your translation should not say English but the name of your language
#. instead
msgid "Read in English"
msgstr "中文版"
@@ -66,8 +70,8 @@ msgstr "新一篇"
msgid "Previous post"
msgstr "前一篇"
-msgid "Also available in"
-msgstr "其他语言版本"
+msgid "Also available in:"
+msgstr "其他语言版本:"
msgid "Original site"
msgstr "原文地址"
@@ -78,8 +82,8 @@ msgstr "旧一篇"
msgid "Archive"
msgstr "文章存档"
-msgid "Posted"
-msgstr "发表于"
+msgid "Posted:"
+msgstr "发表于:"
msgid "Posts for {month} {year}"
msgstr "{year}年{month}月文章"