From b0b24795b24ee6809397fbbadf42f31f310a219f Mon Sep 17 00:00:00 2001 From: Agustin Henze Date: Wed, 8 Jul 2015 07:35:02 -0300 Subject: Imported Upstream version 7.6.0 --- nikola/__init__.py | 4 +- nikola/__main__.py | 108 ++- nikola/conf.py.in | 359 ++++++-- nikola/data/samplesite/README.txt | 6 +- nikola/data/samplesite/posts/1.rst | 21 +- nikola/data/samplesite/stories/1.rst | 4 +- nikola/data/samplesite/stories/bootstrap-demo.rst | 2 +- nikola/data/samplesite/stories/upgrading-to-v6.txt | 1 - nikola/data/symlink-test-link.txt | 1 + nikola/data/symlink-test-orig.txt | 4 + nikola/data/symlinked.txt | 36 +- .../themes/base-jinja/templates/archiveindex.tmpl | 13 + nikola/data/themes/base-jinja/templates/base.tmpl | 2 +- .../themes/base-jinja/templates/base_header.tmpl | 6 +- .../themes/base-jinja/templates/base_helper.tmpl | 31 +- .../templates/comments_helper_disqus.tmpl | 12 +- .../data/themes/base-jinja/templates/crumbs.tmpl | 8 +- .../data/themes/base-jinja/templates/gallery.tmpl | 7 +- nikola/data/themes/base-jinja/templates/index.tmpl | 12 +- .../themes/base-jinja/templates/list_post.tmpl | 2 +- nikola/data/themes/base-jinja/templates/post.tmpl | 11 +- .../themes/base-jinja/templates/post_header.tmpl | 8 +- .../themes/base-jinja/templates/post_helper.tmpl | 37 +- .../base-jinja/templates/post_list_directive.tmpl | 2 +- nikola/data/themes/base-jinja/templates/tag.tmpl | 15 +- .../data/themes/base-jinja/templates/tagindex.tmpl | 22 + nikola/data/themes/base-jinja/templates/tags.tmpl | 26 +- .../data/themes/base/assets/css/nikola_ipython.css | 116 +++ nikola/data/themes/base/assets/css/rst.css | 2 +- nikola/data/themes/base/assets/css/theme.css | 115 ++- nikola/data/themes/base/assets/js/fancydates.js | 20 + nikola/data/themes/base/assets/js/mathjax.js | 7 +- nikola/data/themes/base/assets/xml/atom.xsl | 28 + nikola/data/themes/base/assets/xml/rss.xsl | 28 + nikola/data/themes/base/messages/messages_ar.py | 49 +- nikola/data/themes/base/messages/messages_az.py | 39 + nikola/data/themes/base/messages/messages_bg.py | 5 + nikola/data/themes/base/messages/messages_ca.py | 27 +- nikola/data/themes/base/messages/messages_cs.py | 7 +- nikola/data/themes/base/messages/messages_da.py | 63 +- nikola/data/themes/base/messages/messages_de.py | 7 +- nikola/data/themes/base/messages/messages_el.py | 15 +- nikola/data/themes/base/messages/messages_en.py | 5 + nikola/data/themes/base/messages/messages_eo.py | 5 + nikola/data/themes/base/messages/messages_es.py | 37 +- nikola/data/themes/base/messages/messages_et.py | 5 + nikola/data/themes/base/messages/messages_eu.py | 5 + nikola/data/themes/base/messages/messages_fa.py | 9 +- nikola/data/themes/base/messages/messages_fi.py | 9 +- nikola/data/themes/base/messages/messages_fil.py | 39 + nikola/data/themes/base/messages/messages_fr.py | 11 +- nikola/data/themes/base/messages/messages_gl.py | 5 + nikola/data/themes/base/messages/messages_hi.py | 21 +- nikola/data/themes/base/messages/messages_hr.py | 5 + nikola/data/themes/base/messages/messages_id.py | 39 + nikola/data/themes/base/messages/messages_it.py | 25 +- nikola/data/themes/base/messages/messages_ja.py | 9 +- nikola/data/themes/base/messages/messages_ko.py | 39 + nikola/data/themes/base/messages/messages_nb.py | 5 + nikola/data/themes/base/messages/messages_nl.py | 5 + nikola/data/themes/base/messages/messages_pl.py | 5 + nikola/data/themes/base/messages/messages_pt.py | 5 + nikola/data/themes/base/messages/messages_pt_br.py | 7 +- nikola/data/themes/base/messages/messages_ru.py | 7 +- nikola/data/themes/base/messages/messages_si_lk.py | 5 + nikola/data/themes/base/messages/messages_sk.py | 7 +- nikola/data/themes/base/messages/messages_sl.py | 5 + nikola/data/themes/base/messages/messages_sr.py | 39 + nikola/data/themes/base/messages/messages_sv.py | 39 + nikola/data/themes/base/messages/messages_tl.py | 39 + nikola/data/themes/base/messages/messages_tr.py | 9 +- nikola/data/themes/base/messages/messages_uk.py | 39 + nikola/data/themes/base/messages/messages_ur.py | 11 +- nikola/data/themes/base/messages/messages_zh_cn.py | 5 + nikola/data/themes/base/messages/messages_zh_tw.py | 39 + .../data/themes/base/templates/archiveindex.tmpl | 13 + nikola/data/themes/base/templates/base.tmpl | 2 +- nikola/data/themes/base/templates/base_header.tmpl | 6 +- nikola/data/themes/base/templates/base_helper.tmpl | 33 +- .../base/templates/comments_helper_disqus.tmpl | 14 +- nikola/data/themes/base/templates/crumbs.tmpl | 8 +- nikola/data/themes/base/templates/gallery.tmpl | 7 +- nikola/data/themes/base/templates/index.tmpl | 12 +- nikola/data/themes/base/templates/list_post.tmpl | 2 +- nikola/data/themes/base/templates/post.tmpl | 11 +- nikola/data/themes/base/templates/post_header.tmpl | 8 +- nikola/data/themes/base/templates/post_helper.tmpl | 37 +- .../themes/base/templates/post_list_directive.tmpl | 2 +- nikola/data/themes/base/templates/tag.tmpl | 15 +- nikola/data/themes/base/templates/tagindex.tmpl | 22 + nikola/data/themes/base/templates/tags.tmpl | 26 +- nikola/data/themes/bootstrap-jinja/README.md | 2 +- .../themes/bootstrap-jinja/assets/css/theme.css | 206 ++++- .../assets/js/colorbox-i18n/jquery.colorbox-bn.js | 1 + .../js/colorbox-i18n/jquery.colorbox-pt-BR.js | 1 + .../js/colorbox-i18n/jquery.colorbox-pt-br.js | 1 - .../bootstrap-jinja/assets/js/flowr.plugin.js | 266 +++++- .../themes/bootstrap-jinja/assets/js/jquery.js | 1 + .../themes/bootstrap-jinja/templates/base.tmpl | 14 +- .../bootstrap-jinja/templates/base_helper.tmpl | 34 +- .../templates/bootstrap_helper.tmpl | 78 -- .../themes/bootstrap-jinja/templates/gallery.tmpl | 3 +- .../themes/bootstrap-jinja/templates/post.tmpl | 9 +- .../bootstrap-jinja/templates/post_header.tmpl | 40 - .../themes/bootstrap-jinja/templates/tags.tmpl | 26 +- nikola/data/themes/bootstrap/README.md | 2 +- nikola/data/themes/bootstrap/assets/css/theme.css | 48 +- .../assets/js/colorbox-i18n/jquery.colorbox-bn.js | 1 + .../js/colorbox-i18n/jquery.colorbox-pt-BR.js | 1 + .../js/colorbox-i18n/jquery.colorbox-pt-br.js | 1 - nikola/data/themes/bootstrap/assets/js/jquery.js | 1 + nikola/data/themes/bootstrap/bundles | 4 +- nikola/data/themes/bootstrap/templates/base.tmpl | 14 +- .../themes/bootstrap/templates/base_helper.tmpl | 34 +- .../data/themes/bootstrap/templates/gallery.tmpl | 3 +- nikola/data/themes/bootstrap/templates/post.tmpl | 9 +- nikola/data/themes/bootstrap/templates/tags.tmpl | 26 +- .../themes/bootstrap3-jinja/assets/css/docs.css | 161 +++- .../assets/css/images/ie6/borderBottomCenter.png | Bin 70 -> 111 bytes .../assets/css/images/ie6/borderBottomLeft.png | Bin 68 -> 215 bytes .../assets/css/images/ie6/borderBottomRight.png | Bin 69 -> 217 bytes .../assets/css/images/ie6/borderMiddleLeft.png | Bin 68 -> 108 bytes .../assets/css/images/ie6/borderMiddleRight.png | Bin 69 -> 108 bytes .../assets/css/images/ie6/borderTopCenter.png | Bin 67 -> 111 bytes .../assets/css/images/ie6/borderTopLeft.png | Bin 65 -> 216 bytes .../assets/css/images/ie6/borderTopRight.png | Bin 66 -> 214 bytes .../themes/bootstrap3-jinja/assets/css/rst.css | 1 - .../themes/bootstrap3-jinja/assets/css/theme.css | 214 ++++- .../fonts/glyphicons-halflings-regular.woff2 | 1 + .../themes/bootstrap3-jinja/templates/base.tmpl | 16 +- .../bootstrap3-jinja/templates/base_helper.tmpl | 36 +- .../themes/bootstrap3-jinja/templates/gallery.tmpl | 6 +- nikola/data/themes/bootstrap3/assets/css/rst.css | 318 ------- nikola/data/themes/bootstrap3/assets/css/theme.css | 60 +- .../fonts/glyphicons-halflings-regular.woff2 | 1 + nikola/data/themes/bootstrap3/bundles | 4 +- nikola/data/themes/bootstrap3/templates/base.tmpl | 16 +- .../themes/bootstrap3/templates/base_helper.tmpl | 36 +- .../data/themes/bootstrap3/templates/gallery.tmpl | 6 +- nikola/filters.py | 84 +- nikola/image_processing.py | 111 +++ nikola/nikola.py | 971 ++++++++++++++++----- nikola/packages/__init__.py | 1 + nikola/packages/tzlocal/darwin.py | 13 +- nikola/packages/tzlocal/unix.py | 2 +- nikola/plugin_categories.py | 79 +- nikola/plugins/basic_import.py | 29 +- nikola/plugins/command/__init__.py | 2 +- nikola/plugins/command/auto.plugin | 2 +- nikola/plugins/command/auto.py | 87 -- nikola/plugins/command/auto/__init__.py | 366 ++++++++ nikola/plugins/command/auto/livereload.js | 1 + nikola/plugins/command/bootswatch_theme.plugin | 2 +- nikola/plugins/command/bootswatch_theme.py | 20 +- nikola/plugins/command/check.plugin | 2 +- nikola/plugins/command/check.py | 134 ++- nikola/plugins/command/console.plugin | 2 +- nikola/plugins/command/console.py | 6 +- nikola/plugins/command/deploy.plugin | 2 +- nikola/plugins/command/deploy.py | 39 +- nikola/plugins/command/github_deploy.plugin | 2 +- nikola/plugins/command/github_deploy.py | 220 +---- nikola/plugins/command/import_wordpress.plugin | 2 +- nikola/plugins/command/import_wordpress.py | 157 ++-- nikola/plugins/command/init.plugin | 2 +- nikola/plugins/command/init.py | 87 +- nikola/plugins/command/install_theme.plugin | 2 +- nikola/plugins/command/install_theme.py | 76 +- nikola/plugins/command/new_page.plugin | 2 +- nikola/plugins/command/new_page.py | 30 +- nikola/plugins/command/new_post.plugin | 2 +- nikola/plugins/command/new_post.py | 188 +++- nikola/plugins/command/orphans.plugin | 2 +- nikola/plugins/command/orphans.py | 2 +- nikola/plugins/command/plugin.plugin | 2 +- nikola/plugins/command/plugin.py | 43 +- nikola/plugins/command/rst2html.plugin | 9 + nikola/plugins/command/rst2html/__init__.py | 69 ++ nikola/plugins/command/rst2html/rst2html.tmpl | 13 + nikola/plugins/command/serve.plugin | 2 +- nikola/plugins/command/serve.py | 44 +- nikola/plugins/command/status.plugin | 9 + nikola/plugins/command/status.py | 140 +++ nikola/plugins/command/version.plugin | 2 +- nikola/plugins/command/version.py | 27 +- nikola/plugins/compile/__init__.py | 2 +- nikola/plugins/compile/html.plugin | 2 +- nikola/plugins/compile/html.py | 8 +- nikola/plugins/compile/ipynb.plugin | 8 +- nikola/plugins/compile/ipynb.py | 150 ++++ nikola/plugins/compile/ipynb/README.txt | 44 - nikola/plugins/compile/ipynb/__init__.py | 97 -- nikola/plugins/compile/markdown.plugin | 2 +- nikola/plugins/compile/markdown/__init__.py | 12 +- nikola/plugins/compile/markdown/mdx_gist.py | 48 +- nikola/plugins/compile/markdown/mdx_nikola.py | 4 +- nikola/plugins/compile/markdown/mdx_podcast.py | 2 +- nikola/plugins/compile/pandoc.plugin | 2 +- nikola/plugins/compile/pandoc.py | 11 +- nikola/plugins/compile/php.plugin | 2 +- nikola/plugins/compile/php.py | 3 +- nikola/plugins/compile/rest.plugin | 2 +- nikola/plugins/compile/rest/__init__.py | 114 ++- nikola/plugins/compile/rest/chart.py | 2 +- nikola/plugins/compile/rest/doc.py | 2 +- nikola/plugins/compile/rest/gist.py | 20 +- nikola/plugins/compile/rest/listing.py | 112 ++- nikola/plugins/compile/rest/media.py | 2 +- nikola/plugins/compile/rest/post_list.py | 20 +- nikola/plugins/compile/rest/slides.py | 2 +- nikola/plugins/compile/rest/thumbnail.plugin | 9 + nikola/plugins/compile/rest/thumbnail.py | 69 ++ nikola/plugins/compile/rest/vimeo.py | 12 +- nikola/plugins/compile/rest/youtube.py | 2 +- nikola/plugins/loghandler/__init__.py | 2 +- nikola/plugins/loghandler/smtp.plugin | 2 +- nikola/plugins/loghandler/smtp.py | 2 +- nikola/plugins/loghandler/stderr.plugin | 2 +- nikola/plugins/loghandler/stderr.py | 2 +- nikola/plugins/misc/scan_posts.plugin | 10 + nikola/plugins/misc/scan_posts.py | 100 +++ nikola/plugins/task/__init__.py | 2 +- nikola/plugins/task/archive.plugin | 2 +- nikola/plugins/task/archive.py | 248 ++++-- nikola/plugins/task/bundles.plugin | 2 +- nikola/plugins/task/bundles.py | 23 +- nikola/plugins/task/copy_assets.plugin | 2 +- nikola/plugins/task/copy_assets.py | 6 +- nikola/plugins/task/copy_files.plugin | 2 +- nikola/plugins/task/copy_files.py | 4 +- nikola/plugins/task/galleries.plugin | 2 +- nikola/plugins/task/galleries.py | 312 +++---- nikola/plugins/task/gzip.plugin | 2 +- nikola/plugins/task/gzip.py | 2 +- nikola/plugins/task/indexes.plugin | 2 +- nikola/plugins/task/indexes.py | 123 +-- nikola/plugins/task/listings.plugin | 2 +- nikola/plugins/task/listings.py | 266 ++++-- nikola/plugins/task/pages.plugin | 2 +- nikola/plugins/task/pages.py | 6 +- nikola/plugins/task/posts.plugin | 2 +- nikola/plugins/task/posts.py | 63 +- nikola/plugins/task/redirect.plugin | 2 +- nikola/plugins/task/redirect.py | 23 +- nikola/plugins/task/robots.plugin | 2 +- nikola/plugins/task/robots.py | 11 +- nikola/plugins/task/rss.plugin | 2 +- nikola/plugins/task/rss.py | 18 +- nikola/plugins/task/scale_images.plugin | 9 + nikola/plugins/task/scale_images.py | 96 ++ nikola/plugins/task/sitemap.plugin | 2 +- nikola/plugins/task/sitemap/__init__.py | 106 ++- nikola/plugins/task/sources.plugin | 2 +- nikola/plugins/task/sources.py | 7 +- nikola/plugins/task/tags.plugin | 2 +- nikola/plugins/task/tags.py | 301 ++++--- nikola/plugins/template/__init__.py | 2 +- nikola/plugins/template/jinja.plugin | 2 +- nikola/plugins/template/jinja.py | 5 +- nikola/plugins/template/mako.plugin | 2 +- nikola/plugins/template/mako.py | 4 +- nikola/post.py | 287 +++++- nikola/utils.py | 477 ++++++++-- nikola/winutils.py | 16 +- 264 files changed, 7383 insertions(+), 2791 deletions(-) delete mode 120000 nikola/data/samplesite/stories/upgrading-to-v6.txt create mode 120000 nikola/data/symlink-test-link.txt create mode 100644 nikola/data/symlink-test-orig.txt create mode 100644 nikola/data/themes/base-jinja/templates/archiveindex.tmpl create mode 100644 nikola/data/themes/base/assets/css/nikola_ipython.css create mode 100644 nikola/data/themes/base/assets/js/fancydates.js create mode 100644 nikola/data/themes/base/assets/xml/atom.xsl create mode 100644 nikola/data/themes/base/assets/xml/rss.xsl create mode 100644 nikola/data/themes/base/messages/messages_az.py create mode 100644 nikola/data/themes/base/messages/messages_fil.py create mode 100644 nikola/data/themes/base/messages/messages_id.py create mode 100644 nikola/data/themes/base/messages/messages_ko.py create mode 100644 nikola/data/themes/base/messages/messages_sr.py create mode 100644 nikola/data/themes/base/messages/messages_sv.py create mode 100644 nikola/data/themes/base/messages/messages_tl.py create mode 100644 nikola/data/themes/base/messages/messages_uk.py create mode 100644 nikola/data/themes/base/messages/messages_zh_tw.py create mode 100644 nikola/data/themes/base/templates/archiveindex.tmpl mode change 120000 => 100644 nikola/data/themes/bootstrap-jinja/assets/css/theme.css create mode 120000 nikola/data/themes/bootstrap-jinja/assets/js/colorbox-i18n/jquery.colorbox-bn.js create mode 120000 nikola/data/themes/bootstrap-jinja/assets/js/colorbox-i18n/jquery.colorbox-pt-BR.js delete mode 120000 nikola/data/themes/bootstrap-jinja/assets/js/colorbox-i18n/jquery.colorbox-pt-br.js mode change 120000 => 100644 nikola/data/themes/bootstrap-jinja/assets/js/flowr.plugin.js create mode 120000 nikola/data/themes/bootstrap-jinja/assets/js/jquery.js delete mode 100644 nikola/data/themes/bootstrap-jinja/templates/bootstrap_helper.tmpl delete mode 100644 nikola/data/themes/bootstrap-jinja/templates/post_header.tmpl create mode 120000 nikola/data/themes/bootstrap/assets/js/colorbox-i18n/jquery.colorbox-bn.js create mode 120000 nikola/data/themes/bootstrap/assets/js/colorbox-i18n/jquery.colorbox-pt-BR.js delete mode 120000 nikola/data/themes/bootstrap/assets/js/colorbox-i18n/jquery.colorbox-pt-br.js create mode 120000 nikola/data/themes/bootstrap/assets/js/jquery.js mode change 120000 => 100644 nikola/data/themes/bootstrap3-jinja/assets/css/docs.css mode change 120000 => 100644 nikola/data/themes/bootstrap3-jinja/assets/css/images/ie6/borderBottomCenter.png mode change 120000 => 100644 nikola/data/themes/bootstrap3-jinja/assets/css/images/ie6/borderBottomLeft.png mode change 120000 => 100644 nikola/data/themes/bootstrap3-jinja/assets/css/images/ie6/borderBottomRight.png mode change 120000 => 100644 nikola/data/themes/bootstrap3-jinja/assets/css/images/ie6/borderMiddleLeft.png mode change 120000 => 100644 nikola/data/themes/bootstrap3-jinja/assets/css/images/ie6/borderMiddleRight.png mode change 120000 => 100644 nikola/data/themes/bootstrap3-jinja/assets/css/images/ie6/borderTopCenter.png mode change 120000 => 100644 nikola/data/themes/bootstrap3-jinja/assets/css/images/ie6/borderTopLeft.png mode change 120000 => 100644 nikola/data/themes/bootstrap3-jinja/assets/css/images/ie6/borderTopRight.png delete mode 120000 nikola/data/themes/bootstrap3-jinja/assets/css/rst.css mode change 120000 => 100644 nikola/data/themes/bootstrap3-jinja/assets/css/theme.css create mode 120000 nikola/data/themes/bootstrap3-jinja/assets/fonts/glyphicons-halflings-regular.woff2 delete mode 100644 nikola/data/themes/bootstrap3/assets/css/rst.css create mode 120000 nikola/data/themes/bootstrap3/assets/fonts/glyphicons-halflings-regular.woff2 create mode 100644 nikola/image_processing.py delete mode 100644 nikola/plugins/command/auto.py create mode 100644 nikola/plugins/command/auto/__init__.py create mode 120000 nikola/plugins/command/auto/livereload.js create mode 100644 nikola/plugins/command/rst2html.plugin create mode 100644 nikola/plugins/command/rst2html/__init__.py create mode 100644 nikola/plugins/command/rst2html/rst2html.tmpl create mode 100644 nikola/plugins/command/status.plugin create mode 100644 nikola/plugins/command/status.py create mode 100644 nikola/plugins/compile/ipynb.py delete mode 100644 nikola/plugins/compile/ipynb/README.txt delete mode 100644 nikola/plugins/compile/ipynb/__init__.py create mode 100644 nikola/plugins/compile/rest/thumbnail.plugin create mode 100644 nikola/plugins/compile/rest/thumbnail.py create mode 100644 nikola/plugins/misc/scan_posts.plugin create mode 100644 nikola/plugins/misc/scan_posts.py create mode 100644 nikola/plugins/task/scale_images.plugin create mode 100644 nikola/plugins/task/scale_images.py (limited to 'nikola') diff --git a/nikola/__init__.py b/nikola/__init__.py index 4cb5427..263874f 100644 --- a/nikola/__init__.py +++ b/nikola/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright © 2012-2014 Roberto Alsina and others. +# Copyright © 2012-2015 Roberto Alsina and others. # Permission is hereby granted, free of charge, to any # person obtaining a copy of this software and associated @@ -27,7 +27,7 @@ from __future__ import absolute_import import os -__version__ = "7.1.0" +__version__ = "7.6.0" DEBUG = bool(os.getenv('NIKOLA_DEBUG')) from .nikola import Nikola # NOQA diff --git a/nikola/__main__.py b/nikola/__main__.py index f492800..6aa0977 100644 --- a/nikola/__main__.py +++ b/nikola/__main__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright © 2012-2014 Roberto Alsina and others. +# Copyright © 2012-2015 Roberto Alsina and others. # Permission is hereby granted, free of charge, to any # person obtaining a copy of this software and associated @@ -25,7 +25,7 @@ # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import print_function, unicode_literals -from operator import attrgetter +from collections import defaultdict import os import shutil try: @@ -49,10 +49,18 @@ from blinker import signal from . import __version__ from .plugin_categories import Command from .nikola import Nikola -from .utils import _reload, sys_decode, get_root_dir, req_missing, LOGGER, STRICT_HANDLER, ColorfulStderrHandler +from .utils import sys_decode, sys_encode, get_root_dir, req_missing, LOGGER, STRICT_HANDLER, ColorfulStderrHandler + +if sys.version_info[0] == 3: + import importlib.machinery +else: + import imp config = {} +# DO NOT USE unless you know what you are doing! +_RETURN_DOITNIKOLA = False + def main(args=None): colorful = False @@ -63,16 +71,34 @@ def main(args=None): if args is None: args = sys.argv[1:] + + oargs = args + args = [sys_decode(arg) for arg in args] + + conf_filename = 'conf.py' + conf_filename_bytes = b'conf.py' + conf_filename_changed = False + for index, arg in enumerate(args): + if arg[:7] == '--conf=': + del args[index] + del oargs[index] + conf_filename = arg[7:] + conf_filename_bytes = sys_encode(arg[7:]) + conf_filename_changed = True + break + quiet = False - if len(args) > 0 and args[0] == b'build' and b'--strict' in args: + if len(args) > 0 and args[0] == 'build' and '--strict' in args: LOGGER.notice('Running in strict mode') STRICT_HANDLER.push_application() - if len(args) > 0 and args[0] == b'build' and b'-q' in args or b'--quiet' in args: + if len(args) > 0 and args[0] == 'build' and '-q' in args or '--quiet' in args: nullhandler = NullHandler() nullhandler.push_application() quiet = True global config + original_cwd = os.getcwd() + # Those commands do not require a `conf.py`. (Issue #1132) # Moreover, actually having one somewhere in the tree can be bad, putting # the output of that command (the new site) in an unknown directory that is @@ -82,25 +108,38 @@ def main(args=None): root = get_root_dir() if root: os.chdir(root) + # Help and imports don't require config, but can use one if it exists + needs_config_file = (argname != 'help') and not argname.startswith('import_') + else: + needs_config_file = False sys.path.append('') try: - import conf - _reload(conf) + if sys.version_info[0] == 3: + loader = importlib.machinery.SourceFileLoader("conf", conf_filename) + conf = loader.load_module() + else: + conf = imp.load_source("conf", conf_filename_bytes) config = conf.__dict__ except Exception: - if os.path.exists('conf.py'): + if os.path.exists(conf_filename): msg = traceback.format_exc(0) - LOGGER.error('conf.py cannot be parsed.\n{0}'.format(msg)) - sys.exit(1) + LOGGER.error('"{0}" cannot be parsed.\n{1}'.format(conf_filename, msg)) + return 1 + elif needs_config_file and conf_filename_changed: + LOGGER.error('Cannot find configuration file "{0}".'.format(conf_filename)) + return 1 config = {} + if conf_filename_changed: + LOGGER.info("Using config file '{0}'".format(conf_filename)) + invariant = False - if len(args) > 0 and args[0] == b'build' and b'--invariant' in args: + if len(args) > 0 and args[0] == 'build' and '--invariant' in args: try: import freezegun - freeze = freezegun.freeze_time("2014-01-01") + freeze = freezegun.freeze_time("2038-01-01") freeze.start() invariant = True except ImportError: @@ -114,9 +153,13 @@ def main(args=None): config['__colorful__'] = colorful config['__invariant__'] = invariant config['__quiet__'] = quiet - + config['__configuration_filename__'] = conf_filename + config['__cwd__'] = original_cwd site = Nikola(**config) - _ = DoitNikola(site, quiet).run(args) + DN = DoitNikola(site, quiet) + if _RETURN_DOITNIKOLA: + return DN + _ = DN.run(oargs) if site.invariant: freeze.stop() @@ -135,10 +178,11 @@ class Help(DoitHelp): # --strict, --invariant and --quiet. del cmds['run'] - print("Nikola is a tool to create static websites and blogs. For full documentation and more information, please visit http://getnikola.com/\n\n") + print("Nikola is a tool to create static websites and blogs. For full documentation and more information, please visit https://getnikola.com/\n\n") print("Available commands:") - for cmd in sorted(cmds.values(), key=attrgetter('name')): - print(" nikola %-*s %s" % (20, cmd.name, cmd.doc_purpose)) + for cmd_name in sorted(cmds.keys()): + cmd = cmds[cmd_name] + print(" nikola {:20s} {}".format(cmd_name, cmd.doc_purpose)) print("") print(" nikola help show help / reference") print(" nikola help show command usage") @@ -214,12 +258,13 @@ class NikolaTaskLoader(TaskLoader): 'outfile': sys.stderr, } DOIT_CONFIG['default_tasks'] = ['render_site', 'post_render'] + DOIT_CONFIG.update(self.nikola._doit_config) tasks = generate_tasks( 'render_site', self.nikola.gen_tasks('render_site', "Task", 'Group of tasks to render the site.')) latetasks = generate_tasks( 'post_render', - self.nikola.gen_tasks('post_render', "LateTask", 'Group of tasks to be executes after site is rendered.')) + self.nikola.gen_tasks('post_render', "LateTask", 'Group of tasks to be executed after site is rendered.')) signal('initialized').send(self.nikola) return tasks + latetasks, DOIT_CONFIG @@ -230,20 +275,21 @@ class DoitNikola(DoitMain): TASK_LOADER = NikolaTaskLoader def __init__(self, nikola, quiet=False): + super(DoitNikola, self).__init__() self.nikola = nikola nikola.doit = self self.task_loader = self.TASK_LOADER(nikola, quiet) - def get_commands(self): + def get_cmds(self): # core doit commands - cmds = DoitMain.get_commands(self) + cmds = DoitMain.get_cmds(self) # load nikola commands for name, cmd in self.nikola._commands.items(): cmds[name] = cmd return cmds def run(self, cmd_args): - sub_cmds = self.get_commands() + sub_cmds = self.get_cmds() args = self.process_args(cmd_args) args = [sys_decode(arg) for arg in args] @@ -270,18 +316,30 @@ class DoitNikola(DoitMain): args = ['version'] if args[0] not in sub_cmds.keys(): LOGGER.error("Unknown command {0}".format(args[0])) - return False - if not isinstance(sub_cmds[args[0]], (Command, Help)): # Is a doit command + sugg = defaultdict(list) + for c in sub_cmds.keys(): + d = lev(c, args[0]) + sugg[d].append(c) + LOGGER.info('Did you mean "{}"?', '" or "'.join(sugg[min(sugg.keys())])) + return 3 + if sub_cmds[args[0]] is not Help and not isinstance(sub_cmds[args[0]], Command): # Is a doit command if not self.nikola.configured: LOGGER.error("This command needs to run inside an " "existing Nikola site.") - return False - + return 3 return super(DoitNikola, self).run(cmd_args) @staticmethod def print_version(): print("Nikola v" + __version__) + +# Stolen from http://stackoverflow.com/questions/4173579/implementing-levenshtein-distance-in-python +def lev(a, b): + if not a or not b: + return max(len(a), len(b)) + return min(lev(a[1:], b[1:]) + (a[0] != b[0]), lev(a[1:], b) + 1, lev(a, b[1:]) + 1) + + if __name__ == "__main__": sys.exit(main(sys.argv[1:])) diff --git a/nikola/conf.py.in b/nikola/conf.py.in index 04c2098..ab00673 100644 --- a/nikola/conf.py.in +++ b/nikola/conf.py.in @@ -23,7 +23,7 @@ BLOG_TITLE = ${BLOG_TITLE} # (translatable) # This is the main URL for your site. It will be used # in a prominent link SITE_URL = ${SITE_URL} -# This is the URL where nikola's output will be deployed. +# This is the URL where Nikola's output will be deployed. # If not set, defaults to SITE_URL # BASE_URL = ${SITE_URL} BLOG_EMAIL = ${BLOG_EMAIL} @@ -63,19 +63,26 @@ TRANSLATIONS_PATTERN = ${TRANSLATIONS_PATTERN} # This is a dict. The keys are languages, and values are tuples. # # For regular links: -# ('http://example.com/', 'Text') +# ('https://getnikola.com/', 'Nikola Homepage') # # For submenus: -# (( -# ('Sub 1', 'http://example.com/'), -# ('Sub 2', 'http://example.org/'), -# ), 'Top') +# ( +# ( +# ('http://apple.com/', 'Apple'), +# ('http://orange.com/', 'Orange'), +# ), +# 'Fruits' +# ) # # WARNING: Support for submenus is theme-dependent. # Only one level of submenus is supported. # WARNING: Some themes, including the default Bootstrap 3 theme, # may present issues if the menu is too large. # (in bootstrap3, the navbar can grow too large and cover contents.) +# WARNING: If you link to directories, make sure to follow +# ``STRIP_INDEXES``. If it’s set to ``True``, end your links +# with a ``/``, otherwise end them with ``/index.html`` — or +# else they won’t be highlighted when active. NAVIGATION_LINKS = ${NAVIGATION_LINKS} @@ -90,7 +97,7 @@ THEME = ${THEME} # 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 -# (eg. 'Europe/Zurich') +# (e.g. 'Europe/Zurich') # Also, if you want to use a different time zone in some of your posts, # you can use the ISO 8601/RFC 3339 format (ex. 2012-03-30T23:00:00+02:00) TIMEZONE = ${TIMEZONE} @@ -104,13 +111,26 @@ TIMEZONE = ${TIMEZONE} # (str used by datetime.datetime.strftime) # DATE_FORMAT = '%Y-%m-%d %H:%M' -# While nikola can select a sensible locale for each language, +# Date format used to display post dates, if local dates are used. +# (str used by moment.js) +# JS_DATE_FORMAT = 'YYYY-MM-DD HH:mm' + +# Date fanciness. +# +# 0 = using DATE_FORMAT and TIMEZONE +# 1 = using JS_DATE_FORMAT and local user time (via moment.js) +# 2 = using a string like “2 days ago” +# +# Your theme must support it, bootstrap and bootstrap3 already do. +# DATE_FANCINESS = 0 + +# While Nikola can select a sensible locale for each language, # sometimes explicit control can come handy. # In this file we express locales in the string form that # python's locales will accept in your OS, by example -# "en_US.utf8" in unix-like OS, "English_United States" in Windows. +# "en_US.utf8" in Unix-like OS, "English_United States" in Windows. # LOCALES = dict mapping language --> explicit locale for the languages -# in TRANSLATIONS. You can ommit one or more keys. +# in TRANSLATIONS. You can omit one or more keys. # LOCALE_FALLBACK = locale to use when an explicit locale is unavailable # LOCALE_DEFAULT = locale to use for languages not mentioned in LOCALES; if # not set the default Nikola mapping is used. @@ -121,7 +141,7 @@ TIMEZONE = ${TIMEZONE} # (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.es.txt and whatever/thing.es.meta # # This assumes you use the default TRANSLATIONS_PATTERN. @@ -129,7 +149,7 @@ TIMEZONE = ${TIMEZONE} # From those files, a set of HTML fragment files will be generated: # cache/whatever/thing.html (and maybe cache/whatever/thing.html.es) # -# These files are combinated with the template to produce rendered +# These files are combined with the template to produce rendered # pages, which will be placed at # output / TRANSLATIONS[lang] / destination / pagename.html # @@ -144,18 +164,24 @@ POSTS = ${POSTS} PAGES = ${PAGES} # One or more folders containing files to be copied as-is into the output. -# The format is a dictionary of "source" "relative destination". +# The format is a dictionary of {source: relative destination}. # Default is: -# FILES_FOLDERS = {'files': '' } +# FILES_FOLDERS = {'files': ''} # Which means copy 'files' into 'output' +# One or more folders containing listings to be processed and stored into +# the output. The format is a dictionary of {source: relative destination}. +# Default is: +# LISTINGS_FOLDERS = {'listings': 'listings'} +# Which means process listings from 'listings' into 'output/listings' + # A mapping of languages to file-extensions that represent that language. # Feel free to add or delete extensions to any list, but don't add any new # compilers unless you write the interface for it yourself. # # 'rest' is reStructuredText # 'markdown' is MarkDown -# 'html' assumes the file is html and just copies it +# 'html' assumes the file is HTML and just copies it COMPILERS = ${COMPILERS} # Create by default posts in one file format? @@ -178,6 +204,10 @@ COMPILERS = ${COMPILERS} # already contains the text), set this to False. # SHOW_BLOG_TITLE = True +# Writes tag cloud data in form of tag_cloud_data.json. +# Warning: this option will change its default value to False in v8! +WRITE_TAG_CLOUD = True + # Paths for different autogenerated bits. These are combined with the # translation paths. @@ -191,6 +221,64 @@ COMPILERS = ${COMPILERS} # the posts themselves. If set to False, it will be just a list of links. # TAG_PAGES_ARE_INDEXES = False +# Set descriptions for tag pages to make them more interesting. The +# default is no description. The value is used in the meta description +# and displayed underneath the tag list or index page’s title. +# TAG_PAGES_DESCRIPTIONS = { +# DEFAULT_LANG: { +# "blogging": "Meta-blog posts about blogging about blogging.", +# "open source": "My contributions to my many, varied, ever-changing, and eternal libre software projects." +# }, +#} + + +# If you do not want to display a tag publicly, you can mark it as hidden. +# The tag will not be displayed on the tag list page, the tag cloud and posts. +# Tag pages will still be generated. +HIDDEN_TAGS = ['mathjax'] + +# Only include tags on the tag list/overview page if there are at least +# TAGLIST_MINIMUM_POSTS number of posts or more with every tag. Every tag +# page is still generated, linked from posts, and included in the sitemap. +# However, more obscure tags can be hidden from the tag index page. +# TAGLIST_MINIMUM_POSTS = 1 + +# Final locations are: +# output / TRANSLATION[lang] / CATEGORY_PATH / index.html (list of categories) +# output / TRANSLATION[lang] / CATEGORY_PATH / CATEGORY_PREFIX category.html (list of posts for a category) +# output / TRANSLATION[lang] / CATEGORY_PATH / CATEGORY_PREFIX category.xml (RSS feed for a category) +# CATEGORY_PATH = "categories" +# CATEGORY_PREFIX = "cat_" + +# If CATEGORY_ALLOW_HIERARCHIES is set to True, categories can be organized in +# hierarchies. For a post, the whole path in the hierarchy must be specified, +# using a forward slash ('/') to separate paths. Use a backslash ('\') to escape +# a forward slash or a backslash (i.e. '\//\\' is a path specifying the +# subcategory called '\' of the top-level category called '/'). +# CATEGORY_ALLOW_HIERARCHIES = False +# If CATEGORY_OUTPUT_FLAT_HIERARCHY is set to True, the output written to output +# contains only the name of the leaf category and not the whole path. +# CATEGORY_OUTPUT_FLAT_HIERARCHY = False + +# If CATEGORY_PAGES_ARE_INDEXES is set to True, each category's page will contain +# the posts themselves. If set to False, it will be just a list of links. +# CATEGORY_PAGES_ARE_INDEXES = False + +# Set descriptions for category pages to make them more interesting. The +# default is no description. The value is used in the meta description +# and displayed underneath the category list or index page’s title. +# CATEGORY_PAGES_DESCRIPTIONS = { +# DEFAULT_LANG: { +# "blogging": "Meta-blog posts about blogging about blogging.", +# "open source": "My contributions to my many, varied, ever-changing, and eternal libre software projects." +# }, +#} + +# If you do not want to display a category publicly, you can mark it as hidden. +# The category will not be displayed on the category list page. +# Category pages will still be generated. +HIDDEN_CATEGORIES = [] + # Final location for the main blog page and sibling paginated pages is # output / TRANSLATION[lang] / INDEX_PATH / index-*.html # INDEX_PATH = "" @@ -199,13 +287,24 @@ COMPILERS = ${COMPILERS} # CREATE_MONTHLY_ARCHIVE = False # Create one large archive instead of per-year # CREATE_SINGLE_ARCHIVE = False +# Create year, month, and day archives each with a (long) list of posts +# (overrides both CREATE_MONTHLY_ARCHIVE and CREATE_SINGLE_ARCHIVE) +# CREATE_FULL_ARCHIVES = False +# If monthly archives or full archives are created, adds also one archive per day +# CREATE_DAILY_ARCHIVE = False # Final locations for the archives are: # output / TRANSLATION[lang] / ARCHIVE_PATH / ARCHIVE_FILENAME # output / TRANSLATION[lang] / ARCHIVE_PATH / YEAR / index.html # output / TRANSLATION[lang] / ARCHIVE_PATH / YEAR / MONTH / index.html +# output / TRANSLATION[lang] / ARCHIVE_PATH / YEAR / MONTH / DAY / index.html # ARCHIVE_PATH = "" # ARCHIVE_FILENAME = "archive.html" +# If ARCHIVES_ARE_INDEXES is set to True, each archive page which contains a list +# of posts will contain the posts themselves. If set to False, it will be just a +# list of links. +# ARCHIVES_ARE_INDEXES = False + # 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 @@ -232,15 +331,23 @@ COMPILERS = ${COMPILERS} # If you don't need any of these, just set to [] REDIRECTIONS = ${REDIRECTIONS} -# Commands to execute to deploy. Can be anything, for example, -# you may use rsync: +# Presets of commands to execute to deploy. Can be anything, for +# example, you may use rsync: # "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 [] -# DEPLOY_COMMANDS = [] +# plugin (`nikola plugin -i ping`). Or run `nikola check -l`. +# You may also want to use github_deploy (see below). +# You can define multiple presets and specify them as arguments +# to `nikola deploy`. If no arguments are specified, a preset +# named `default` will be executed. You can use as many presets +# in a `nikola deploy` command as you like. +# DEPLOY_COMMANDS = { +# 'default': [ +# "rsync -rav --delete output/ joe@my.site:/srv/www/site", +# ] +# } -# For user.github.io/organization.github.io pages, the DEPLOY branch +# For user.github.io OR organization.github.io pages, the DEPLOY branch # MUST be 'master', and 'gh-pages' for other repositories. # GITHUB_SOURCE_BRANCH = 'master' # GITHUB_DEPLOY_BRANCH = 'gh-pages' @@ -278,7 +385,7 @@ REDIRECTIONS = ${REDIRECTIONS} # Nikola’s templates. All other filters must be enabled through FILTERS. # # Many filters are shipped with Nikola. A list is available in the manual: -# +# # # from nikola import filters # FILTERS = { @@ -291,7 +398,7 @@ REDIRECTIONS = ${REDIRECTIONS} # side optimization for very high traffic sites or low memory servers. # GZIP_FILES = False # File extensions that will be compressed -# GZIP_EXTENSIONS = ('.txt', '.htm', '.html', '.css', '.js', '.json', '.xml') +# GZIP_EXTENSIONS = ('.txt', '.htm', '.html', '.css', '.js', '.json', '.atom', '.xml') # Use an external gzip command? None means no. # Example: GZIP_COMMAND = "pigz -k {filename}" # GZIP_COMMAND = None @@ -318,9 +425,13 @@ REDIRECTIONS = ${REDIRECTIONS} # Image Gallery Options # ############################################################################# -# Galleries are folders in galleries/ -# Final location of galleries will be output / GALLERY_PATH / gallery_name -# GALLERY_PATH = "galleries" +# One or more folders containing galleries. The format is a dictionary of +# {"source": "relative_destination"}, where galleries are looked for in +# "source/" and the results will be located in +# "OUTPUT_PATH/relative_destination/gallery_name" +# Default is: +# GALLERY_FOLDERS = {"galleries": "galleries"} +# More gallery options: # THUMBNAIL_SIZE = 180 # MAX_IMAGE_SIZE = 1280 # USE_FILENAME_AS_TITLE = True @@ -328,23 +439,94 @@ REDIRECTIONS = ${REDIRECTIONS} # # If set to False, it will sort by filename instead. Defaults to True # GALLERY_SORT_BY_DATE = True +# +# Folders containing images to be used in normal posts or pages. Images will be +# scaled down according to IMAGE_THUMBNAIL_SIZE and MAX_IMAGE_SIZE options, but +# will have to be referenced manually to be visible on the site +# (the thumbnail has ``.thumbnail`` added before the file extension). +# The format is a dictionary of {source: relative destination}. + +IMAGE_FOLDERS = {'images': 'images'} +# IMAGE_THUMBNAIL_SIZE = 400 # ############################################################################# # HTML fragments and diverse things that are used by the templates # ############################################################################# # Data about post-per-page indexes. -# INDEXES_PAGES defaults to 'old posts, page %d' or 'page %d' (translated), +# 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) +# +# (translatable) If the following is empty, defaults to BLOG_TITLE: +# INDEXES_TITLE = "" +# +# (translatable) If the following is empty, defaults to ' [old posts,] page %d' (see above): +# INDEXES_PAGES = "" +# +# If the following is True, INDEXES_PAGES is also displayed on the main (the +# newest) index page (index.html): +# INDEXES_PAGES_MAIN = False +# +# If the following is True, index-1.html has the oldest posts, index-2.html the +# second-oldest posts, etc., and index.html has the newest posts. This ensures +# that all posts on index-x.html will forever stay on that page, now matter how +# many new posts are added. +# If False, index-1.html has the second-newest posts, index-2.html the third-newest, +# and index-n.html the oldest posts. When this is active, old posts can be moved +# to other index pages when new posts are added. +# INDEXES_STATIC = True +# +# (translatable) If PRETTY_URLS is set to True, this setting will be used to create +# prettier URLs for index pages, such as page/2/index.html instead of index-2.html. +# Valid values for this settings are: +# * False, +# * a list or tuple, specifying the path to be generated, +# * a dictionary mapping languages to lists or tuples. +# Every list or tuple must consist of strings which are used to combine the path; +# for example: +# ['page', '{number}', '{index_file}'] +# The replacements +# {number} --> (logical) page number; +# {old_number} --> the page number inserted into index-n.html before (zero for +# the main page); +# {index_file} --> value of option INDEX_FILE +# are made. +# Note that in case INDEXES_PAGES_MAIN is set to True, a redirection will be created +# for the full URL with the page number of the main page to the normal (shorter) main +# page URL. +# INDEXES_PRETTY_PAGE_URL = False # Color scheme to be used for code blocks. If your theme provides # "assets/css/code.css" this is ignored. -# Can be any of autumn borland bw colorful default emacs friendly fruity manni -# monokai murphy native pastie perldoc rrt tango trac vim vs +# Can be any of: +# algol +# algol_nu +# arduino +# autumn +# borland +# bw +# colorful +# default +# emacs +# friendly +# fruity +# igor +# lovelace +# manni +# monokai +# murphy +# native +# paraiso_dark +# paraiso_light +# pastie +# perldoc +# rrt +# tango +# trac +# vim +# vs +# xcode +# This list MAY be incomplete since pygments adds styles every now and then. # CODE_COLOR_SCHEME = 'default' # If you use 'site-reveal' theme you can select several subthemes @@ -357,12 +539,12 @@ REDIRECTIONS = ${REDIRECTIONS} # You can also use: page/concave/linear/none/default # FAVICONS contains (name, file, size) tuples. -# Used for create favicon link like this: +# Used to create favicon link like this: # -# FAVICONS = { +# FAVICONS = ( # ("icon", "/favicon.ico", "16x16"), # ("icon", "/icon_128x128.png", "128x128"), -# } +# ) # Show only teasers in the index pages? Defaults to False. # INDEX_TEASERS = False @@ -384,6 +566,16 @@ INDEX_READ_MORE_LINK = ${INDEX_READ_MORE_LINK} # 'Read more...' for the RSS_FEED, if RSS_TEASERS is True (translatable) RSS_READ_MORE_LINK = ${RSS_READ_MORE_LINK} +# Append a URL query to the RSS_READ_MORE_LINK in Atom and RSS feeds. Advanced +# option used for traffic source tracking. +# Minimum example for use with Piwik: "pk_campaign=feed" +# The following tags exist and are replaced for you: +# {feedRelUri} A relative link to the feed. +# {feedFormat} The name of the syndication format. +# Example using replacement for use with Google Analytics: +# "utm_source={feedRelUri}&utm_medium=nikola_feed&utm_campaign={feedFormat}_feed" +RSS_LINKS_APPEND_QUERY = False + # A HTML fragment describing the license, for the sidebar. # (translatable) LICENSE = "" @@ -399,7 +591,7 @@ LICENSE = "" # (translatable) CONTENT_FOOTER = 'Contents © {date} \ {author} - Powered by \ - Nikola \ + Nikola \ {license}' # Things that will be passed to CONTENT_FOOTER.format(). This is done @@ -443,8 +635,8 @@ COMMENT_SYSTEM_ID = ${COMMENT_SYSTEM_ID} # the "noannotations" metadata. # ANNOTATIONS = False -# Create index.html for story folders? -# WARNING: if a story would conflict with the index file (usually +# Create index.html for page (story) folders? +# WARNING: if a page would conflict with the index file (usually # caused by setting slug to `index`), the STORY_INDEX # will not be generated for that directory. # STORY_INDEX = False @@ -480,12 +672,12 @@ COMMENT_SYSTEM_ID = ${COMMENT_SYSTEM_ID} # /robots.txt and /sitemap.xml, and to inform search engines about /sitemapindex.xml. # ROBOTS_EXCLUSIONS = ["/archive.html", "/category/*.html"] -# Instead of putting files in .html, put them in -# /index.html. Also enables STRIP_INDEXES +# Instead of putting files in .html, put them in /index.html. +# No web server configuration is required. Also enables STRIP_INDEXES. # This can be disabled on a per-page/post basis by adding # .. pretty_url: False -# to the metadata -# PRETTY_URLS = False +# to the metadata. +PRETTY_URLS = ${PRETTY_URLS} # If True, publish future dated posts right away instead of scheduling them. # Defaults to False. @@ -513,7 +705,8 @@ COMMENT_SYSTEM_ID = ${COMMENT_SYSTEM_ID} # MathJax.Hub.Config({ # tex2jax: { # inlineMath: [ ['$','$'], ["\\\(","\\\)"] ], -# displayMath: [ ['$$','$$'], ["\\\[","\\\]"] ] +# displayMath: [ ['$$','$$'], ["\\\[","\\\]"] ], +# processEscapes: true # }, # displayAlign: 'left', // Change this to 'center' to center equations. # "HTML-CSS": { @@ -525,7 +718,7 @@ COMMENT_SYSTEM_ID = ${COMMENT_SYSTEM_ID} # Do you want to customize the nbconversion of your IPython notebook? # IPYNB_CONFIG = {} -# With the following example configuracion you can use a custom jinja template +# With the following example configuration you can use a custom jinja template # called `toggle.tpl` which has to be located in your site/blog main folder: # IPYNB_CONFIG = {'Exporter':{'template_file': 'toggle'}} @@ -534,10 +727,17 @@ COMMENT_SYSTEM_ID = ${COMMENT_SYSTEM_ID} # done in the code, hope you don't mind ;-) # Note: most Nikola-specific extensions are done via the Nikola plugin system, # with the MarkdownExtension class and should not be added here. -# MARKDOWN_EXTENSIONS = ['fenced_code', 'codehilite'] +# The default is ['fenced_code', 'codehilite'] +MARKDOWN_EXTENSIONS = ['fenced_code', 'codehilite', 'extra'] + +# Extra options to pass to the pandoc comand. +# by default, it's empty, is a list of strings, for example +# ['-F', 'pandoc-citeproc', '--bibliography=/Users/foo/references.bib'] +# PANDOC_OPTIONS = [] # Social buttons. This is sample code for AddThis (which was the default for a -# long time). Insert anything you want here, or even make it empty. +# long time). Insert anything you want here, or even make it empty (which is +# the default right now) # (translatable) # SOCIAL_BUTTONS_CODE = """ # @@ -568,20 +768,29 @@ COMMENT_SYSTEM_ID = ${COMMENT_SYSTEM_ID} # links to it. Set this to False to disable everything RSS-related. # GENERATE_RSS = True +# By default, Nikola does not generates Atom files for indexes and links to +# them. Generate Atom for tags by setting TAG_PAGES_ARE_INDEXES to True. +# Atom feeds are built based on INDEX_DISPLAY_POST_COUNT and not FEED_LENGTH +# Switch between plain-text summaries and full HTML content using the +# RSS_TEASER option. RSS_LINKS_APPEND_QUERY is also respected. Atom feeds +# are generated even for old indexes and have pagination link relations +# between each other. Old Atom feeds with no changes are marked as archived. +# GENERATE_ATOM = False + # RSS_LINK is a HTML fragment to link the RSS or Atom feeds. If set to None, # the base.tmpl will use the feed Nikola generates. However, you may want to -# change it for a feedburner feed or something else. +# change it for a FeedBurner feed or something else. # RSS_LINK = None -# Show only teasers in the RSS feed? Default to True +# Show only teasers in the RSS and Atom feeds? Default to True # RSS_TEASERS = True # Strip HTML in the RSS feed? Default to False # RSS_PLAIN = False -# A search form to search this site, for the sidebar. You can use a google +# A search form to search this site, for the sidebar. You can use a Google # custom search (http://www.google.com/cse/) -# Or a duckduckgo search: https://duckduckgo.com/search_box.html +# Or a DuckDuckGo search: https://duckduckgo.com/search_box.html # Default is no search form. # (translatable) # SEARCH_FORM = "" @@ -604,9 +813,9 @@ COMMENT_SYSTEM_ID = ${COMMENT_SYSTEM_ID} # # """ % SITE_URL # -# If you prefer a google search form, here's an example that should just work: +# If you prefer a Google search form, here's an example that should just work: # SEARCH_FORM = """ -# +# #