diff -Nru pelican-3.7.1+dfsg/CONTRIBUTING.rst pelican-4.0.1+dfsg/CONTRIBUTING.rst --- pelican-3.7.1+dfsg/CONTRIBUTING.rst 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/CONTRIBUTING.rst 2018-11-30 16:31:43.000000000 +0000 @@ -27,7 +27,7 @@ * no plugins or only those related to the issue **NOTE:** The most common sources of problems are anomalies in (1) themes, -(2) settings files, and (3) ``make``/``fab`` automation wrappers. If you can't +(2) settings files, and (3) ``make``/``invoke`` automation wrappers. If you can't reproduce your problem when using the following steps to generate your site, then the problem is almost certainly with your chosen theme and/or settings file (and not Pelican itself):: @@ -76,8 +76,8 @@ can manually join the ``#pelican`` IRC channel on the `freenode IRC network`_. .. _webchat: https://kiwiirc.com/client/irc.freenode.net/?#pelican -.. _`IRC link`: irc://irc.freenode.org/pelican -.. _`freenode IRC network`: http://www.freenode.org/ +.. _`IRC link`: irc://irc.freenode.net/pelican +.. _`freenode IRC network`: https://freenode.net/ Contributing code @@ -114,16 +114,22 @@ `install hub `_ and then run `hub pull-request `_ to turn your GitHub issue into a pull request containing your code. +* After you have issued a pull request, Travis will run the test suite for all + supported Python versions and check for PEP8 compliance. If any of these + checks fail, you should fix them. (If tests fail on Travis but seem to pass + locally, ensure that local test runs aren't skipping any tests.) Contribution quality standards ------------------------------ -* Adhere to `PEP8 coding standards`_ whenever possible. This can be eased via - the `pep8 `_ or `flake8 +* Adhere to `PEP8 coding standards`_. This can be eased via the `pycodestyle + `_ or `flake8 `_ tools, the latter of which in particular will give you some useful hints about ways in which the - code/formatting can be improved. -* Make sure your code is compatible with Python 2.7, 3.3, and 3.4 — see our + code/formatting can be improved. If you are relying on your editor for PEP8 + compliance, note that the line length specified by PEP8 is 79 (excluding the + line break). +* Ensure your code is compatible with the latest Python 2.7 and 3.x releases — see our `compatibility cheatsheet`_ for more details. * Add docs and tests for your changes. Undocumented and untested features will not be accepted. diff -Nru pelican-3.7.1+dfsg/debian/changelog pelican-4.0.1+dfsg/debian/changelog --- pelican-3.7.1+dfsg/debian/changelog 2017-08-13 06:01:00.000000000 +0000 +++ pelican-4.0.1+dfsg/debian/changelog 2019-01-13 17:46:23.000000000 +0000 @@ -1,3 +1,26 @@ +pelican (4.0.1+dfsg-1) unstable; urgency=medium + + * New upstream release. (Closes: #913875) + * Python3. (Closes: #875255) + * That fixed a FTBFS (Closes: #918447) + * Added 'pristine-tar = True', related to #918360 + * Removed a debian patch, upstream file not more present + * Added myself to Uploaders. + + -- Geert Stappers Sun, 13 Jan 2019 18:46:23 +0100 + +pelican (3.7.1+dfsg-2) unstable; urgency=medium + + [ Ondřej Nový ] + * d/copyright: Use https protocol in Format field + * d/control: Remove ancient X-Python-Version field + + [ Geert Stappers ] + * d/control has Salsa in VCS fields. (Closes: #917468) + * Build depend on python3-feedgenerator + + -- Geert Stappers Sat, 05 Jan 2019 15:27:25 +0100 + pelican (3.7.1+dfsg-1) unstable; urgency=medium * Remove notmyidea theme to avoid shipping non-free files, repacking tarball. diff -Nru pelican-3.7.1+dfsg/debian/control pelican-4.0.1+dfsg/debian/control --- pelican-3.7.1+dfsg/debian/control 2017-08-13 06:01:00.000000000 +0000 +++ pelican-4.0.1+dfsg/debian/control 2019-01-13 15:31:04.000000000 +0000 @@ -3,38 +3,38 @@ Priority: optional Maintainer: Debian Python Applications Team Uploaders: Ondřej Surý , Vincent Cheng + , Geert Stappers Build-Depends: debhelper (>= 9), dh-python, - python-all (>= 2.6.6-3), - python-blinker, - python-dateutil, - python-docutils, - python-feedgenerator, - python-jinja2 (>= 2.7), - python-pygments, - python-setuptools (>= 0.6b3), - python-six (>= 1.4), - python-sphinx, - python-tz, - python-unidecode + python3-all (>= 3.3~), + python3-blinker, + python3-dateutil, + python3-docutils, + python3-feedgenerator, + python3-jinja2 (>= 2.7), + python3-pygments, + python3-setuptools (>= 0.6b3), + python3-six (>= 1.4), + python3-sphinx, + python3-tz, + python3-unidecode Standards-Version: 4.0.1 -X-Python-Version: >= 2.7 Homepage: http://getpelican.com/ -Vcs-Svn: svn://anonscm.debian.org/python-apps/packages/pelican/trunk/ -Vcs-Browser: https://anonscm.debian.org/viewvc/python-apps/packages/pelican/trunk/ +Vcs-Git: https://salsa.debian.org/python-team/applications/pelican.git +Vcs-Browser: https://salsa.debian.org/python-team/applications/pelican Package: pelican Architecture: all Depends: - python-argparse | python (>= 2.7), - python-markdown, - python-pkg-resources, + python3 (>= 3.3~), + python3-markdown, + python3-pkg-resources, ${misc:Depends}, - ${python:Depends} + ${python3:Depends} Suggests: pandoc, - python-bs4, + python3-bs4, pelican-doc Breaks: python-pelican (<< 3.6.0-2~) @@ -53,7 +53,7 @@ Section: doc Depends: ${misc:Depends}, - ${python:Depends}, + ${python3:Depends}, ${sphinxdoc:Depends} Suggests: pelican diff -Nru pelican-3.7.1+dfsg/debian/copyright pelican-4.0.1+dfsg/debian/copyright --- pelican-3.7.1+dfsg/debian/copyright 2017-08-13 05:33:00.000000000 +0000 +++ pelican-4.0.1+dfsg/debian/copyright 2019-01-13 15:31:04.000000000 +0000 @@ -1,4 +1,4 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: pelican Source: http://getpelican.com/ Files-Excluded: pelican/themes/notmyidea diff -Nru pelican-3.7.1+dfsg/debian/gbp.conf pelican-4.0.1+dfsg/debian/gbp.conf --- pelican-3.7.1+dfsg/debian/gbp.conf 1970-01-01 00:00:00.000000000 +0000 +++ pelican-4.0.1+dfsg/debian/gbp.conf 2019-01-13 15:31:04.000000000 +0000 @@ -0,0 +1,3 @@ +[DEFAULT] +debian-branch=debian/master +pristine-tar = True diff -Nru pelican-3.7.1+dfsg/debian/py3dist-overrides pelican-4.0.1+dfsg/debian/py3dist-overrides --- pelican-3.7.1+dfsg/debian/py3dist-overrides 1970-01-01 00:00:00.000000000 +0000 +++ pelican-4.0.1+dfsg/debian/py3dist-overrides 2019-01-13 15:16:24.000000000 +0000 @@ -0,0 +1,8 @@ +feedgenerator python3-feedgenerator (>= 1.6) +jinja2 python3-jinja2 (>= 2.7) +pygments python3-pygments +docutils python3-docutils +blinker python3-blinker +unidecode python3-unidecode +six python3-six (>= 1.4) +pytz python3-tz diff -Nru pelican-3.7.1+dfsg/debian/pydist-overrides pelican-4.0.1+dfsg/debian/pydist-overrides --- pelican-3.7.1+dfsg/debian/pydist-overrides 2015-06-17 05:41:20.000000000 +0000 +++ pelican-4.0.1+dfsg/debian/pydist-overrides 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -feedgenerator python-feedgenerator (>= 1.6) -jinja2 python-jinja2 (>= 2.7) -pygments python-pygments -docutils python-docutils -blinker python-blinker -unidecode python-unidecode -six python-six (>= 1.4) -pytz python-tz diff -Nru pelican-3.7.1+dfsg/debian/rules pelican-4.0.1+dfsg/debian/rules --- pelican-3.7.1+dfsg/debian/rules 2017-08-13 05:31:54.000000000 +0000 +++ pelican-4.0.1+dfsg/debian/rules 2019-01-13 15:31:04.000000000 +0000 @@ -5,7 +5,7 @@ export PYBUILD_AFTER_INSTALL = rm -rf {destdir}/{install_dir}/pelican/tests %: - dh $@ --with python2,sphinxdoc --buildsystem=pybuild + dh $@ --with python3,sphinxdoc --buildsystem=pybuild override_dh_clean: dh_clean diff -Nru pelican-3.7.1+dfsg/docs/changelog.rst pelican-4.0.1+dfsg/docs/changelog.rst --- pelican-3.7.1+dfsg/docs/changelog.rst 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/docs/changelog.rst 2018-11-30 16:31:43.000000000 +0000 @@ -1,6 +1,55 @@ Release history ############### +4.0.1 (2018-11-30) +================== + +* Refactor ``pelican.server`` logging +* Fix bug in which all static files were processed as "draft" +* Bug fixes for Invoke/Makefile automation, Importer, and other miscellanea + +If upgrading from 3.7.x or earlier, please note that slug-related settings in +4.0+ use ``{slug}`` and/or ``{lang}`` rather than ``%s``. If ``%s``-style +settings are encountered, Pelican will emit a warning and fall back to the +default setting. Some user-submitted themes might try to format setting values +but fail upon site build with a ``TypeError``. In such cases, the theme needs +to be updated. For example, instead of ``TAG_FEED_ATOM|format(tag.slug)``, use +``TAG_FEED_ATOM|format(slug=tag.slug)`` + +4.0.0 (2018-11-13) +================== + +* Replace ``develop_server.sh`` script with ``pelican --listen`` +* Improved copy/link behavior for large static files (e.g., videos) +* New ``{static}`` syntax to link to static content; content linked to by + ``{static}`` and ``{attach}`` is automatically copied over even if not in + ``STATIC_PATHS`` +* Pages can now have ``draft`` status +* Show current settings via new ``--print-settings`` flag +* All settings for slugs now use ``{slug}`` and/or ``{lang}`` rather than + ``%s``. If ``%s``-style settings are encountered, Pelican will emit a warning + and fallback to the default setting. +* New signals: ``feed_generated`` and ``page_generated_write_page`` +* Replace Fabric with Invoke and ``fabfile.py`` template with ``tasks.py`` +* Replace ``PAGINATED_DIRECT_TEMPLATES`` by ``PAGINATED_TEMPLATES``, extending + control over pagination to all templates and making page size variable +* Replace ``SLUG_SUBSTITUTIONS`` (and friends) by ``SLUG_REGEX_SUBSTITUTIONS`` + for more finegrained control +* ``'{base_name}'`` value in ``PAGINATION_PATTERNS`` setting no longer strips + ``'bar'`` from ``'foo/bar.html'`` (unless ``'bar' == 'index'``). +* ``ARTICLE_ORDER_BY`` and ``PAGE_ORDER_BY`` now also affect 1) category, tag + and author pages 2) feeds 3) draft and hidden articles and pages +* New ``ARTICLE_TRANSLATION_ID`` and ``PAGE_TRANSLATION_ID`` settings to + specify metadata attributes used to identify/disable translations +* Make the HTML reader parse multiple occurrences of metadata tags as a list +* New Blogger XML backup importer +* Wordpress importer now updates file links to point to local copies if the + files were downloaded with ``--wp-attach``. +* Importer no longer inserts extra newlines, to prevent breaking of HTML + attributes. +* Pelican server now prioritises ``foo.html`` and ``foo/index.html`` over + ``foo/`` when resolving ``foo``. + 3.7.1 (2017-01-10) ================== @@ -86,8 +135,8 @@ directory as articles and pages using ``{attach}`` in the path. * Prevent Pelican from raising an exception when there are duplicate pieces of metadata in a Markdown file. -* Introduce the ``TYPOGRIFY_IGNORE_TAGS`` setting to add HTML tags to be ignored - by Typogrify. +* Introduce the ``TYPOGRIFY_IGNORE_TAGS`` setting to add HTML tags to be + ignored by Typogrify. * Add the ability to use ``-`` in date formats to strip leading zeros. For example, ``%-d/%-m/%y`` will now result in the date ``9/8/12``. * Ensure feed generation is correctly disabled during quickstart configuration. @@ -190,8 +239,10 @@ * Improve appearance of LinkedIn icon in default theme * Add GitHub and Google+ social icons support in default theme * Optimize social icons -* Add ``FEED_ALL_ATOM`` and ``FEED_ALL_RSS`` to generate feeds containing all posts regardless of their language -* Split ``TRANSLATION_FEED`` into ``TRANSLATION_FEED_ATOM`` and ``TRANSLATION_FEED_RSS`` +* Add ``FEED_ALL_ATOM`` and ``FEED_ALL_RSS`` to generate feeds containing all + posts regardless of their language +* Split ``TRANSLATION_FEED`` into ``TRANSLATION_FEED_ATOM`` and + ``TRANSLATION_FEED_RSS`` * Different feeds can now be enabled/disabled individually * Allow for blank author: if ``AUTHOR`` setting is not set, author won't default to ``${USER}`` anymore, and a post won't contain any author @@ -199,7 +250,8 @@ * Move LESS and Webassets support from Pelican core to plugin * The ``DEFAULT_DATE`` setting now defaults to ``None``, which means that articles won't be generated unless date metadata is specified -* Add ``FILENAME_METADATA`` setting to support metadata extraction from filename +* Add ``FILENAME_METADATA`` setting to support metadata extraction from + filename * Add ``gzip_cache`` plugin to compress common text files into a ``.gz`` file within the same directory as the original file, preventing the server (e.g. Nginx) from having to compress files during an HTTP call @@ -270,7 +322,8 @@ * Added translations * Added a way to use cleaner URLs with a rewrite url module (or equivalent) * Added a tag cloud -* Added an autoreloading feature: the blog is automatically regenerated each time a modification is detected +* Added an autoreloading feature: the blog is automatically regenerated each + time a modification is detected * Translate the documentation into French * Import a blog from an RSS feed * Pagination support diff -Nru pelican-3.7.1+dfsg/docs/conf.py pelican-4.0.1+dfsg/docs/conf.py --- pelican-3.7.1+dfsg/docs/conf.py 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/docs/conf.py 2018-11-30 16:31:43.000000000 +0000 @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals + import os import sys @@ -17,11 +18,11 @@ source_suffix = '.rst' master_doc = 'index' project = 'Pelican' -copyright = '2015, Alexis Metaireau and contributors' +copyright = '2010, Alexis Metaireau and contributors' exclude_patterns = ['_build'] release = __version__ version = '.'.join(release.split('.')[:1]) -last_stable = '3.7.1' +last_stable = '4.0.1' rst_prolog = ''' .. |last_stable| replace:: :pelican-doc:`{0}` '''.format(last_stable) diff -Nru pelican-3.7.1+dfsg/docs/content.rst pelican-4.0.1+dfsg/docs/content.rst --- pelican-3.7.1+dfsg/docs/content.rst 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/docs/content.rst 2018-11-30 16:31:43.000000000 +0000 @@ -11,7 +11,7 @@ used for content that does not change very often (e.g., "About" or "Contact" pages). -You can find sample content in the repository at: ``pelican/samples/content/`` +You can find sample content in the repository at ``samples/content/``. .. _internal_metadata: @@ -70,6 +70,24 @@ This is the content of my super blog post. +You can also have your own metadata keys (so long as they don't conflict with +reserved metadata keywords) for use in your python templates. The following is +the list of reserved metadata keywords: + +* `Title` +* `Tags` +* `Date` +* `Modified` +* `Status` +* `Category` +* `Author` +* `Authors` +* `Slug` +* `Summary` +* `Template` +* `Save_as` +* `Url` + Readers for additional formats (such as AsciiDoc_) are available via plugins. Refer to `pelican-plugins`_ repository for those. @@ -93,9 +111,9 @@ -With HTML, there is one simple exception to the standard metadata: ``tags`` can -be specified either via the ``tags`` metadata, as is standard in Pelican, or -via the ``keywords`` metadata, as is standard in HTML. The two can be used +With HTML, there is one simple exception to the standard metadata: tags can be +specified either via the ``tags`` metadata, as is standard in Pelican, or via +the ``keywords`` metadata, as is standard in HTML. The two can be used interchangeably. Note that, aside from the title, none of this article metadata is mandatory: @@ -117,12 +135,13 @@ __ `W3C ISO 8601`_ -``modified`` should be last time you updated the article, and defaults to ``date`` if not specified. -Besides you can show ``modified`` in the templates, feed entries in feed readers will be updated automatically -when you set ``modified`` to the current date after you modified your article. +``modified`` should be last time you updated the article, and defaults to +``date`` if not specified. Besides you can show ``modified`` in the templates, +feed entries in feed readers will be updated automatically when you set +``modified`` to the current date after you modified your article. -``authors`` is a comma-separated list of article authors. If there's only one author you -can use ``author`` field. +``authors`` is a comma-separated list of article authors. If there's only one +author you can use ``author`` field. If you do not explicitly specify summary metadata for a given post, the ``SUMMARY_MAX_LENGTH`` setting can be used to specify how many words from the @@ -152,6 +171,34 @@ then add a ``status: hidden`` attribute to its metadata. This is useful for things like making error pages that fit the generated theme of your site. +Static content +============== + +Static files are files other than articles and pages that are copied to the +output folder as-is, without processing. You can control which static files +are copied over with the ``STATIC_PATHS`` setting of the project's +``pelicanconf.py`` file. Pelican's default configuration includes the +``images`` directory for this, but others must be added manually. In addition, +static files that are explicitly linked to are included (see below). + +Mixed content in the same directory +----------------------------------- + +Starting with Pelican 3.5, static files can safely share a source directory +with page source files, without exposing the page sources in the generated +site. Any such directory must be added to both ``STATIC_PATHS`` and +``PAGE_PATHS`` (or ``STATIC_PATHS`` and ``ARTICLE_PATHS``). Pelican will +identify and process the page source files normally, and copy the remaining +files as if they lived in a separate directory reserved for static files. + +Note: Placing static and content source files together in the same source +directory does not guarantee that they will end up in the same place in the +generated site. The easiest way to do this is by using the ``{attach}`` link +syntax (described below). Alternatively, the ``STATIC_SAVE_AS``, +``PAGE_SAVE_AS``, and ``ARTICLE_SAVE_AS`` settings (and the corresponding +``*_URL`` settings) can be configured to place files of different types +together, just as they could in earlier versions of Pelican. + .. _ref-linking-to-internal-content: Linking to internal content @@ -205,13 +252,10 @@ Linking to static files ----------------------- -Linking to non-article or non-page content uses the same ``{filename}`` syntax -as described above. It is important to remember that those files will not be -copied to the output directory unless the source directories containing them -are included in the ``STATIC_PATHS`` setting of the project's ``pelicanconf.py`` -file. Pelican's default configuration includes the ``images`` directory for -this, but others must be added manually. Forgetting to do so will result in -broken links. +You can link to static content using ``{static}path/to/file``. Files linked to +with this syntax will automatically be copied to the output directory, even if +the source directories containing them are not included in the ``STATIC_PATHS`` +setting of the project's ``pelicanconf.py`` file. For example, a project's content directory might be structured like this:: @@ -225,48 +269,28 @@ ``test.md`` would include:: - ![Alt Text]({filename}/images/han.jpg) - [Our Menu]({filename}/pdfs/menu.pdf) - -``pelicanconf.py`` would include:: - - STATIC_PATHS = ['images', 'pdfs'] + ![Alt Text]({static}/images/han.jpg) + [Our Menu]({static}/pdfs/menu.pdf) Site generation would then copy ``han.jpg`` to ``output/images/han.jpg``, ``menu.pdf`` to ``output/pdfs/menu.pdf``, and write the appropriate links in ``test.md``. -Mixed content in the same directory ------------------------------------ - -Starting with Pelican 3.5, static files can safely share a source directory with -page source files, without exposing the page sources in the generated site. -Any such directory must be added to both ``STATIC_PATHS`` and ``PAGE_PATHS`` -(or ``STATIC_PATHS`` and ``ARTICLE_PATHS``). Pelican will identify and process -the page source files normally, and copy the remaining files as if they lived -in a separate directory reserved for static files. - -Note: Placing static and content source files together in the same source -directory does not guarantee that they will end up in the same place in the -generated site. The easiest way to do this is by using the ``{attach}`` link -syntax (described below). Alternatively, the ``STATIC_SAVE_AS``, -``PAGE_SAVE_AS``, and ``ARTICLE_SAVE_AS`` settings (and the corresponding -``*_URL`` settings) can be configured to place files of different types -together, just as they could in earlier versions of Pelican. +If you use ``{static}`` to link to an article or a page, this will be turned +into a link to its source code. Attaching static files ---------------------- Starting with Pelican 3.5, static files can be "attached" to a page or article using this syntax for the link target: ``{attach}path/to/file`` This works -like the ``{filename}`` syntax, but also relocates the static file into the +like the ``{static}`` syntax, but also relocates the static file into the linking document's output directory. If the static file originates from a subdirectory beneath the linking document's source, that relationship will be preserved on output. Otherwise, it will become a sibling of the linking document. -This only works for linking to static files, and only when they originate from -a directory included in the ``STATIC_PATHS`` setting. +This only works for linking to static files. For example, a project's content directory might be structured like this:: @@ -282,7 +306,6 @@ ``pelicanconf.py`` would include:: PATH = 'content' - STATIC_PATHS = ['blog', 'downloads'] ARTICLE_PATHS = ['blog'] ARTICLE_SAVE_AS = '{date:%Y}/{slug}.html' ARTICLE_URL = '{date:%Y}/{slug}.html' @@ -312,7 +335,7 @@ If a static file is linked multiple times, the relocating feature of ``{attach}`` will only work in the first of those links to be processed. -After the first link, Pelican will treat ``{attach}`` like ``{filename}``. +After the first link, Pelican will treat ``{attach}`` like ``{static}``. This avoids breaking the already-processed links. **Be careful when linking to a file from multiple documents:** @@ -326,7 +349,7 @@ advisable to use {attach} only if you use it in all links to a file, and only if the linking documents share a single directory.** Under these conditions, the file's output location will not change in future builds. In cases where -these precautions are not possible, consider using ``{filename}`` links instead +these precautions are not possible, consider using ``{static}`` links instead of ``{attach}``, and letting the file's location be determined by the project's ``STATIC_SAVE_AS`` and ``STATIC_URL`` settings. (Per-file ``save_as`` and ``url`` overrides can still be set in ``EXTRA_PATH_METADATA``.) @@ -340,12 +363,15 @@ Deprecated internal link syntax ------------------------------- -To remain compatible with earlier versions, Pelican still supports vertical bars -(``||``) in addition to curly braces (``{}``) for internal links. For example: -``|filename|an_article.rst``, ``|tag|tagname``, ``|category|foobar``. +To remain compatible with earlier versions, Pelican still supports vertical +bars (``||``) in addition to curly braces (``{}``) for internal links. For +example: ``|filename|an_article.rst``, ``|tag|tagname``, ``|category|foobar``. The syntax was changed from ``||`` to ``{}`` to avoid collision with Markdown -extensions or reST directives. Support for the old syntax may eventually be -removed. +extensions or reST directives. Similarly, Pelican also still supports linking +to static content with ``{filename}``. The syntax was changed to ``{static}`` +to allow linking to both generated articles and pages and their static sources. + +Support for the old syntax may eventually be removed. Importing an existing site @@ -370,8 +396,9 @@ language. For such advanced functionality the `i18n_subsites plugin`_ can be used. -Pelican uses the article's URL "slug" to determine if two or more articles are -translations of one another. The slug can be set manually in the file's +By default, Pelican uses the article's URL "slug" to determine if two or more +articles are translations of one another. (This can be changed with the +``ARTICLE_TRANSLATION_ID`` setting.) The slug can be set manually in the file's metadata; if not set explicitly, Pelican will auto-generate the slug from the title of the article. @@ -517,13 +544,14 @@ Publishing drafts ================= -If you want to publish an article as a draft (for friends to review before -publishing, for example), you can add a ``Status: draft`` attribute to its -metadata. That article will then be output to the ``drafts`` folder and not +If you want to publish an article or a page as a draft (for friends to review +before publishing, for example), you can add a ``Status: draft`` attribute to +its metadata. That article will then be output to the ``drafts`` folder and not listed on the index page nor on any category or tag page. -If your articles should be automatically published as a draft (to not accidentally -publish an article before it is finished) include the status in the ``DEFAULT_METADATA``:: +If your articles should be automatically published as a draft (to not +accidentally publish an article before it is finished) include the status in +the ``DEFAULT_METADATA``:: DEFAULT_METADATA = { 'status': 'draft', @@ -535,6 +563,6 @@ .. _W3C ISO 8601: http://www.w3.org/TR/NOTE-datetime .. _AsciiDoc: http://www.methods.co.nz/asciidoc/ .. _pelican-plugins: http://github.com/getpelican/pelican-plugins -.. _Markdown Extensions: http://pythonhosted.org/Markdown/extensions/ -.. _CodeHilite extension: http://pythonhosted.org/Markdown/extensions/code_hilite.html#syntax +.. _Markdown Extensions: https://python-markdown.github.io/extensions/ +.. _CodeHilite extension: https://python-markdown.github.io/extensions/code_hilite/#syntax .. _i18n_subsites plugin: http://github.com/getpelican/pelican-plugins/tree/master/i18n_subsites diff -Nru pelican-3.7.1+dfsg/docs/contribute.rst pelican-4.0.1+dfsg/docs/contribute.rst --- pelican-3.7.1+dfsg/docs/contribute.rst 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/docs/contribute.rst 2018-11-30 16:31:43.000000000 +0000 @@ -14,32 +14,32 @@ Setting up the development environment ====================================== -While there are many ways to set up one's development environment, following -is a method that uses `virtualenv `_. If you don't -have ``virtualenv`` installed, you can install it via:: +While there are many ways to set up one's development environment, we recommend +using `Virtualenv `_. This tool allows +you to set up separate environments for separate Python projects that are +isolated from one another so you can use different packages (and package +versions) for each. - $ pip install virtualenv +If you don't have ``virtualenv`` installed, you can install it via:: -Virtual environments allow you to work on Python projects which are isolated -from one another so you can use different packages (and package versions) with -different projects. + $ pip install virtualenv -To create and activate a virtual environment, use the following syntax:: +Use ``virtualenv`` to create and activate a virtual environment:: $ virtualenv ~/virtualenvs/pelican $ cd ~/virtualenvs/pelican $ . bin/activate -To clone the Pelican source:: +Clone the Pelican source into a subfolder called ``src/pelican``:: $ git clone https://github.com/getpelican/pelican.git src/pelican + $ cd src/pelican -To install the development dependencies:: +Install the development dependencies:: - $ cd src/pelican $ pip install -r requirements/developer.pip -To install Pelican and its dependencies:: +Install Pelican and its dependencies:: $ python setup.py develop @@ -47,14 +47,18 @@ $ pip install -e . +To conveniently test on multiple Python versions, we also provide a ``.tox`` +file. + + Building the docs ================= If you make changes to the documentation, you should preview your changes before committing them:: - $ pip install sphinx - $ cd src/pelican/docs + $ pip install -r requirements/docs.pip + $ cd docs $ make html Open ``_build/html/index.html`` in your browser to preview the documentation. @@ -62,9 +66,8 @@ Running the test suite ====================== -Each time you add a feature, there are two things to do regarding tests: -check that the existing tests pass, and add tests for the new feature -or bugfix. +Each time you add a feature, there are two things to do regarding tests: check +that the existing tests pass, and add tests for the new feature or bugfix. The tests live in ``pelican/tests`` and you can run them using the "discover" feature of ``unittest``:: @@ -76,8 +79,8 @@ output." If you have made changes that affect the HTML output generated by Pelican, and the changes to that output are expected and deemed correct given the nature of your changes, then you should update the output used by the -functional tests. To do so, **make sure you have both ``en_EN.utf8`` and -``fr_FR.utf8`` locales installed**, and then run the following two commands:: +functional tests. To do so, **make sure you have both** ``en_EN.utf8`` **and** +``fr_FR.utf8`` **locales installed**, and then run the following two commands:: $ LC_ALL=en_US.utf8 pelican -o pelican/tests/output/custom/ \ -s samples/pelican.conf.py samples/content/ @@ -86,56 +89,60 @@ $ LC_ALL=en_US.utf8 pelican -o pelican/tests/output/basic/ \ samples/content/ -Testing on Python 2 and 3 -------------------------- +You may also find that some tests are skipped because some dependency (e.g., +Pandoc) is not installed. This does not automatically mean that these tests +have passed; you should at least verify that any skipped tests are not affected +by your changes. -Testing on Python 3 currently requires some extra steps: installing -Python 3-compatible versions of dependent packages and plugins. +You should run the test suite under each of the supported versions of Python. +This is best done by creating a separate Python environment for each version. +Tox_ is a useful tool to automate running tests inside ``virtualenv`` +environments. -Tox_ is a useful tool to run tests on both versions. It will install the -Python 3-compatible version of dependent packages. +.. _Tox: https://tox.readthedocs.io/en/latest/ -.. _Tox: http://testrun.org/tox/latest/ +Python 2/3 compatibility development tips +========================================= -Python 3 development tips -========================= +Here are some tips that may be useful for writing code that is compatible with +both Python 2.7 and Python 3: -Here are some tips that may be useful when doing some code for both Python 2.7 -and Python 3 at the same time: +- Use new syntax. For example: -- Assume every string and literal is unicode (import unicode_literals): + - ``print .. -> print(..)`` + - ``except .., e -> except .. as e`` - - Do not use prefix ``u'``. - - Do not encode/decode strings in the middle of sth. Follow the code to the - source (or target) of a string and encode/decode at the first/last possible - point. - - In other words, write your functions to expect and to return unicode. - - Encode/decode strings if e.g. the source is a Python function that is known - to handle this badly, e.g. strftime() in Python 2. - -- Use new syntax: print function, "except ... *as* e" (not comma) etc. -- Refactor method calls like ``dict.iteritems()``, ``xrange()`` etc. in a way - that runs without code change in both Python versions. -- Do not use magic method ``__unicode()__`` in new classes. Use only ``__str()__`` - and decorate the class with ``@python_2_unicode_compatible``. -- Do not start int literals with a zero. This is a syntax error in Py3k. -- Unfortunately I did not find an octal notation that is valid in both - Pythons. Use decimal instead. -- use six, e.g.: +- Use new methods. For example: + + - ``dict.iteritems() -> dict.items()`` + - ``xrange(..) - > list(range(..))`` + +- Use ``six`` where necessary. For example: - ``isinstance(.., basestring) -> isinstance(.., six.string_types)`` - ``isinstance(.., unicode) -> isinstance(.., six.text_type)`` -- ``setlocale()`` in Python 2 bails when we give the locale name as unicode, - and since we are using ``from __future__ import unicode_literals``, we do - that everywhere! As a workaround, I enclosed the localename with ``str()``; - in Python 2 this casts the name to a byte string, in Python 3 this should do - nothing, because the locale name already had been unicode. +- Assume every string and literal is Unicode: -- Kept range() almost everywhere as-is (2to3 suggests list(range())), just - changed it where I felt necessary. + - Use ``from __future__ import unicode_literals`` + - Do not use the prefix ``u'`` before strings. + - Do not encode/decode strings in the middle of something. Follow the code to + the source/target of a string and encode/decode at the first/last possible + point. + - In particular, write your functions to expect and to return Unicode. + - Encode/decode strings if the string is the output of a Python function that + is known to handle this badly. For example, ``strftime()`` in Python 2. + - Do not use the magic method ``__unicode()__`` in new classes. Use only + ``__str()__`` and decorate the class with ``@python_2_unicode_compatible``. -- Changed xrange() back to range(), so it is valid in both Python versions. +- ``setlocale()`` in Python 2 fails when we give the locale name as Unicode, + and since we are using ``from __future__ import unicode_literals``, we do + that everywhere! As a workaround, enclose the locale name with ``str()``; + in Python 2 this casts the name to a byte string, while in Python 3 this + should do nothing, because the locale name was already Unicode. +- Do not start integer literals with a zero. This is a syntax error in Python 3. +- Unfortunately there seems to be no octal notation that is valid in both + Python 2 and 3. Use decimal notation instead. Logging tips @@ -170,9 +177,9 @@ ``extra`` dict if your generic message needs formatting. Limit is set to ``5``, i.e, first four logs with the same ``'limit_msg'`` are -outputted normally but the fifth one will be logged using -``'limit_msg'`` (and ``'limit_args'`` if present). After the fifth, -corresponding log messages will be ignored. +outputted normally but the fifth one will be logged using ``'limit_msg'`` (and +``'limit_args'`` if present). After the fifth, corresponding log messages will +be ignored. For example, if you want to log missing resources, use the following code:: diff -Nru pelican-3.7.1+dfsg/docs/faq.rst pelican-4.0.1+dfsg/docs/faq.rst --- pelican-3.7.1+dfsg/docs/faq.rst 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/docs/faq.rst 2018-11-30 16:31:43.000000000 +0000 @@ -12,10 +12,10 @@ =============== There are several ways to help out. First, you can report any Pelican -suggestions or problems you might have via IRC (preferred) or the -`issue tracker `_. If submitting -an issue report, please first check the existing issue list (both open and -closed) in order to avoid submitting a duplicate issue. +suggestions or problems you might have via IRC (preferred) or the `issue +tracker `_. If submitting an +issue report, please first check the existing issue list (both open and closed) +in order to avoid submitting a duplicate issue. If you want to contribute, please fork `the git repository `_, create a new feature branch, make @@ -35,10 +35,10 @@ Changes to the settings file take no effect =========================================== -When experimenting with different settings (especially the metadata -ones) caching may interfere and the changes may not be visible. In -such cases, ensure that caching is disabled via ``LOAD_CONTENT_CACHE = False`` -or use the ``--ignore-cache`` command-line switch. +When experimenting with different settings (especially the metadata ones) +caching may interfere and the changes may not be visible. In such cases, ensure +that caching is disabled via ``LOAD_CONTENT_CACHE = False`` or use the +``--ignore-cache`` command-line switch. I'm creating my own theme. How do I use Pygments for syntax highlighting? ========================================================================= @@ -70,9 +70,9 @@ If you try to generate Markdown content without first installing the Markdown library, may see a message that says ``No valid files found in content``. Markdown is not a hard dependency for Pelican, so if you have content in -Markdown format, you will need to explicitly install the Markdown library. -You can do so by typing the following command, prepending ``sudo`` if -permissions require it:: +Markdown format, you will need to explicitly install the Markdown library. You +can do so by typing the following command, prepending ``sudo`` if permissions +require it:: pip install markdown @@ -150,9 +150,9 @@ What if I want to disable feed generation? ========================================== -To disable feed generation, all feed settings should be set to ``None``. -All but three feed settings already default to ``None``, so if you want to -disable all feed generation, you only need to specify the following settings:: +To disable feed generation, all feed settings should be set to ``None``. All +but three feed settings already default to ``None``, so if you want to disable +all feed generation, you only need to specify the following settings:: FEED_ALL_ATOM = None CATEGORY_FEED_ATOM = None @@ -167,9 +167,9 @@ ============================================================================== `RSS and Atom feeds require all URL links to be absolute -`_. -In order to properly generate links in Pelican you will need to set ``SITEURL`` -to the full path of your site. +`_. In order to properly +generate links in Pelican you will need to set ``SITEURL`` to the full path of +your site. Feeds are still generated when this warning is displayed, but links within may be malformed and thus the feed may not validate. @@ -185,26 +185,26 @@ TAG_FEED -> TAG_FEED_ATOM CATEGORY_FEED -> CATEGORY_FEED_ATOM -Starting in 3.1, the new feed ``FEED_ALL_ATOM`` has been introduced: this -feed will aggregate all posts regardless of their language. This setting -generates ``'feeds/all.atom.xml'`` by default and ``FEED_ATOM`` now defaults to -``None``. The following feed setting has also been renamed:: +Starting in 3.1, the new feed ``FEED_ALL_ATOM`` has been introduced: this feed +will aggregate all posts regardless of their language. This setting generates +``'feeds/all.atom.xml'`` by default and ``FEED_ATOM`` now defaults to ``None``. +The following feed setting has also been renamed:: TRANSLATION_FEED -> TRANSLATION_FEED_ATOM -Older themes that referenced the old setting names may not link properly. -In order to rectify this, please update your theme for compatibility by changing +Older themes that referenced the old setting names may not link properly. In +order to rectify this, please update your theme for compatibility by changing the relevant values in your template files. For an example of complete feed headers and usage please check out the ``simple`` theme. Is Pelican only suitable for blogs? =================================== -No. Pelican can be easily configured to create and maintain any type of static site. -This may require a little customization of your theme and Pelican configuration. -For example, if you are building a launch site for your product and do not need -tags on your site, you could remove the relevant HTML code from your theme. -You can also disable generation of tag-related pages via:: +No. Pelican can be easily configured to create and maintain any type of static +site. This may require a little customization of your theme and Pelican +configuration. For example, if you are building a launch site for your product +and do not need tags on your site, you could remove the relevant HTML code from +your theme. You can also disable generation of tag-related pages via:: TAGS_SAVE_AS = '' TAG_SAVE_AS = '' @@ -212,52 +212,49 @@ Why does Pelican always write all HTML files even with content caching enabled? =============================================================================== -In order to reliably determine whether the HTML output is different -before writing it, a large part of the generation environment -including the template contexts, imported plugins, etc. would have to -be saved and compared, at least in the form of a hash (which would -require special handling of unhashable types), because of all the -possible combinations of plugins, pagination, etc. which may change in -many different ways. This would require a lot more processing time -and memory and storage space. Simply writing the files each time is a -lot faster and a lot more reliable. - -However, this means that the modification time of the files changes -every time, so a ``rsync`` based upload will transfer them even if -their content hasn't changed. A simple solution is to make ``rsync`` -use the ``--checksum`` option, which will make it compare the file -checksums in a much faster way than Pelican would. - -When only several specific output files are of interest (e.g. when -working on some specific page or the theme templates), the -`WRITE_SELECTED` option may help, see -:ref:`writing_only_selected_content`. +In order to reliably determine whether the HTML output is different before +writing it, a large part of the generation environment including the template +contexts, imported plugins, etc. would have to be saved and compared, at least +in the form of a hash (which would require special handling of unhashable +types), because of all the possible combinations of plugins, pagination, etc. +which may change in many different ways. This would require a lot more +processing time and memory and storage space. Simply writing the files each +time is a lot faster and a lot more reliable. + +However, this means that the modification time of the files changes every time, +so a ``rsync`` based upload will transfer them even if their content hasn't +changed. A simple solution is to make ``rsync`` use the ``--checksum`` option, +which will make it compare the file checksums in a much faster way than Pelican +would. + +When only several specific output files are of interest (e.g. when working on +some specific page or the theme templates), the `WRITE_SELECTED` option may +help, see :ref:`writing_only_selected_content`. How to process only a subset of all articles? ============================================= -It is often useful to process only e.g. 10 articles for debugging -purposes. This can be achieved by explicitly specifying only the -filenames of those articles in ``ARTICLE_PATHS``. A list of such -filenames could be found using a command similar to ``cd content; -find -name '*.md' | head -n 10``. +It is often useful to process only e.g. 10 articles for debugging purposes. +This can be achieved by explicitly specifying only the filenames of those +articles in ``ARTICLE_PATHS``. A list of such filenames could be found using a +command similar to ``cd content; find -name '*.md' | head -n 10``. My tag-cloud is missing/broken since I upgraded Pelican ======================================================= In an ongoing effort to steamline Pelican, `tag_cloud` generation has been moved out of the pelican core and into a separate `plugin -`_. -See the :ref:`plugins` documentation further information about the -Pelican plugin system. +`_. See +the :ref:`plugins` documentation further information about the Pelican plugin +system. Since I upgraded Pelican my pages are no longer rendered ======================================================== -Pages were available to themes as lowercase ``pages`` and uppercase -``PAGES``. To bring this inline with the :ref:`templates-variables` section, -``PAGES`` has been removed. This is quickly resolved by updating your theme -to iterate over ``pages`` instead of ``PAGES``. Just replace:: +Pages were available to themes as lowercase ``pages`` and uppercase ``PAGES``. +To bring this inline with the :ref:`templates-variables` section, ``PAGES`` has +been removed. This is quickly resolved by updating your theme to iterate over +``pages`` instead of ``PAGES``. Just replace:: {% for pg in PAGES %} @@ -271,8 +268,8 @@ Pelican's article and page generators run before it's static generator. That means if you use a setup similar to the default configuration, where a static source directory is defined inside a ``*_PATHS`` setting, all files that have a -valid content file ending (``.html``, ``.rst``, ``.md``, ...) will be treated as -articles or pages before they get treated as static files. +valid content file ending (``.html``, ``.rst``, ``.md``, ...) will be treated +as articles or pages before they get treated as static files. To circumvent this issue either use the appropriate ``*_EXCLUDES`` setting or disable the offending reader via ``READERS`` if you don't need it. diff -Nru pelican-3.7.1+dfsg/docs/importer.rst pelican-4.0.1+dfsg/docs/importer.rst --- pelican-3.7.1+dfsg/docs/importer.rst 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/docs/importer.rst 2018-11-30 16:31:43.000000000 +0000 @@ -9,24 +9,32 @@ ``pelican-import`` is a command-line tool for converting articles from other software to reStructuredText or Markdown. The supported import formats are: -- WordPress XML export +- Blogger XML export - Dotclear export - Posterous API - Tumblr API +- WordPress XML export - RSS/Atom feed The conversion from HTML to reStructuredText or Markdown relies on `Pandoc`_. For Dotclear, if the source posts are written with Markdown syntax, they will not be converted (as Pelican also supports Markdown). +.. note:: + + Unlike Pelican, Wordpress supports multiple categories per article. These + are imported as a comma-separated string. You have to resolve these + manually, or use a plugin that enables multiple categories per article + (like `more_categories`_). Dependencies ============ ``pelican-import`` has some dependencies not required by the rest of Pelican: -- *BeautifulSoup4* and *lxml*, for WordPress and Dotclear import. Can be installed like - any other Python package (``pip install BeautifulSoup4 lxml``). +- *BeautifulSoup4* and *lxml*, for WordPress and Dotclear import. Can be + installed like any other Python package (``pip install BeautifulSoup4 + lxml``). - *Feedparser*, for feed import (``pip install feedparser``). - *Pandoc*, see the `Pandoc site`_ for installation instructions on your operating system. @@ -40,9 +48,9 @@ :: - pelican-import [-h] [--wpfile] [--dotclear] [--posterous] [--tumblr] [--feed] [-o OUTPUT] - [-m MARKUP] [--dir-cat] [--dir-page] [--strip-raw] [--disable-slugs] - [-e EMAIL] [-p PASSWORD] [-b BLOGNAME] + pelican-import [-h] [--blogger] [--dotclear] [--posterous] [--tumblr] [--wpfile] [--feed] + [-o OUTPUT] [-m MARKUP] [--dir-cat] [--dir-page] [--strip-raw] [--wp-custpost] + [--wp-attach] [--disable-slugs] [-e EMAIL] [-p PASSWORD] [-b BLOGNAME] input|api_token|api_key Positional arguments @@ -57,24 +65,38 @@ ------------------ -h, --help Show this help message and exit - --wpfile WordPress XML export (default: False) + --blogger Blogger XML export (default: False) --dotclear Dotclear export (default: False) --posterous Posterous API (default: False) --tumblr Tumblr API (default: False) + --wpfile WordPress XML export (default: False) --feed Feed to parse (default: False) -o OUTPUT, --output OUTPUT - Output path (default: output) + Output path (default: content) -m MARKUP, --markup MARKUP Output markup format (supports rst & markdown) (default: rst) --dir-cat Put files in directories with categories name (default: False) --dir-page Put files recognised as pages in "pages/" sub- - directory (wordpress import only) (default: False) - --filter-author Import only post from the specified author. + directory (blogger and wordpress import only) + (default: False) + --filter-author Import only post from the specified author --strip-raw Strip raw HTML code that can't be converted to markup such as flash embeds or iframes (wordpress import only) (default: False) + --wp-custpost Put wordpress custom post types in directories. If + used with --dir-cat option directories will be created + as "/post_type/category/" (wordpress import only) + --wp-attach Download files uploaded to wordpress as attachments. + Files will be added to posts as a list in the post + header and links to the files within the post will be + updated. All files will be downloaded, even if they + aren't associated with a post. Files will be downloaded + with their original path inside the output directory, + e.g. "output/wp-uploads/date/postname/file.jpg". + (wordpress import only) (requires an internet + connection) --disable-slugs Disable storing slugs from imported posts within output. With this disabled, your Pelican URLs may not be consistent with your original posts. (default: @@ -90,9 +112,9 @@ Examples ======== -For WordPress:: +For Blogger:: - $ pelican-import --wpfile -o ~/output ~/posts.xml + $ pelican-import --blogger -o ~/output ~/posts.xml For Dotclear:: @@ -106,10 +128,16 @@ $ pelican-import --tumblr -o ~/output --blogname= +For WordPress:: + + $ pelican-import --wpfile -o ~/output ~/posts.xml + Tests ===== To test the module, one can use sample files: -- for WordPress: http://wpcandy.com/made/the-sample-post-collection +- for WordPress: http://www.wpbeginner.com/wp-themes/how-to-add-dummy-content-for-theme-development-in-wordpress/ - for Dotclear: http://media.dotaddict.org/tda/downloads/lorem-backup.txt + +.. _more_categories: http://github.com/getpelican/pelican-plugins/tree/master/more_categories \ No newline at end of file diff -Nru pelican-3.7.1+dfsg/docs/index.rst pelican-4.0.1+dfsg/docs/index.rst --- pelican-3.7.1+dfsg/docs/index.rst 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/docs/index.rst 2018-11-30 16:31:43.000000000 +0000 @@ -6,14 +6,14 @@ .. warning:: - This documentation is for the version of Pelican currently under development. - Were you looking for version |last_stable| documentation? + This documentation is for the version of Pelican currently under + development. Were you looking for version |last_stable| documentation? Pelican is a static site generator, written in Python_. Highlights include: -* Write your content directly with your editor of choice - in reStructuredText_ or Markdown_ formats +* Write your content directly with your editor of choice in reStructuredText_ + or Markdown_ formats * Includes a simple CLI tool to (re)generate your site * Easy to interface with distributed version control systems and web hooks * Completely static output is easy to host anywhere diff -Nru pelican-3.7.1+dfsg/docs/install.rst pelican-4.0.1+dfsg/docs/install.rst --- pelican-3.7.1+dfsg/docs/install.rst 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/docs/install.rst 2018-11-30 16:31:43.000000000 +0000 @@ -1,7 +1,7 @@ Installing Pelican ################## -Pelican currently runs best on Python 2.7.x and 3.3+; earlier versions of +Pelican currently runs best on Python 2.7.x and 3.4+; earlier versions of Python are not supported. You can install Pelican via several different methods. The simplest is via @@ -12,8 +12,8 @@ (Keep in mind that operating systems will often require you to prefix the above command with ``sudo`` in order to install Pelican system-wide.) -While the above is the simplest method, the recommended approach is to create -a virtual environment for Pelican via virtualenv_ before installing Pelican. +While the above is the simplest method, the recommended approach is to create a +virtual environment for Pelican via virtualenv_ before installing Pelican. Assuming you have virtualenv_ installed, you can then open a new terminal session and create a new virtual environment for Pelican:: @@ -22,9 +22,8 @@ source bin/activate Once the virtual environment has been created and activated, Pelican can be -installed via ``pip install pelican`` as noted above. Alternatively, if -you have the project source, you can install Pelican using the distutils -method:: +installed via ``pip install pelican`` as noted above. Alternatively, if you +have the project source, you can install Pelican using the distutils method:: cd path-to-Pelican-source python setup.py install @@ -96,15 +95,15 @@ pelican-quickstart Once you finish answering all the questions, your project will consist of the -following hierarchy (except for *pages* — shown in parentheses below — which you -can optionally add yourself if you plan to create non-chronological content):: +following hierarchy (except for *pages* — shown in parentheses below — which +you can optionally add yourself if you plan to create non-chronological +content):: yourproject/ ├── content - │   └── (pages) + │ └── (pages) ├── output - ├── develop_server.sh - ├── fabfile.py + ├── tasks.py ├── Makefile ├── pelicanconf.py # Main settings file └── publishconf.py # Settings to use when ready to publish diff -Nru pelican-3.7.1+dfsg/docs/internals.rst pelican-4.0.1+dfsg/docs/internals.rst --- pelican-3.7.1+dfsg/docs/internals.rst 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/docs/internals.rst 2018-11-30 16:31:43.000000000 +0000 @@ -1,8 +1,8 @@ Pelican internals ################# -This section describe how Pelican works internally. As you'll see, it's -quite simple, but a bit of documentation doesn't hurt. :) +This section describe how Pelican works internally. As you'll see, it's quite +simple, but a bit of documentation doesn't hurt. :) You can also find in the :doc:`report` section an excerpt of a report the original author wrote with some software design information. @@ -13,9 +13,8 @@ ================= What Pelican does is take a list of files and process them into some sort of -output. Usually, the input files are reStructuredText and Markdown -files, and the output is a blog, but both input and output can be anything you -want. +output. Usually, the input files are reStructuredText and Markdown files, and +the output is a blog, but both input and output can be anything you want. The logic is separated into different classes and concepts: @@ -27,9 +26,10 @@ reStructuredText for now, but the system is extensible). Given a file, they return metadata (author, tags, category, etc.) and content (HTML-formatted). -* **Generators** generate the different outputs. For instance, Pelican comes with - ``ArticlesGenerator`` and ``PageGenerator``. Given a configuration, they can do - whatever they want. Most of the time, it's generating files from inputs. +* **Generators** generate the different outputs. For instance, Pelican comes + with ``ArticlesGenerator`` and ``PageGenerator``. Given a configuration, they + can do whatever they want. Most of the time, it's generating files from + inputs. * Pelican also uses templates, so it's easy to write your own theme. The syntax is `Jinja2 `_ and is very easy to learn, so @@ -38,9 +38,9 @@ How to implement a new reader? ============================== -Is there an awesome markup language you want to add to Pelican? -Well, the only thing you have to do is to create a class with a ``read`` -method that returns HTML content and some metadata. +Is there an awesome markup language you want to add to Pelican? Well, the only +thing you have to do is to create a class with a ``read`` method that returns +HTML content and some metadata. Take a look at the Markdown reader:: @@ -65,17 +65,17 @@ Simple, isn't it? -If your new reader requires additional Python dependencies, then you should wrap -their ``import`` statements in a ``try...except`` block. Then inside the reader's -class, set the ``enabled`` class attribute to mark import success or failure. -This makes it possible for users to continue using their favourite markup method -without needing to install modules for formats they don't use. +If your new reader requires additional Python dependencies, then you should +wrap their ``import`` statements in a ``try...except`` block. Then inside the +reader's class, set the ``enabled`` class attribute to mark import success or +failure. This makes it possible for users to continue using their favourite +markup method without needing to install modules for formats they don't use. How to implement a new generator? ================================= -Generators have two important methods. You're not forced to create -both; only the existing ones will be called. +Generators have two important methods. You're not forced to create both; only +the existing ones will be called. * ``generate_context``, that is called first, for all the generators. Do whatever you have to do, and update the global context if needed. This @@ -89,5 +89,5 @@ generating the output. :) It's here that you may want to look at the context and call the methods of the ``writer`` object that is passed as the first argument of this function. In the ``PageGenerator`` example, this method will - look at all the pages recorded in the global context and output a file on - the disk (using the writer method ``write_file``) for each page encountered. + look at all the pages recorded in the global context and output a file on the + disk (using the writer method ``write_file``) for each page encountered. diff -Nru pelican-3.7.1+dfsg/docs/pelican-themes.rst pelican-4.0.1+dfsg/docs/pelican-themes.rst --- pelican-3.7.1+dfsg/docs/pelican-themes.rst 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/docs/pelican-themes.rst 2018-11-30 16:31:43.000000000 +0000 @@ -44,7 +44,8 @@ Listing the installed themes """""""""""""""""""""""""""" -With ``pelican-themes``, you can see the available themes by using the ``-l`` or ``--list`` option: +With ``pelican-themes``, you can see the available themes by using the ``-l`` +or ``--list`` option: .. code-block:: console @@ -57,11 +58,15 @@ two-column@ simple -In this example, we can see there are three themes available: ``notmyidea``, ``simple``, and ``two-column``. +In this example, we can see there are three themes available: ``notmyidea``, +``simple``, and ``two-column``. -``two-column`` is prefixed with an ``@`` because this theme is not copied to the Pelican theme path, but is instead just linked to it (see `Creating symbolic links`_ for details about creating symbolic links). +``two-column`` is prefixed with an ``@`` because this theme is not copied to +the Pelican theme path, but is instead just linked to it (see `Creating +symbolic links`_ for details about creating symbolic links). -Note that you can combine the ``--list`` option with the ``-v`` or ``--verbose`` option to get more verbose output, like this: +Note that you can combine the ``--list`` option with the ``-v`` or +``--verbose`` option to get more verbose output, like this: .. code-block:: console @@ -75,7 +80,8 @@ """"""""""""""""" You can install one or more themes using the ``-i`` or ``--install`` option. -This option takes as argument the path(s) of the theme(s) you want to install, and can be combined with the verbose option: +This option takes as argument the path(s) of the theme(s) you want to install, +and can be combined with the verbose option: .. code-block:: console @@ -95,8 +101,9 @@ Removing themes """"""""""""""" -The ``pelican-themes`` command can also remove themes from the Pelican themes path. -The ``-r`` or ``--remove`` option takes as argument the name(s) of the theme(s) you want to remove, and can be combined with the ``--verbose`` option. +The ``pelican-themes`` command can also remove themes from the Pelican themes +path. The ``-r`` or ``--remove`` option takes as argument the name(s) of the +theme(s) you want to remove, and can be combined with the ``--verbose`` option. .. code-block:: console @@ -113,15 +120,19 @@ Creating symbolic links """"""""""""""""""""""" -``pelican-themes`` can also install themes by creating symbolic links instead of copying entire themes into the Pelican themes path. +``pelican-themes`` can also install themes by creating symbolic links instead +of copying entire themes into the Pelican themes path. -To symbolically link a theme, you can use the ``-s`` or ``--symlink``, which works exactly as the ``--install`` option: +To symbolically link a theme, you can use the ``-s`` or ``--symlink``, which +works exactly as the ``--install`` option: .. code-block:: console # pelican-themes --symlink ~/Dev/Python/pelican-themes/two-column -In this example, the ``two-column`` theme is now symbolically linked to the Pelican themes path, so we can use it, but we can also modify it without having to reinstall it after each modification. +In this example, the ``two-column`` theme is now symbolically linked to the +Pelican themes path, so we can use it, but we can also modify it without having +to reinstall it after each modification. This is useful for theme development: @@ -142,7 +153,9 @@ Doing several things at once """""""""""""""""""""""""""" -The ``--install``, ``--remove`` and ``--symlink`` option are not mutually exclusive, so you can combine them in the same command line to do more than one operation at time, like this: +The ``--install``, ``--remove`` and ``--symlink`` option are not mutually +exclusive, so you can combine them in the same command line to do more than one +operation at time, like this: .. code-block:: console @@ -152,4 +165,5 @@ --symlink ~/Dev/Python/pelican-themes/two-column \ --verbose -In this example, the theme ``notmyidea-cms`` is replaced by the theme ``notmyidea-cms-fr`` +In this example, the theme ``notmyidea-cms`` is replaced by the theme +``notmyidea-cms-fr`` diff -Nru pelican-3.7.1+dfsg/docs/plugins.rst pelican-4.0.1+dfsg/docs/plugins.rst --- pelican-3.7.1+dfsg/docs/plugins.rst 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/docs/plugins.rst 2018-11-30 16:31:43.000000000 +0000 @@ -22,11 +22,10 @@ .. note:: - When experimenting with different plugins (especially the ones that - deal with metadata and content) caching may interfere and the - changes may not be visible. In such cases disable caching with - ``LOAD_CONTENT_CACHE = False`` or use the ``--ignore-cache`` - command-line switch. + When experimenting with different plugins (especially the ones that deal + with metadata and content) caching may interfere and the changes may not be + visible. In such cases disable caching with ``LOAD_CONTENT_CACHE = False`` + or use the ``--ignore-cache`` command-line switch. If your plugins are not in an importable path, you can specify a list of paths via the ``PLUGIN_PATHS`` setting. As shown in the following example, paths in @@ -60,7 +59,7 @@ from pelican import signals def test(sender): - print "%s initialized !!" % sender + print("{} initialized !!".format(sender)) def register(): signals.initialized.connect(test) @@ -108,6 +107,7 @@ use if code needs to do something before every page is parsed. page_generator_init page_generator invoked in the PagesGenerator.__init__ page_generator_finalized page_generator invoked at the end of PagesGenerator.generate_context +page_generator_write_page page_generator, content invoked before writing each page, the page is passed as content page_writer_finalized page_generator, writer invoked after all pages have been written, but before the page generator is closed. static_generator_context static_generator, metadata @@ -118,22 +118,24 @@ static_generator_finalized static_generator invoked at the end of StaticGenerator.generate_context content_object_init content_object invoked at the end of Content.__init__ content_written path, context invoked each time a content file is written. +feed_generated context, feed invoked each time a feed gets generated. Can be used to modify a feed + object before it gets written. feed_written path, context, feed invoked each time a feed file is written. ================================= ============================ =========================================================================== .. warning:: - Avoid ``content_object_init`` signal if you intend to read ``summary`` - or ``content`` properties of the content object. That combination can - result in unresolved links when :ref:`ref-linking-to-internal-content` - (see `pelican-plugins bug #314`_). Use ``_summary`` and ``_content`` - properties instead, or, alternatively, run your plugin at a later - stage (e.g. ``all_generators_finalized``). + Avoid ``content_object_init`` signal if you intend to read ``summary`` or + ``content`` properties of the content object. That combination can result in + unresolved links when :ref:`ref-linking-to-internal-content` (see + `pelican-plugins bug #314`_). Use ``_summary`` and ``_content`` properties + instead, or, alternatively, run your plugin at a later stage (e.g. + ``all_generators_finalized``). .. note:: - After Pelican 3.2, signal names were standardized. Older plugins - may need to be updated to use the new names: + After Pelican 3.2, signal names were standardized. Older plugins may need + to be updated to use the new names: ========================== =========================== Old name New name @@ -159,9 +161,9 @@ -------------------------- One thing you might want is to add support for your very own input format. -While it might make sense to add this feature in Pelican core, we -wisely chose to avoid this situation and instead have the different readers -defined via plugins. +While it might make sense to add this feature in Pelican core, we wisely chose +to avoid this situation and instead have the different readers defined via +plugins. The rationale behind this choice is mainly that plugins are really easy to write and don't slow down Pelican itself when they're not active. @@ -213,6 +215,7 @@ # define a new generator here if you need to return MyGenerator - signals.get_generators.connect(get_generators) + def register(): + signals.get_generators.connect(get_generators) .. _pelican-plugins bug #314: https://github.com/getpelican/pelican-plugins/issues/314 diff -Nru pelican-3.7.1+dfsg/docs/publish.rst pelican-4.0.1+dfsg/docs/publish.rst --- pelican-3.7.1+dfsg/docs/publish.rst 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/docs/publish.rst 2018-11-30 16:31:43.000000000 +0000 @@ -25,14 +25,14 @@ pelican --write-selected output/posts/my-post-title.html Note that you must specify the path to the generated *output* file — not the -source content. To determine the output file path, use the ``--debug`` flag to -determine the correct file name and location. If desired, ``--write-selected`` -can take a comma-separated list of paths or can be configured as a setting. -(See: :ref:`writing_only_selected_content`) - -You can also tell Pelican to watch for your modifications, instead of -manually re-running it every time you want to see your changes. To enable this, -run the ``pelican`` command with the ``-r`` or ``--autoreload`` option. +source content. To determine the output file name and location, use the +``--debug`` flag. If desired, ``--write-selected`` can take a comma-separated +list of paths or can be configured as a setting. (See: +:ref:`writing_only_selected_content`) + +You can also tell Pelican to watch for your modifications, instead of manually +re-running it every time you want to see your changes. To enable this, run the +``pelican`` command with the ``-r`` or ``--autoreload`` option. Pelican has other command-line switches available. Have a look at the help to see all the options you can use:: @@ -75,17 +75,17 @@ pelican content -s publishconf.py -To base your publish configuration on top of your ``pelicanconf.py``, you -can import your ``pelicanconf`` settings by including the following line in -your ``publishconf.py``:: +To base your publish configuration on top of your ``pelicanconf.py``, you can +import your ``pelicanconf`` settings by including the following line in your +``publishconf.py``:: from pelicanconf import * -If you have generated a ``publishconf.py`` using ``pelican-quickstart``, -this line is included by default. +If you have generated a ``publishconf.py`` using ``pelican-quickstart``, this +line is included by default. -The steps for deploying your site will depend on where it will be hosted. -If you have SSH access to a server running Nginx or Apache, you might use the +The steps for deploying your site will depend on where it will be hosted. If +you have SSH access to a server running Nginx or Apache, you might use the ``rsync`` tool to transmit your site files:: rsync -avc --delete output/ host.example.com:/var/www/your-site/ @@ -98,81 +98,69 @@ ========== While the ``pelican`` command is the canonical way to generate your site, -automation tools can be used to streamline the generation and publication -flow. One of the questions asked during the ``pelican-quickstart`` process -pertains to whether you want to automate site generation and publication. -If you answered "yes" to that question, a ``fabfile.py`` and -``Makefile`` will be generated in the root of your project. These files, -pre-populated with certain information gleaned from other answers provided -during the ``pelican-quickstart`` process, are meant as a starting point and -should be customized to fit your particular needs and usage patterns. If you -find one or both of these automation tools to be of limited utility, these -files can deleted at any time and will not affect usage of the canonical -``pelican`` command. +automation tools can be used to streamline the generation and publication flow. +One of the questions asked during the ``pelican-quickstart`` process pertains +to whether you want to automate site generation and publication. If you +answered "yes" to that question, a ``tasks.py`` and ``Makefile`` will be +generated in the root of your project. These files, pre-populated with certain +information gleaned from other answers provided during the +``pelican-quickstart`` process, are meant as a starting point and should be +customized to fit your particular needs and usage patterns. If you find one or +both of these automation tools to be of limited utility, these files can +deleted at any time and will not affect usage of the canonical ``pelican`` +command. Following are automation tools that "wrap" the ``pelican`` command and can simplify the process of generating, previewing, and uploading your site. -Fabric +Invoke ------ -The advantage of Fabric_ is that it is written in Python and thus can be used +The advantage of Invoke_ is that it is written in Python and thus can be used in a wide range of environments. The downside is that it must be installed -separately. Use the following command to install Fabric, prefixing with +separately. Use the following command to install Invoke, prefixing with ``sudo`` if your environment requires it:: - pip install Fabric + pip install invoke -.. note:: Installing PyCrypto on Windows - - Fabric depends upon PyCrypto_, which is tricky to install - if your system doesn't have a C compiler. - For Windows users, before installing Fabric, use - ``easy_install http://www.voidspace.org.uk/downloads/pycrypto26/pycrypto-2.6.win32-py2.7.exe`` - per this `StackOverflow suggestion `_ - You're more likely to have success - with the Win32 versions of Python 2.7 and PyCrypto, - than with the Win64—\ - even if your operating system is a 64-bit version of Windows. - -Take a moment to open the ``fabfile.py`` file that was generated in your -project root. You will see a number of commands, any one of which can be -renamed, removed, and/or customized to your liking. Using the out-of-the-box +Take a moment to open the ``tasks.py`` file that was generated in your project +root. You will see a number of commands, any one of which can be renamed, +removed, and/or customized to your liking. Using the out-of-the-box configuration, you can generate your site via:: - fab build + invoke build If you'd prefer to have Pelican automatically regenerate your site every time a change is detected (which is handy when testing locally), use the following command instead:: - fab regenerate + invoke regenerate To serve the generated site so it can be previewed in your browser at http://localhost:8000/:: - fab serve + invoke serve If during the ``pelican-quickstart`` process you answered "yes" when asked whether you want to upload your site via SSH, you can use the following command to publish your site via rsync over SSH:: - fab publish + invoke publish These are just a few of the commands available by default, so feel free to -explore ``fabfile.py`` and see what other commands are available. More -importantly, don't hesitate to customize ``fabfile.py`` to suit your specific +explore ``tasks.py`` and see what other commands are available. More +importantly, don't hesitate to customize ``tasks.py`` to suit your specific needs and preferences. Make ---- -A ``Makefile`` is also automatically created for you when you say "yes" to -the relevant question during the ``pelican-quickstart`` process. The advantage -of this method is that the ``make`` command is built into most POSIX systems -and thus doesn't require installing anything else in order to use it. The -downside is that non-POSIX systems (e.g., Windows) do not include ``make``, -and installing it on those systems can be a non-trivial task. +A ``Makefile`` is also automatically created for you when you say "yes" to the +relevant question during the ``pelican-quickstart`` process. The advantage of +this method is that the ``make`` command is built into most POSIX systems and +thus doesn't require installing anything else in order to use it. The downside +is that non-POSIX systems (e.g., Windows) do not include ``make``, and +installing it on those systems can be a non-trivial task. If you want to use ``make`` to generate your site using the settings in ``pelicanconf.py``, run:: @@ -201,10 +189,7 @@ make devserver The above command will simultaneously run Pelican in regeneration mode as well -as serve the output at http://localhost:8000. Once you are done testing your -changes, you should stop the development server via:: - - ./develop_server.sh stop +as serve the output at http://localhost:8000. When you're ready to publish your site, you can upload it via the method(s) you chose during the ``pelican-quickstart`` questionnaire. For this example, we'll @@ -219,5 +204,4 @@ executables, such as ``python3``, you can set the ``PY`` and ``PELICAN`` environment variables, respectively, to override the default executable names.) -.. _Fabric: http://fabfile.org/ -.. _PyCrypto: http://pycrypto.org +.. _Invoke: http://www.pyinvoke.org diff -Nru pelican-3.7.1+dfsg/docs/quickstart.rst pelican-4.0.1+dfsg/docs/quickstart.rst --- pelican-3.7.1+dfsg/docs/quickstart.rst 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/docs/quickstart.rst 2018-11-30 16:31:43.000000000 +0000 @@ -54,23 +54,23 @@ pelican content -Your site has now been generated inside the ``output`` directory. (You may see a -warning related to feeds, but that is normal when developing locally and can be -ignored for now.) +Your site has now been generated inside the ``output`` directory. (You may see +a warning related to feeds, but that is normal when developing locally and can +be ignored for now.) Preview your site ----------------- -Open a new terminal session and run the following commands to switch to your -``output`` directory and launch Pelican's web server:: +Open a new terminal session, navigate to your site directory and run the +following command to launch Pelican's web server:: - cd ~/projects/yoursite/output - python -m pelican.server + pelican --listen Preview your site by navigating to http://localhost:8000/ in your browser. -Continue reading the other documentation sections for more detail, and check out -the Pelican wiki's Tutorials_ page for links to community-published tutorials. +Continue reading the other documentation sections for more detail, and check +out the Pelican wiki's Tutorials_ page for links to community-published +tutorials. .. _Tutorials: https://github.com/getpelican/pelican/wiki/Tutorials diff -Nru pelican-3.7.1+dfsg/docs/report.rst pelican-4.0.1+dfsg/docs/report.rst --- pelican-3.7.1+dfsg/docs/report.rst 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/docs/report.rst 2018-11-30 16:31:43.000000000 +0000 @@ -7,29 +7,27 @@ right after writing Pelican, in December 2010. The information may not be up-to-date. -Pelican is a simple static blog generator. It parses markup files -(Markdown or reStructuredText for now) and generates an HTML folder -with all the files in it. -I've chosen to use Python to implement Pelican because it seemed to -be simple and to fit to my needs. I did not wanted to define a class for -each thing, but still wanted to keep my things loosely coupled. -It turns out that it was exactly what I wanted. From time to time, -thanks to the feedback of some users, it took me a very few time to -provide fixes on it. So far, I've re-factored the Pelican code by two +Pelican is a simple static blog generator. It parses markup files (Markdown or +reStructuredText for now) and generates an HTML folder with all the files in +it. I've chosen to use Python to implement Pelican because it seemed to be +simple and to fit to my needs. I did not wanted to define a class for each +thing, but still wanted to keep my things loosely coupled. It turns out that it +was exactly what I wanted. From time to time, thanks to the feedback of some +users, it took me a very few time to provide fixes on it. So far, I've +re-factored the Pelican code by two times; each time took less than 30 minutes. Use case ======== -I was previously using WordPress, a solution you can host on a web -server to manage your blog. Most of the time, I prefer using markup -languages such as Markdown or reStructuredText to type my articles. -To do so, I use vim. I think it is important to let the people choose the -tool they want to write the articles. In my opinion, a blog manager -should just allow you to take any kind of input and transform it to a -weblog. That's what Pelican does. -You can write your articles using the tool you want, and the markup -language you want, and then generate a static HTML weblog. +I was previously using WordPress, a solution you can host on a web server to +manage your blog. Most of the time, I prefer using markup languages such as +Markdown or reStructuredText to type my articles. To do so, I use vim. I think +it is important to let the people choose the tool they want to write the +articles. In my opinion, a blog manager should just allow you to take any kind +of input and transform it to a weblog. That's what Pelican does. You can write +your articles using the tool you want, and the markup language you want, and +then generate a static HTML weblog. .. image:: _static/overall.png @@ -40,39 +38,36 @@ ============== Pelican came from a need I have. I started by creating a single file -application, and I have make it grow to support what it does by now. -To start, I wrote a piece of documentation about what I wanted to do. -Then, I created the content I wanted to parse (the reStructuredText files) -and started experimenting with the code. Pelican was 200 lines long and -contained almost ten functions and one class when it was first usable. - -I have been facing different problems all over the time and wanted to -add features to Pelican while using it. The first change I have done was -to add the support of a settings file. It is possible to pass the options to -the command line, but can be tedious if there is a lot of them. -In the same way, I have added the support of different things over -time: Atom feeds, multiple themes, multiple markup support, etc. -At some point, it appears that the "only one file" mantra was not good -enough for Pelican, so I decided to rework a bit all that, and split this in -multiple different files. +application, and I have make it grow to support what it does by now. To start, +I wrote a piece of documentation about what I wanted to do. Then, I created the +content I wanted to parse (the reStructuredText files) and started +experimenting with the code. Pelican was 200 lines long and contained almost +ten functions and one class when it was first usable. + +I have been facing different problems all over the time and wanted to add +features to Pelican while using it. The first change I have done was to add the +support of a settings file. It is possible to pass the options to the command +line, but can be tedious if there is a lot of them. In the same way, I have +added the support of different things over time: Atom feeds, multiple themes, +multiple markup support, etc. At some point, it appears that the "only one +file" mantra was not good enough for Pelican, so I decided to rework a bit all +that, and split this in multiple different files. I’ve separated the logic in different classes and concepts: * *writers* are responsible of all the writing process of the files. - They are responsible of writing .html files, RSS feeds and so on. - Since those operations are commonly used, the object is created - once, and then passed to the generators. + They are responsible of writing .html files, RSS feeds and so on. Since those + operations are commonly used, the object is created once, and then passed to + the generators. * *readers* are used to read from various formats (Markdown and - reStructuredText for now, but the system is extensible). Given a - file, they return metadata (author, tags, category, etc) and - content (HTML formatted). + reStructuredText for now, but the system is extensible). Given a file, they + return metadata (author, tags, category, etc) and content (HTML formatted). * *generators* generate the different outputs. For instance, Pelican - comes with an ArticlesGenerator and PagesGenerator, into - others. Given a configuration, they can do whatever you want - them to do. Most of the time it's generating files from inputs - (user inputs and files). + comes with an ArticlesGenerator and PagesGenerator, into others. Given a + configuration, they can do whatever you want them to do. Most of the time + it's generating files from inputs (user inputs and files). I also deal with contents objects. They can be ``Articles``, ``Pages``, ``Quotes``, or whatever you want. They are defined in the ``contents.py`` @@ -90,32 +85,30 @@ Internally, the following process is followed: -* First of all, the command line is parsed, and some content from - the user is used to initialize the different generator objects. +* First of all, the command line is parsed, and some content from the user is + used to initialize the different generator objects. -* A ``context`` is created. It contains the settings from the command - line and a settings file if provided. +* A ``context`` is created. It contains the settings from the command line and + a settings file if provided. * The ``generate_context`` method of each generator is called, updating the context. +* The writer is created and given to the ``generate_output`` method of each + generator. -* The writer is created and given to the ``generate_output`` method of - each generator. - -I make two calls because it is important that when the output is -generated by the generators, the context will not change. In other -words, the first method ``generate_context`` should modify the context, -whereas the second ``generate_output`` method should not. +I make two calls because it is important that when the output is generated by +the generators, the context will not change. In other words, the first method +``generate_context`` should modify the context, whereas the second +``generate_output`` method should not. Then, it is up to the generators to do what the want, in the -``generate_context`` and ``generate_content`` method. -Taking the ``ArticlesGenerator`` class will help to understand some others -concepts. Here is what happens when calling the ``generate_context`` -method: - -* Read the folder “path”, looking for restructured text files, load - each of them, and construct a content object (``Article``) with it. To do so, - use ``Reader`` objects. +``generate_context`` and ``generate_content`` method. Taking the +``ArticlesGenerator`` class will help to understand some others concepts. Here +is what happens when calling the ``generate_context`` method: + +* Read the folder “path”, looking for restructured text files, load each of + them, and construct a content object (``Article``) with it. To do so, use + ``Reader`` objects. * Update the ``context`` with all those articles. -Then, the ``generate_content`` method uses the ``context`` and the ``writer`` to -generate the wanted output. +Then, the ``generate_content`` method uses the ``context`` and the ``writer`` +to generate the wanted output. diff -Nru pelican-3.7.1+dfsg/docs/settings.rst pelican-4.0.1+dfsg/docs/settings.rst --- pelican-3.7.1+dfsg/docs/settings.rst 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/docs/settings.rst 2018-11-30 16:31:43.000000000 +0000 @@ -1,8 +1,8 @@ Settings ######## -Pelican is configurable thanks to a settings file you can pass to -the command line:: +Pelican is configurable thanks to a settings file you can pass to the command +line:: pelican content -s path/to/your/pelicanconf.py @@ -11,16 +11,22 @@ .. note:: - When experimenting with different settings (especially the metadata - ones) caching may interfere and the changes may not be visible. In - such cases disable caching with ``LOAD_CONTENT_CACHE = False`` or - use the ``--ignore-cache`` command-line switch. + When experimenting with different settings (especially the metadata ones) + caching may interfere and the changes may not be visible. In such cases + disable caching with ``LOAD_CONTENT_CACHE = False`` or use the + ``--ignore-cache`` command-line switch. Settings are configured in the form of a Python module (a file). There is an `example settings file `_ available for reference. +To see a list of current settings in your environment, including both default +and any customized values, run the following command (append one or more +specific setting names as arguments to see values for those settings only):: + + pelican --print-settings + All the setting identifiers must be set in all-caps, otherwise they will not be processed. Setting values that are numbers (5, 20, etc.), booleans (True, False, None, etc.), dictionaries, or tuples should *not* be enclosed in @@ -28,10 +34,9 @@ quotation marks. Unless otherwise specified, settings that refer to paths can be either absolute -or relative to the configuration file. - -The settings you define in the configuration file will be passed to the -templates, which allows you to use your settings to add site-wide content. +or relative to the configuration file. The settings you define in the +configuration file will be passed to the templates, which allows you to use +your settings to add site-wide content. Here is a list of settings for Pelican: @@ -84,8 +89,8 @@ .. data:: JINJA_ENVIRONMENT = {'trim_blocks': True, 'lstrip_blocks': True} A dictionary of custom Jinja2 environment variables you want to use. This - also includes a list of extensions you may want to include. - See `Jinja Environment documentation`_. + also includes a list of extensions you may want to include. See `Jinja + Environment documentation`_. .. data:: JINJA_FILTERS = {} @@ -131,7 +136,7 @@ Extra configuration settings for the Markdown processor. Refer to the Python Markdown documentation's `Options section - `_ for a complete + `_ for a complete list of supported options. The ``extensions`` option will be automatically computed from the ``extension_configs`` option. @@ -203,10 +208,12 @@ .. data:: SITEURL - Base URL of your website. Not defined by default, so it is best to specify + Base URL of your web site. Not defined by default, so it is best to specify your SITEURL; if you do not, feeds will not be generated with - properly-formed URLs. You should include ``http://`` and your domain, with - no trailing slash at the end. Example: ``SITEURL = 'http://mydomain.com'`` + properly-formed URLs. If your site is available via HTTPS, this setting + should begin with ``https://`` — otherwise use ``http://``. Then append your + domain, with no trailing slash at the end. Example: ``SITEURL = + 'https://example.com'`` .. data:: STATIC_PATHS = ['images'] @@ -230,6 +237,20 @@ ``PAGE_PATHS``. If you are trying to publish your site's source files, consider using the ``OUTPUT_SOURCES`` setting instead. +.. data:: STATIC_CREATE_LINKS = False + + Create links instead of copying files. If the content and output directories + are on the same device, then create hard links. Falls back to symbolic + links if the output directory is on a different filesystem. If symlinks are + created, don't forget to add the ``-L`` or ``--copy-links`` option to rsync + when uploading your site. + +.. data:: STATIC_CHECK_IF_MODIFIED = False + + If set to ``True``, and ``STATIC_CREATE_LINKS`` is ``False``, compare mtimes + of content and output files, and only copy content files that are newer than + existing output files. + .. data:: TYPOGRIFY = False If set to True, several typographical improvements will be incorporated into @@ -312,16 +333,25 @@ A list of metadata fields containing reST/Markdown content to be parsed and translated to HTML. +.. data:: PORT = 8000 + + The TCP port to serve content from the output folder via HTTP when pelican + is run with --listen + +.. data:: BIND = '' + + The IP to which to bind the HTTP server. + URL settings ============ The first thing to understand is that there are currently two supported methods -for URL formation: *relative* and *absolute*. Relative URLs are useful -when testing locally, and absolute URLs are reliable and most useful when +for URL formation: *relative* and *absolute*. Relative URLs are useful when +testing locally, and absolute URLs are reliable and most useful when publishing. One method of supporting both is to have one Pelican configuration -file for local development and another for publishing. To see an example of this -type of setup, use the ``pelican-quickstart`` script as described in the +file for local development and another for publishing. To see an example of +this type of setup, use the ``pelican-quickstart`` script as described in the :doc:`Installation ` section, which will produce two separate configuration files for local development and publishing, respectively. @@ -335,8 +365,8 @@ .. note:: If you specify a ``datetime`` directive, it will be substituted using the input files' date metadata attribute. If the date is not specified for a - particular file, Pelican will rely on the file's ``mtime`` timestamp. - Check the `Python datetime documentation`_ for more information. + particular file, Pelican will rely on the file's ``mtime`` timestamp. Check + the `Python datetime documentation`_ for more information. .. _Python datetime documentation: http://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior @@ -357,10 +387,9 @@ PAGE_SAVE_AS = 'pages/{slug}/index.html' This would save your articles into something like -``/posts/2011/Aug/07/sample-post/index.html``, -save your pages into ``/pages/about/index.html``, and render them available at -URLs of ``/posts/2011/Aug/07/sample-post/`` and ``/pages/about/``, -respectively. +``/posts/2011/Aug/07/sample-post/index.html``, save your pages into +``/pages/about/index.html``, and render them available at URLs of +``/posts/2011/Aug/07/sample-post/`` and ``/pages/about/``, respectively. .. data:: RELATIVE_URLS = False @@ -420,6 +449,24 @@ The location we will save the page which doesn't use the default language. +.. data:: DRAFT_PAGE_URL = 'drafts/pages/{slug}.html' + + The URL used to link to a page draft. + +.. data:: DRAFT_PAGE_SAVE_AS = 'drafts/pages/{slug}.html' + + The actual location a page draft is saved at. + +.. data:: DRAFT_PAGE_LANG_URL = 'drafts/pages/{slug}-{lang}.html' + + The URL used to link to a page draft which doesn't use the default + language. + +.. data:: DRAFT_PAGE_LANG_SAVE_AS = 'drafts/pages/{slug}-{lang}.html' + + The actual location a page draft which doesn't use the default language is + saved at. + .. data:: CATEGORY_URL = 'category/{slug}.html' The URL to use for a category. @@ -448,34 +495,28 @@ The location to save per-year archives of your posts. -.. data:: MONTH_ARCHIVE_SAVE_AS = '' - - The location to save per-month archives of your posts. - -.. data:: DAY_ARCHIVE_SAVE_AS = '' +.. data:: YEAR_ARCHIVE_URL = '' - The location to save per-day archives of your posts. + The URL to use for per-year archives of your posts. Used only if you have + the ``{url}`` placeholder in ``PAGINATION_PATTERNS``. -.. data:: SLUG_SUBSTITUTIONS = () +.. data:: MONTH_ARCHIVE_SAVE_AS = '' - Substitutions to make prior to stripping out non-alphanumerics when - generating slugs. Specified as a list of 3-tuples of ``(from, to, skip)`` - which are applied in order. ``skip`` is a boolean indicating whether or not - to skip replacement of non-alphanumeric characters. Useful for backward - compatibility with existing URLs. + The location to save per-month archives of your posts. -.. data:: AUTHOR_SUBSTITUTIONS = () +.. data:: MONTH_ARCHIVE_URL = '' - Substitutions for authors. ``SLUG_SUBSTITUTIONS`` is not taken into account - here! + The URL to use for per-month archives of your posts. Used only if you have + the ``{url}`` placeholder in ``PAGINATION_PATTERNS``. -.. data:: CATEGORY_SUBSTITUTIONS = () +.. data:: DAY_ARCHIVE_SAVE_AS = '' - Added to ``SLUG_SUBSTITUTIONS`` for categories. + The location to save per-day archives of your posts. -.. data:: TAG_SUBSTITUTIONS = () +.. data:: DAY_ARCHIVE_URL = '' - Added to ``SLUG_SUBSTITUTIONS`` for tags. + The URL to use for per-day archives of your posts. Used only if you have the + ``{url}`` placeholder in ``PAGINATION_PATTERNS``. .. note:: @@ -484,29 +525,12 @@ set the corresponding ``*_SAVE_AS`` setting to ``''`` to prevent the relevant page from being generated. -.. note:: - - Substitutions are applied in order with the side effect that keeping - non-alphanum characters applies to the whole string when a replacement - is made. - - For example if you have the following setting:: - - SLUG_SUBSTITUTIONS = (('C++', 'cpp'), ('keep dot', 'keep.dot', True)) - - the string ``Keep Dot`` will be converted to ``keep.dot``, however - ``C++ will keep dot`` will be converted to ``cpp will keep.dot`` instead - of ``cpp-will-keep.dot``! - - If you want to keep non-alphanum characters only for tags or categories - but not other slugs then configure ``TAG_SUBSTITUTIONS`` and - ``CATEGORY_SUBSTITUTIONS`` respectively! - Pelican can optionally create per-year, per-month, and per-day archives of your posts. These secondary archives are disabled by default but are automatically -enabled if you supply format strings for their respective ``_SAVE_AS`` settings. -Period archives fit intuitively with the hierarchical model of web URLs and can -make it easier for readers to navigate through the posts you've written over time. +enabled if you supply format strings for their respective ``_SAVE_AS`` +settings. Period archives fit intuitively with the hierarchical model of web +URLs and can make it easier for readers to navigate through the posts you've +written over time. Example usage:: @@ -519,9 +543,8 @@ .. note:: Period archives work best when the final path segment is ``index.html``. - This way a reader can remove a portion of your URL and automatically - arrive at an appropriate archive of posts, without having to specify - a page name. + This way a reader can remove a portion of your URL and automatically arrive + at an appropriate archive of posts, without having to specify a page name. ``DIRECT_TEMPLATES`` work a bit differently than noted above. Only the ``_SAVE_AS`` settings are available, but it is available for any direct @@ -561,7 +584,37 @@ URLs for direct template pages are theme-dependent. Some themes use corresponding ``*_URL`` setting as string, while others hard-code them: -``'archives.html'``, ``'authors.html'``, ``'categories.html'``, ``'tags.html'``. +``'archives.html'``, ``'authors.html'``, ``'categories.html'``, +``'tags.html'``. + +.. data:: SLUG_REGEX_SUBSTITUTIONS = [ + (r'[^\w\s-]', ''), # remove non-alphabetical/whitespace/'-' chars + (r'(?u)\A\s*', ''), # strip leading whitespace + (r'(?u)\s*\Z', ''), # strip trailing whitespace + (r'[-\s]+', '-'), # reduce multiple whitespace or '-' to single '-' + ] + + Regex substitutions to make when generating slugs of articles and pages. + Specified as a list of pairs of ``(from, to)`` which are applied in order, + ignoring case. The default substitutions have the effect of removing + non-alphanumeric characters and converting internal whitespace to dashes. + Apart from these substitutions, slugs are always converted to lowercase + ascii characters and leading and trailing whitespace is stripped. Useful for + backward compatibility with existing URLs. + +.. data:: AUTHOR_REGEX_SUBSTITUTIONS = SLUG_REGEX_SUBSTITUTIONS + + Regex substitutions for author slugs. Defaults to + ``SLUG_REGEX_SUBSTITUTIONS``. + +.. data:: CATEGORY_REGEX_SUBSTITUTIONS = SLUG_REGEX_SUBSTITUTIONS + + Regex substitutions for category slugs. Defaults to + ``SLUG_REGEX_SUBSTITUTIONS``. + +.. data:: TAG_REGEX_SUBSTITUTIONS = SLUG_REGEX_SUBSTITUTIONS + + Regex substitutions for tag slugs. Defaults to ``SLUG_REGEX_SUBSTITUTIONS``. Time and Date ============= @@ -683,6 +736,10 @@ 'src/resume.html': 'dest/resume.html', 'src/contact.html': 'dest/contact.html'} +.. data:: TEMPLATE_EXTENSION = ['.html'] + + The extensions to use when looking up template files from template names. + .. data:: DIRECT_TEMPLATES = ['index', 'categories', 'authors', 'archives'] List of templates that are used directly to render content. Typically direct @@ -690,15 +747,8 @@ tags and category index pages). If the tag and category collections are not needed, set ``DIRECT_TEMPLATES = ['index', 'archives']`` -.. data:: PAGINATED_DIRECT_TEMPLATES = ['index'] - - Provides the direct templates that should be paginated. - -.. data:: EXTRA_TEMPLATES_PATHS = [] - - A list of paths you want Jinja2 to search for templates. Can be used to - separate templates from the theme. Example: projects, resume, profile ... - These templates need to use ``DIRECT_TEMPLATES`` setting. + ``DIRECT_TEMPLATES`` are searched for over paths maintained in + ``THEME_TEMPLATES_OVERRIDES``. Metadata @@ -712,7 +762,7 @@ The default metadata you want to use for all articles and pages. -.. data:: FILENAME_METADATA = '(?P\d{4}-\d{2}-\d{2}).*' +.. data:: FILENAME_METADATA = r'(?P\d{4}-\d{2}-\d{2}).*' The regexp that will be used to extract any metadata from the filename. All named groups that are matched will be set in the metadata object. The @@ -720,7 +770,7 @@ For example, to extract both the date and the slug:: - FILENAME_METADATA = '(?P\d{4}-\d{2}-\d{2})_(?P.*)' + FILENAME_METADATA = r'(?P\d{4}-\d{2}-\d{2})_(?P.*)' See also ``SLUGIFY_SOURCE``. @@ -736,13 +786,13 @@ unlike some other Pelican file settings. Not all metadata needs to be :ref:`embedded in source file itself -`. For example, blog posts are often named -following a ``YYYY-MM-DD-SLUG.rst`` pattern, or nested into -``YYYY/MM/DD-SLUG`` directories. To extract metadata from the -filename or path, set ``FILENAME_METADATA`` or ``PATH_METADATA`` to -regular expressions that use Python's `group name notation`_ ``(?P…)``. -If you want to attach additional metadata but don't want to encode -it in the path, you can set ``EXTRA_PATH_METADATA``: +`. For example, blog posts are often named following a +``YYYY-MM-DD-SLUG.rst`` pattern, or nested into ``YYYY/MM/DD-SLUG`` +directories. To extract metadata from the filename or path, set +``FILENAME_METADATA`` or ``PATH_METADATA`` to regular expressions that use +Python's `group name notation`_ ``(?P…)``. If you want to attach +additional metadata but don't want to encode it in the path, you can set +``EXTRA_PATH_METADATA``: .. parsed-literal:: @@ -756,8 +806,8 @@ }, } -This can be a convenient way to shift the installed location of a -particular file: +This can be a convenient way to shift the installed location of a particular +file: .. parsed-literal:: @@ -781,8 +831,8 @@ By default, Pelican uses Atom feeds. However, it is also possible to use RSS feeds if you prefer. -Pelican generates category feeds as well as feeds for all your articles. It does -not generate feeds for tags by default, but it is possible to do so using +Pelican generates category feeds as well as feeds for all your articles. It +does not generate feeds for tags by default, but it is possible to do so using the ``TAG_FEED_ATOM`` and ``TAG_FEED_RSS`` settings: .. data:: FEED_DOMAIN = None, i.e. base URL is "/" @@ -795,46 +845,97 @@ .. data:: FEED_ATOM = None, i.e. no Atom feed - Relative URL to output the Atom feed. + The location to save the Atom feed. + +.. data:: FEED_ATOM_URL = None + + Relative URL of the Atom feed. If not set, ``FEED_ATOM`` is used both for + save location and URL. .. data:: FEED_RSS = None, i.e. no RSS - Relative URL to output the RSS feed. + The location to save the RSS feed. + +.. data:: FEED_RSS_URL = None + + Relative URL of the RSS feed. If not set, ``FEED_RSS`` is used both for save + location and URL. .. data:: FEED_ALL_ATOM = 'feeds/all.atom.xml' - Relative URL to output the all-posts Atom feed: this feed will contain all + The location to save the all-posts Atom feed: this feed will contain all posts regardless of their language. +.. data:: FEED_ALL_ATOM_URL = None + + Relative URL of the all-posts Atom feed. If not set, ``FEED_ALL_ATOM`` is + used both for save location and URL. + .. data:: FEED_ALL_RSS = None, i.e. no all-posts RSS - Relative URL to output the all-posts RSS feed: this feed will contain all + The location to save the the all-posts RSS feed: this feed will contain all posts regardless of their language. -.. data:: CATEGORY_FEED_ATOM = 'feeds/%s.atom.xml' +.. data:: FEED_ALL_RSS_URL = None + + Relative URL of the all-posts RSS feed. If not set, ``FEED_ALL_RSS`` is used + both for save location and URL. - Where to put the category Atom feeds. [2]_ +.. data:: CATEGORY_FEED_ATOM = 'feeds/{slug}.atom.xml' + + The location to save the category Atom feeds. [2]_ + +.. data:: CATEGORY_FEED_ATOM_URL = None + + Relative URL of the category Atom feeds, including the ``{slug}`` + placeholder. [2]_ If not set, ``CATEGORY_FEED_ATOM`` is used both for save + location and URL. .. data:: CATEGORY_FEED_RSS = None, i.e. no RSS - Where to put the category RSS feeds. + The location to save the category RSS feeds, including the ``{slug}`` + placeholder. [2]_ + +.. data:: CATEGORY_FEED_RSS_URL = None + + Relative URL of the category RSS feeds, including the ``{slug}`` + placeholder. [2]_ If not set, ``CATEGORY_FEED_RSS`` is used both for save + location and URL. + +.. data:: AUTHOR_FEED_ATOM = 'feeds/{slug}.atom.xml' -.. data:: AUTHOR_FEED_ATOM = 'feeds/%s.atom.xml' + The location to save the author Atom feeds. [2]_ - Where to put the author Atom feeds. [2]_ +.. data:: AUTHOR_FEED_ATOM_URL = None -.. data:: AUTHOR_FEED_RSS = 'feeds/%s.rss.xml' + Relative URL of the author Atom feeds, including the ``{slug}`` placeholder. + [2]_ If not set, ``AUTHOR_FEED_ATOM`` is used both for save location and + URL. - Where to put the author RSS feeds. [2]_ +.. data:: AUTHOR_FEED_RSS = 'feeds/{slug}.rss.xml' + + The location to save the author RSS feeds. [2]_ + +.. data:: AUTHOR_FEED_RSS_URL = None + + Relative URL of the author RSS feeds, including the ``{slug}`` placeholder. + [2]_ If not set, ``AUTHOR_FEED_RSS`` is used both for save location and URL. .. data:: TAG_FEED_ATOM = None, i.e. no tag feed - Relative URL to output the tag Atom feed. It should be defined using a "%s" - match in the tag name. + The location to save the tag Atom feed, including the ``{slug}`` + placeholder. [2]_ + +.. data:: TAG_FEED_ATOM_URL = None + + Relative URL of the tag Atom feed, including the ``{slug}`` placeholder. + [2]_ .. data:: TAG_FEED_RSS = None, i.e. no RSS tag feed - Relative URL to output the tag RSS feed + Relative URL to output the tag RSS feed, including the ``{slug}`` + placeholder. If not set, ``TAG_FEED_RSS`` is used both for save location and + URL. .. data:: FEED_MAX_ITEMS @@ -847,9 +948,10 @@ to ``False``, the full content will be included instead. This setting doesn't affect Atom feeds, only RSS ones. -If you don't want to generate some or any of these feeds, set the above variables to ``None``. +If you don't want to generate some or any of these feeds, set the above +variables to ``None``. -.. [2] %s is the name of the category. +.. [2] ``{slug}`` is replaced by name of the category / author / tag. FeedBurner @@ -857,17 +959,18 @@ If you want to use FeedBurner for your feed, you will likely need to decide upon a unique identifier. For example, if your site were called "Thyme" and -hosted on the www.example.com domain, you might use "thymefeeds" as your -unique identifier, which we'll use throughout this section for illustrative -purposes. In your Pelican settings, set the ``FEED_ATOM`` attribute to +hosted on the www.example.com domain, you might use "thymefeeds" as your unique +identifier, which we'll use throughout this section for illustrative purposes. +In your Pelican settings, set the ``FEED_ATOM`` attribute to ``thymefeeds/main.xml`` to create an Atom feed with an original address of ``http://www.example.com/thymefeeds/main.xml``. Set the ``FEED_DOMAIN`` -attribute to ``http://feeds.feedburner.com``, or ``http://feeds.example.com`` if -you are using a CNAME on your own domain (i.e., FeedBurner's "MyBrand" feature). +attribute to ``http://feeds.feedburner.com``, or ``http://feeds.example.com`` +if you are using a CNAME on your own domain (i.e., FeedBurner's "MyBrand" +feature). There are two fields to configure in the `FeedBurner -`_ interface: "Original Feed" and "Feed -Address". In this example, the "Original Feed" would be +`_ interface: "Original Feed" and "Feed Address". +In this example, the "Original Feed" would be ``http://www.example.com/thymefeeds/main.xml`` and the "Feed Address" suffix would be ``thymefeeds/main.xml``. @@ -875,10 +978,10 @@ Pagination ========== -The default behaviour of Pelican is to list all the article titles along -with a short description on the index page. While this works well for -small-to-medium sites, sites with a large quantity of articles will probably -benefit from paginating this list. +The default behaviour of Pelican is to list all the article titles along with a +short description on the index page. While this works well for small-to-medium +sites, sites with a large quantity of articles will probably benefit from +paginating this list. You can use the following settings to configure the pagination. @@ -892,7 +995,15 @@ The maximum number of articles to include on a page, not including orphans. False to disable pagination. -.. data:: PAGINATION_PATTERNS +.. data:: PAGINATED_TEMPLATES = {'index': None, 'tag': None, 'category': None, 'author': None} + + The templates to use pagination with, and the number of articles to include + on a page. If this value is ``None``, it defaults to ``DEFAULT_PAGINATION``. + +.. data:: PAGINATION_PATTERNS = ( + (1, '{name}{extension}', '{name}{extension}'), + (2, '{name}{number}{extension}', '{name}{number}{extension}'), + ) A set of patterns that are used to determine advanced pagination output. @@ -900,45 +1011,72 @@ Using Pagination Patterns ------------------------- -The ``PAGINATION_PATTERNS`` setting can be used to configure where -subsequent pages are created. The setting is a sequence of three -element tuples, where each tuple consists of:: - - (minimum page, URL setting, SAVE_AS setting,) - -For example, if you wanted the first page to just be ``/``, and the -second (and subsequent) pages to be ``/page/2/``, you would set -``PAGINATION_PATTERNS`` as follows:: +By default, pages subsequent to ``.../foo.html`` are created as +``.../foo2.html``, etc. The ``PAGINATION_PATTERNS`` setting can be used to +change this. It takes a sequence of triples, where each triple consists of:: + + (minimum_page, page_url, page_save_as,) + +For ``page_url`` and ``page_save_as``, you may use a number of variables. +``{url}`` and ``{save_as}`` correspond respectively to the ``*_URL`` and +``*_SAVE_AS`` values of the corresponding page type (e.g. ``ARTICLE_SAVE_AS``). +If ``{save_as} == foo/bar.html``, then ``{name} == foo/bar`` and ``{extension} +== .html``. ``{base_name}`` equals ``{name}`` except that it strips trailing +``/index`` if present. ``{number}`` equals the page number. + +For example, if you want to leave the first page unchanged, but place +subsequent pages at ``.../page/2/`` etc, you could set ``PAGINATION_PATTERNS`` +as follows:: PAGINATION_PATTERNS = ( - (1, '{base_name}/', '{base_name}/index.html'), + (1, '{url}', '{save_as}`, (2, '{base_name}/page/{number}/', '{base_name}/page/{number}/index.html'), ) -This would cause the first page to be written to -``{base_name}/index.html``, and subsequent ones would be written into -``page/{number}`` directories. - Translations ============ -Pelican offers a way to translate articles. See the :doc:`Content ` section for -more information. +Pelican offers a way to translate articles. See the :doc:`Content ` +section for more information. .. data:: DEFAULT_LANG = 'en' The default language to use. -.. data:: TRANSLATION_FEED_ATOM = 'feeds/all-%s.atom.xml' +.. data:: ARTICLE_TRANSLATION_ID = 'slug' + + The metadata attribute(s) used to identify which articles are translations + of one another. May be a string or a collection of strings. Set to ``None`` + or ``False`` to disable the identification of translations. + +.. data:: PAGE_TRANSLATION_ID = 'slug' - Where to put the Atom feed for translations. [3]_ + The metadata attribute(s) used to identify which pages are translations of + one another. May be a string or a collection of strings. Set to ``None`` or + ``False`` to disable the identification of translations. + +.. data:: TRANSLATION_FEED_ATOM = 'feeds/all-{lang}.atom.xml' + + The location to save the Atom feed for translations. [3]_ + +.. data:: TRANSLATION_FEED_ATOM_URL = None + + Relative URL of the Atom feed for translations, including the ``{lang}`` + placeholder. [3]_ If not set, ``TRANSLATION_FEED_ATOM`` is used both for + save location and URL. .. data:: TRANSLATION_FEED_RSS = None, i.e. no RSS Where to put the RSS feed for translations. -.. [3] %s is the language +.. data:: TRANSLATION_FEED_RSS_URL = None + + Relative URL of the RSS feed for translations, including the ``{lang}`` + placeholder. [3]_ If not set, ``TRANSLATION_FEED_RSS`` is used both for save + location and URL. + +.. [3] {lang} is the language code Ordering content @@ -965,7 +1103,7 @@ .. data:: PAGE_ORDER_BY = 'basename' - Defines how the pages (``PAGES`` variable in the template) are sorted. + Defines how the pages (``pages`` variable in the template) are sorted. Options are same as ``ARTICLE_ORDER_BY``. The default value, ``'basename'`` will sort pages by their basename. @@ -974,8 +1112,9 @@ Themes ====== -Creating Pelican themes is addressed in a dedicated section (see :ref:`theming-pelican`). -However, here are the settings that are related to themes. +Creating Pelican themes is addressed in a dedicated section (see +:ref:`theming-pelican`). However, here are the settings that are related to +themes. .. data:: THEME @@ -995,6 +1134,21 @@ with the same names are included in the paths defined in this settings, they will be progressively overwritten. +.. data:: THEME_TEMPLATES_OVERRIDES = [] + + A list of paths you want Jinja2 to search for templates before searching the + theme's ``templates/`` directory. Allows for overriding individual theme + template files without having to fork an existing theme. Jinja2 searches in + the following order: files in ``THEME_TEMPLATES_OVERRIDES`` first, then the + theme's ``templates/``. + + You can also extend templates from the theme using the ``{% extends %}`` + directive utilizing the ``!theme`` prefix as shown in the following example: + + .. parsed-literal:: + + {% extends '!theme/article.html' %} + .. data:: CSS_FILE = 'main.css' Specify the CSS file you want to load. @@ -1005,11 +1159,13 @@ * notmyidea * simple (a synonym for "plain text" :) -There are a number of other themes available at https://github.com/getpelican/pelican-themes. -Pelican comes with :doc:`pelican-themes`, a small script for managing themes. - -You can define your own theme, either by starting from scratch or by duplicating -and modifying a pre-existing theme. Here is :doc:`a guide on how to create your theme `. +There are a number of other themes available at +https://github.com/getpelican/pelican-themes. Pelican comes with +:doc:`pelican-themes`, a small script for managing themes. + +You can define your own theme, either by starting from scratch or by +duplicating and modifying a pre-existing theme. Here is :doc:`a guide on how to +create your theme `. Following are example ways to specify your preferred theme:: @@ -1022,8 +1178,8 @@ # Specify a customized theme, via absolute path THEME = "/home/myuser/projects/mysite/themes/mycustomtheme" -The built-in ``notmyidea`` theme can make good use of the following settings. Feel -free to use them in your themes as well. +The built-in ``notmyidea`` theme can make good use of the following settings. +Feel free to use them in your themes as well. .. data:: SITESUBTITLE @@ -1109,22 +1265,25 @@ comes with the ``LOG_FILTER`` setting. ``LOG_FILTER`` should be a list of tuples ``(level, msg)``, each of them being -composed of the logging level (up to ``warning``) and the message to be ignored. -Simply populate the list with the log messages you want to hide, and they will -be filtered out. +composed of the logging level (up to ``warning``) and the message to be +ignored. Simply populate the list with the log messages you want to hide, and +they will be filtered out. For example:: - - [(logging.WARN, 'TAG_SAVE_AS is set to False')] + + import logging + LOG_FILTER = [(logging.WARN, 'TAG_SAVE_AS is set to False')] It is possible to filter out messages by a template. Check out source code to obtain a template. For example:: - [(logging.WARN, 'Empty alt attribute for image %s in %s')] + import logging + LOG_FILTER = [(logging.WARN, 'Empty alt attribute for image %s in %s')] .. Warning:: + Silencing messages by templates is a dangerous feature. It is possible to unintentionally filter out multiple message types with the same template (including messages from future Pelican versions). Proceed with caution. @@ -1139,16 +1298,15 @@ Reading only modified content ============================= -To speed up the build process, Pelican can optionally read only articles -and pages with modified content. +To speed up the build process, Pelican can optionally read only articles and +pages with modified content. When Pelican is about to read some content source file: 1. The hash or modification time information for the file from a - previous build are loaded from a cache file if ``LOAD_CONTENT_CACHE`` - is ``True``. These files are stored in the ``CACHE_PATH`` - directory. If the file has no record in the cache file, it is read - as usual. + previous build are loaded from a cache file if ``LOAD_CONTENT_CACHE`` is + ``True``. These files are stored in the ``CACHE_PATH`` directory. If the + file has no record in the cache file, it is read as usual. 2. The file is checked according to ``CHECK_MODIFIED_METHOD``: - If set to ``'mtime'``, the modification time of the file is @@ -1156,47 +1314,45 @@ - If set to a name of a function provided by the ``hashlib`` module, e.g. ``'md5'``, the file hash is checked. - If set to anything else or the necessary information about the - file cannot be found in the cache file, the content is read as - usual. + file cannot be found in the cache file, the content is read as usual. 3. If the file is considered unchanged, the content data saved in a - previous build corresponding to the file is loaded from the cache, - and the file is not read. + previous build corresponding to the file is loaded from the cache, and the + file is not read. 4. If the file is considered changed, the file is read and the new - modification information and the content data are saved to the - cache if ``CACHE_CONTENT`` is ``True``. + modification information and the content data are saved to the cache if + ``CACHE_CONTENT`` is ``True``. -If ``CONTENT_CACHING_LAYER`` is set to ``'reader'`` (the default), -the raw content and metadata returned by a reader are cached. If this -setting is instead set to ``'generator'``, the processed content -object is cached. Caching the processed content object may conflict -with plugins (as some reading related signals may be skipped) and the -``WITH_FUTURE_DATES`` functionality (as the ``draft`` status of the -cached content objects would not change automatically over time). - -Checking modification times is faster than comparing file hashes, -but it is not as reliable because ``mtime`` information can be lost, -e.g., when copying content source files using the ``cp`` or ``rsync`` -commands without the ``mtime`` preservation mode (which for ``rsync`` -can be invoked by passing the ``--archive`` flag). - -The cache files are Python pickles, so they may not be readable by -different versions of Python as the pickle format often changes. If -such an error is encountered, it is caught and the cache file is -rebuilt automatically in the new format. The cache files will also be -rebuilt after the ``GZIP_CACHE`` setting has been changed. - -The ``--ignore-cache`` command-line option is useful when the -whole cache needs to be regenerated, such as when making modifications -to the settings file that will affect the cached content, or just for -debugging purposes. When Pelican runs in autoreload mode, modification -of the settings file will make it ignore the cache automatically if -``AUTORELOAD_IGNORE_CACHE`` is ``True``. - -Note that even when using cached content, all output is always -written, so the modification times of the generated ``*.html`` files -will always change. Therefore, ``rsync``-based uploading may benefit -from the ``--checksum`` option. +If ``CONTENT_CACHING_LAYER`` is set to ``'reader'`` (the default), the raw +content and metadata returned by a reader are cached. If this setting is +instead set to ``'generator'``, the processed content object is cached. Caching +the processed content object may conflict with plugins (as some reading related +signals may be skipped) and the ``WITH_FUTURE_DATES`` functionality (as the +``draft`` status of the cached content objects would not change automatically +over time). + +Checking modification times is faster than comparing file hashes, but it is not +as reliable because ``mtime`` information can be lost, e.g., when copying +content source files using the ``cp`` or ``rsync`` commands without the +``mtime`` preservation mode (which for ``rsync`` can be invoked by passing the +``--archive`` flag). + +The cache files are Python pickles, so they may not be readable by different +versions of Python as the pickle format often changes. If such an error is +encountered, it is caught and the cache file is rebuilt automatically in the +new format. The cache files will also be rebuilt after the ``GZIP_CACHE`` +setting has been changed. + +The ``--ignore-cache`` command-line option is useful when the whole cache needs +to be regenerated, such as when making modifications to the settings file that +will affect the cached content, or just for debugging purposes. When Pelican +runs in autoreload mode, modification of the settings file will make it ignore +the cache automatically if ``AUTORELOAD_IGNORE_CACHE`` is ``True``. + +Note that even when using cached content, all output is always written, so the +modification times of the generated ``*.html`` files will always change. +Therefore, ``rsync``-based uploading may benefit from the ``--checksum`` +option. .. _writing_only_selected_content: @@ -1204,16 +1360,14 @@ Writing only selected content ============================= -When only working on a single article or page, or making tweaks to -your theme, it is often desirable to generate and review your work -as quickly as possible. In such cases, generating and writing the -entire site output is often unnecessary. By specifying only the -desired files as output paths in the ``WRITE_SELECTED`` list, -**only** those files will be written. This list can be also specified -on the command line using the ``--write-selected`` option, which -accepts a comma-separated list of output file paths. By default this -list is empty, so all output is written. See :ref:`site_generation` for -more details. +When only working on a single article or page, or making tweaks to your theme, +it is often desirable to generate and review your work as quickly as possible. +In such cases, generating and writing the entire site output is often +unnecessary. By specifying only the desired files as output paths in the +``WRITE_SELECTED`` list, **only** those files will be written. This list can be +also specified on the command line using the ``--write-selected`` option, which +accepts a comma-separated list of output file paths. By default this list is +empty, so all output is written. See :ref:`site_generation` for more details. Example settings Binary files /tmp/tmpTOs8nQ/oV_jHM2uQd/pelican-3.7.1+dfsg/docs/_static/overall.png and /tmp/tmpTOs8nQ/VbdhRKwjVP/pelican-4.0.1+dfsg/docs/_static/overall.png differ diff -Nru pelican-3.7.1+dfsg/docs/themes.rst pelican-4.0.1+dfsg/docs/themes.rst --- pelican-3.7.1+dfsg/docs/themes.rst 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/docs/themes.rst 2018-11-30 16:31:43.000000000 +0000 @@ -3,13 +3,14 @@ Creating themes ############### -To generate its HTML output, Pelican uses the `Jinja `_ -templating engine due to its flexibility and straightforward syntax. If you want -to create your own theme, feel free to take inspiration from the `"simple" theme +To generate its HTML output, Pelican uses the `Jinja +`_ templating engine due to its flexibility and +straightforward syntax. If you want to create your own theme, feel free to take +inspiration from the `"simple" theme `_. -To generate your site using a theme you have created (or downloaded manually and -then modified), you can specify that theme via the ``-t`` flag:: +To generate your site using a theme you have created (or downloaded manually +and then modified), you can specify that theme via the ``-t`` flag:: pelican content -s pelicanconf.py -t /projects/your-site/themes/your-theme @@ -42,9 +43,9 @@ `theme` folder. The above filesystem layout includes CSS and image folders, but those are just examples. Put what you need here. -* `templates` contains all the templates that will be used to generate the content. - The template files listed above are mandatory; you can add your own templates - if it helps you keep things organized while creating your theme. +* `templates` contains all the templates that will be used to generate the + content. The template files listed above are mandatory; you can add your own + templates if it helps you keep things organized while creating your theme. .. _templates-variables: @@ -86,19 +87,20 @@ all the categories and corresponding articles (values) pages The list of pages hidden_pages The list of hidden pages +draft_pages The list of draft pages ============= =================================================== Sorting ------- -URL wrappers (currently categories, tags, and authors), have -comparison methods that allow them to be easily sorted by name:: +URL wrappers (currently categories, tags, and authors), have comparison methods +that allow them to be easily sorted by name:: {% for tag, articles in tags|sort %} -If you want to sort based on different criteria, `Jinja's sort -command`__ has a number of options. +If you want to sort based on different criteria, `Jinja's sort command`__ has a +number of options. __ http://jinja.pocoo.org/docs/templates/#sort @@ -107,13 +109,12 @@ --------------- Pelican formats the date according to your settings and locale -(``DATE_FORMATS``/``DEFAULT_DATE_FORMAT``) and provides a -``locale_date`` attribute. On the other hand, the ``date`` attribute will -be a `datetime`_ object. If you need custom formatting for a date -different than your settings, use the Jinja filter ``strftime`` -that comes with Pelican. Usage is same as Python `strftime`_ format, -but the filter will do the right thing and format your date according -to the locale given in your settings:: +(``DATE_FORMATS``/``DEFAULT_DATE_FORMAT``) and provides a ``locale_date`` +attribute. On the other hand, the ``date`` attribute will be a `datetime`_ +object. If you need custom formatting for a date different than your settings, +use the Jinja filter ``strftime`` that comes with Pelican. Usage is same as +Python `strftime`_ format, but the filter will do the right thing and format +your date according to the locale given in your settings:: {{ article.date|strftime('%d %B %Y') }} @@ -126,7 +127,8 @@ This is the home page or index of your blog, generated at ``index.html``. -If pagination is active, subsequent pages will reside in ``index{number}.html``. +If pagination is active, subsequent pages will reside in +``index{number}.html``. ====================== =================================================== Variable Description @@ -152,10 +154,10 @@ author.html ------------- -This template will be processed for each of the existing authors, with -output generated according to the ``AUTHOR_SAVE_AS`` setting (`Default:` -``author/{author_name}.html``). If pagination is active, subsequent pages will by -default reside at ``author/{author_name}{number}.html``. +This template will be processed for each of the existing authors, with output +generated according to the ``AUTHOR_SAVE_AS`` setting (`Default:` +``author/{slug}.html``). If pagination is active, subsequent pages will by +default reside at ``author/{slug}{number}.html``. ====================== =================================================== Variable Description @@ -188,8 +190,8 @@ This template will be processed for each of the existing categories, with output generated according to the ``CATEGORY_SAVE_AS`` setting (`Default:` -``category/{category_name}.html``). If pagination is active, subsequent pages will by -default reside at ``category/{category_name}{number}.html``. +``category/{slug}.html``). If pagination is active, subsequent pages will by +default reside at ``category/{slug}{number}.html``. ====================== =================================================== Variable Description @@ -220,10 +222,9 @@ article.html ------------- -This template will be processed for each article, with -output generated according to the ``ARTICLE_SAVE_AS`` setting (`Default:` -``{article_name}.html``). The following variables are available when -rendering. +This template will be processed for each article, with output generated +according to the ``ARTICLE_SAVE_AS`` setting (`Default:` ``{slug}.html``). The +following variables are available when rendering. ============= =================================================== Variable Description @@ -232,9 +233,9 @@ category The name of the category for the current article ============= =================================================== -Any metadata that you put in the header of the article source file -will be available as fields on the ``article`` object. The field name will be -the same as the name of the metadata field, except in all-lowercase characters. +Any metadata that you put in the header of the article source file will be +available as fields on the ``article`` object. The field name will be the same +as the name of the metadata field, except in all-lowercase characters. For example, you could add a field called `FacebookImage` to your article metadata, as shown below: @@ -250,8 +251,8 @@ FacebookImage: http://franciscabrel.com/images/pythonlove.png This new metadata will be made available as `article.facebookimage` in your -`article.html` template. This would allow you, for example, to specify an -image for the Facebook open graph tags that will change for each article: +`article.html` template. This would allow you, for example, to specify an image +for the Facebook open graph tags that will change for each article: .. code-block:: html+jinja @@ -261,10 +262,9 @@ page.html --------- -This template will be processed for each page, with -output generated according to the ``PAGE_SAVE_AS`` setting (`Default:` -``pages/{page_name}.html``). The following variables are available when -rendering. +This template will be processed for each page, with output generated according +to the ``PAGE_SAVE_AS`` setting (`Default:` ``pages/{slug}.html``). The +following variables are available when rendering. ============= =================================================== Variable Description @@ -277,10 +277,10 @@ tag.html -------- -This template will be processed for each tag, with -output generated according to the ``TAG_SAVE_AS`` setting (`Default:` -``tag/{tag_name}.html``). If pagination is active, subsequent pages will by -default reside at ``tag/{tag_name}{number}.html``. +This template will be processed for each tag, with output generated according +to the ``TAG_SAVE_AS`` setting (`Default:` ``tag/{slug}.html``). If pagination +is active, subsequent pages will by default reside at +``tag/{slug}{number}.html``. ====================== =================================================== Variable Description @@ -311,9 +311,9 @@ period_archives.html -------------------- -This template will be processed for each year of your posts if a path -for ``YEAR_ARCHIVE_SAVE_AS`` is defined, each month if ``MONTH_ARCHIVE_SAVE_AS`` -is defined, and each day if ``DAY_ARCHIVE_SAVE_AS`` is defined. +This template will be processed for each year of your posts if a path for +``YEAR_ARCHIVE_SAVE_AS`` is defined, each month if ``MONTH_ARCHIVE_SAVE_AS`` is +defined, and each day if ``DAY_ARCHIVE_SAVE_AS`` is defined. =================== =================================================== Variable Description @@ -423,7 +423,7 @@ save_as Location to save the page. slug Page slug. source_path Full system path of the page source file. -status The page status, can be any of 'published' or +status The page status, can be any of 'published', 'hidden' or 'draft'. summary Rendered summary content. tags List of :ref:`Tag ` @@ -463,9 +463,9 @@ you can re-use the ``simple`` theme templates in your own themes. If one of the mandatory files in the ``templates/`` directory of your theme is -missing, it will be replaced by the matching template from the ``simple`` theme. -So if the HTML structure of a template in the ``simple`` theme is right for you, -you don't have to write a new template from scratch. +missing, it will be replaced by the matching template from the ``simple`` +theme. So if the HTML structure of a template in the ``simple`` theme is right +for you, you don't have to write a new template from scratch. You can also extend templates from the ``simple`` theme in your own themes by using the ``{% extends %}`` directive as in the following example: diff -Nru pelican-3.7.1+dfsg/docs/tips.rst pelican-4.0.1+dfsg/docs/tips.rst --- pelican-3.7.1+dfsg/docs/tips.rst 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/docs/tips.rst 2018-11-30 16:31:43.000000000 +0000 @@ -8,8 +8,8 @@ When a browser requests a resource that the web server cannot find, the web server usually displays a generic "File not found" (404) error page that can be -stark and unsightly. One way to provide an error page that matches the theme -of your site is to create a custom 404 page (*not* an article), such as this +stark and unsightly. One way to provide an error page that matches the theme of +your site is to create a custom 404 page (*not* an article), such as this Markdown-formatted example stored in ``content/pages/404.md``:: Title: Not Found @@ -29,8 +29,8 @@ ErrorDocument 404 /404.html -For Amazon S3, first navigate to the ``Static Site Hosting`` menu in the -bucket settings on your AWS cosole. From there:: +For Amazon S3, first navigate to the ``Static Site Hosting`` menu in the bucket +settings on your AWS cosole. From there:: Error Document: 404.html @@ -58,7 +58,7 @@ Pages to this repository, you can then use the following:: $ pelican content -o output -s pelicanconf.py - $ ghp-import output + $ ghp-import output -b gh-pages $ git push origin gh-pages The ``ghp-import output`` command updates the local ``gh-pages`` branch with @@ -67,15 +67,10 @@ ``gh-pages`` branch, effectively publishing the Pelican site. .. note:: - The ``github`` target of the Makefile (and the ``gh_pages`` task of the Fabfile) - created by the ``pelican-quickstart`` command - publishes the Pelican site as Project Pages, as described above. - -.. note:: ghp-import on Windows - - Until `ghp-import Pull Request #25 `_ - is accepted, you will need to install a custom build of ghp-import: - ``pip install https://github.com/chevah/ghp-import/archive/win-support.zip`` + + The ``github`` target of the Makefile (and the ``gh_pages`` task of + ``tasks.py``) created by the ``pelican-quickstart`` command publishes the + Pelican site as Project Pages, as described above. User Pages ---------- @@ -87,7 +82,7 @@ Again, you can take advantage of ``ghp-import``:: $ pelican content -o output -s pelicanconf.py - $ ghp-import output + $ ghp-import output -b gh-pages $ git push git@github.com:elemoine/elemoine.github.io.git gh-pages:master The ``git push`` command pushes the local ``gh-pages`` branch (freshly updated @@ -98,6 +93,22 @@ To publish your Pelican site as User Pages, feel free to adjust the ``github`` target of the Makefile. + +Another option for publishing to User Pages is to generate the output files in +the root directory of the project. + +For example, your main project folder is ``.github.io`` and you can +create the Pelican project in a subdirectory called ``Pelican``. Then from +inside the ``Pelican`` folder you can run:: + + $ pelican content -o .. -s pelicanconf.py + +Now you can push the whole project ``.github.io`` to the master +branch of your GitHub repository:: + + $ git push origin master + +(assuming origin is set to your remote repository). Custom 404 Pages ---------------- @@ -105,18 +116,17 @@ GitHub Pages will display the custom 404 page described above, as noted in the relevant `GitHub docs `_. -Extra Tips ----------- - -Tip #1: +Update your site on each commit +------------------------------- -To automatically update your Pelican site on each commit, you can create -a post-commit hook. For example, you can add the following to +To automatically update your Pelican site on each commit, you can create a +post-commit hook. For example, you can add the following to ``.git/hooks/post-commit``:: pelican content -o output -s pelicanconf.py && ghp-import output && git push origin gh-pages -Tip #2: +Copy static files to the root of your site +------------------------------------------ To use a `custom domain `_ with @@ -131,9 +141,8 @@ Note: use forward slashes, ``/``, even on Windows. -.. hint:: - You can also use the ``EXTRA_PATH_METADATA`` mechanism - to place a ``favicon.ico`` or ``robots.txt`` at the root of any site. +You can also use the ``EXTRA_PATH_METADATA`` mechanism to place a +``favicon.ico`` or ``robots.txt`` at the root of any site. How to add YouTube or Vimeo Videos ================================== @@ -149,3 +158,25 @@ `_ for reST or `mdx_video plugin `_ for Markdown. + +Develop Locally Using SSL +================================== + +Here's how you can set up your local pelican server to support SSL. + +First, create a self-signed certificate and key using ``openssl`` (this creates ``cert.pem`` and ``key.pem``):: + + $ openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes + +And use this command to launch the server (the server starts within your ``output`` directory):: + + python -m pelican.server 8443 --key=../key.pem --cert=../cert.pem + +If you are using ``develop-server.sh``, add this to the top:: + + CERT="$BASEDIR/cert.pem" + KEY="$BASEDIR/key.pem" + +and modify the ``pelican.server`` line as follows:: + + $PY -m pelican.server $port --ssl --cert="$CERT" --key="$KEY" & \ No newline at end of file diff -Nru pelican-3.7.1+dfsg/.gitignore pelican-4.0.1+dfsg/.gitignore --- pelican-3.7.1+dfsg/.gitignore 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/.gitignore 2018-11-30 16:31:43.000000000 +0000 @@ -13,3 +13,6 @@ htmlcov six-*.egg/ *.orig +venv +samples/output +*.pem diff -Nru pelican-3.7.1+dfsg/MANIFEST.in pelican-4.0.1+dfsg/MANIFEST.in --- pelican-3.7.1+dfsg/MANIFEST.in 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/MANIFEST.in 2018-11-30 16:31:43.000000000 +0000 @@ -1,3 +1,3 @@ include *.rst -recursive-include pelican *.html *.css *png *.in *.rst *.markdown *.md *.mkd *.xml *.py +recursive-include pelican *.html *.css *png *.rst *.markdown *.md *.mkd *.xml *.py include LICENSE THANKS docs/changelog.rst diff -Nru pelican-3.7.1+dfsg/pelican/contents.py pelican-4.0.1+dfsg/pelican/contents.py --- pelican-3.7.1+dfsg/pelican/contents.py 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/contents.py 2018-11-30 16:31:43.000000000 +0000 @@ -11,14 +11,15 @@ import pytz import six -from six.moves.urllib.parse import urlparse, urlunparse +from six.moves.urllib.parse import urljoin, urlparse, urlunparse from pelican import signals from pelican.settings import DEFAULT_CONFIG from pelican.utils import (SafeDatetime, deprecated_attribute, memoized, path_to_url, posixize_path, - python_2_unicode_compatible, set_date_tzinfo, - slugify, strftime, truncate_html_words) + python_2_unicode_compatible, sanitised_join, + set_date_tzinfo, slugify, strftime, + truncate_html_words) # Import these so that they're avalaible when you import from pelican.contents. from pelican.urlwrappers import (Author, Category, Tag, URLWrapper) # NOQA @@ -97,14 +98,16 @@ if not hasattr(self, 'slug'): if (settings['SLUGIFY_SOURCE'] == 'title' and hasattr(self, 'title')): - self.slug = slugify(self.title, - settings.get('SLUG_SUBSTITUTIONS', ())) + self.slug = slugify( + self.title, + regex_subs=settings.get('SLUG_REGEX_SUBSTITUTIONS', [])) elif (settings['SLUGIFY_SOURCE'] == 'basename' and source_path is not None): basename = os.path.basename( os.path.splitext(source_path)[0]) self.slug = slugify( - basename, settings.get('SLUG_SUBSTITUTIONS', ())) + basename, + regex_subs=settings.get('SLUG_REGEX_SUBSTITUTIONS', [])) self.source_path = source_path @@ -137,14 +140,7 @@ # manage status if not hasattr(self, 'status'): - self.status = settings['DEFAULT_STATUS'] - if not settings['WITH_FUTURE_DATES'] and hasattr(self, 'date'): - if self.date.tzinfo is None: - now = SafeDatetime.now() - else: - now = SafeDatetime.utcnow().replace(tzinfo=pytz.utc) - if self.date > now: - self.status = 'draft' + self.status = getattr(self, 'default_status', None) # store the summary metadata if it is set if 'summary' in metadata: @@ -155,11 +151,56 @@ def __str__(self): return self.source_path or repr(self) - def check_properties(self): + def _has_valid_mandatory_properties(self): """Test mandatory properties are set.""" for prop in self.mandatory_properties: if not hasattr(self, prop): - raise NameError(prop) + logger.error( + "Skipping %s: could not find information about '%s'", + self, prop) + return False + return True + + def _has_valid_save_as(self): + """Return true if save_as doesn't write outside output path, false + otherwise.""" + try: + output_path = self.settings["OUTPUT_PATH"] + except KeyError: + # we cannot check + return True + + try: + sanitised_join(output_path, self.save_as) + except RuntimeError: # outside output_dir + logger.error( + "Skipping %s: file %r would be written outside output path", + self, + self.save_as, + ) + return False + + return True + + def _has_valid_status(self): + if hasattr(self, 'allowed_statuses'): + if self.status not in self.allowed_statuses: + logger.error( + "Unknown status '%s' for file %s, skipping it.", + self.status, + self + ) + return False + + # if undefined we allow all + return True + + def is_valid(self): + """Validate Content""" + # Use all() to not short circuit and get results of all validations + return all([self._has_valid_mandatory_properties(), + self._has_valid_save_as(), + self._has_valid_status()]) @property def url_format(self): @@ -172,13 +213,14 @@ 'lang': getattr(self, 'lang', 'en'), 'date': getattr(self, 'date', SafeDatetime.now()), 'author': self.author.slug if hasattr(self, 'author') else '', - 'tag': self.tag.slug if hasattr(self, 'tag') else '', 'category': self.category.slug if hasattr(self, 'category') else '' }) return metadata - def _expand_settings(self, key): - fq_key = ('%s_%s' % (self.__class__.__name__, key)).upper() + def _expand_settings(self, key, klass=None): + if not klass: + klass = self.__class__.__name__ + fq_key = ('%s_%s' % (klass, key)).upper() return self.settings[fq_key].format(**self.url_format) def get_url_setting(self, key): @@ -187,6 +229,109 @@ key = key if self.in_default_lang else 'lang_%s' % key return self._expand_settings(key) + def _link_replacer(self, siteurl, m): + what = m.group('what') + value = urlparse(m.group('value')) + path = value.path + origin = m.group('path') + + # urllib.parse.urljoin() produces `a.html` for urljoin("..", "a.html") + # so if RELATIVE_URLS are enabled, we fall back to os.path.join() to + # properly get `../a.html`. However, os.path.join() produces + # `baz/http://foo/bar.html` for join("baz", "http://foo/bar.html") + # instead of correct "http://foo/bar.html", so one has to pick a side + # as there is no silver bullet. + if self.settings['RELATIVE_URLS']: + joiner = os.path.join + else: + joiner = urljoin + + # However, it's not *that* simple: urljoin("blog", "index.html") + # produces just `index.html` instead of `blog/index.html` (unlike + # os.path.join()), so in order to get a correct answer one needs to + # append a trailing slash to siteurl in that case. This also makes + # the new behavior fully compatible with Pelican 3.7.1. + if not siteurl.endswith('/'): + siteurl += '/' + + # XXX Put this in a different location. + if what in {'filename', 'static', 'attach'}: + if path.startswith('/'): + path = path[1:] + else: + # relative to the source path of this content + path = self.get_relative_source_path( + os.path.join(self.relative_dir, path) + ) + + key = 'static_content' if what in ('static', 'attach')\ + else 'generated_content' + + def _get_linked_content(key, path): + try: + return self._context[key][path] + except KeyError: + try: + # Markdown escapes spaces, try unescaping + return self._context[key][path.replace('%20', ' ')] + except KeyError: + if what == 'filename' and key == 'generated_content': + key = 'static_content' + linked_content = _get_linked_content(key, path) + if linked_content: + logger.warning( + '{filename} used for linking to static' + 'content %s in %s. Use {static} instead', + path, + self.get_relative_source_path()) + return linked_content + return None + + linked_content = _get_linked_content(key, path) + if linked_content: + if what == 'attach': + linked_content.attach_to(self) + origin = joiner(siteurl, linked_content.url) + origin = origin.replace('\\', '/') # for Windows paths. + else: + logger.warning( + "Unable to find '%s', skipping url replacement.", + value.geturl(), extra={ + 'limit_msg': ("Other resources were not found " + "and their urls not replaced")}) + elif what == 'category': + origin = joiner(siteurl, Category(path, self.settings).url) + elif what == 'tag': + origin = joiner(siteurl, Tag(path, self.settings).url) + elif what == 'index': + origin = joiner(siteurl, self.settings['INDEX_SAVE_AS']) + elif what == 'author': + origin = joiner(siteurl, Author(path, self.settings).url) + else: + logger.warning( + "Replacement Indicator '%s' not recognized, " + "skipping replacement", + what) + + # keep all other parts, such as query, fragment, etc. + parts = list(value) + parts[2] = origin + origin = urlunparse(parts) + + return ''.join((m.group('markup'), m.group('quote'), origin, + m.group('quote'))) + + def _get_intrasite_link_regex(self): + intrasite_link_regex = self.settings['INTRASITE_LINK_REGEX'] + regex = r""" + (?P<[^\>]+ # match tag with all url-value attributes + (?:href|src|poster|data|cite|formaction|action)\s*=\s*) + + (?P["\']) # require value to be quoted + (?P{0}(?P.*?)) # the url value + \2""".format(intrasite_link_regex) + return re.compile(regex, re.X) + def _update_content(self, content, siteurl): """Update the content attribute. @@ -200,79 +345,28 @@ if not content: return content - instrasite_link_regex = self.settings['INTRASITE_LINK_REGEX'] - regex = r""" - (?P<\s*[^\>]* # match tag with all url-value attributes - (?:href|src|poster|data|cite|formaction|action)\s*=) - - (?P["\']) # require value to be quoted - (?P{0}(?P.*?)) # the url value - \2""".format(instrasite_link_regex) - hrefs = re.compile(regex, re.X) + hrefs = self._get_intrasite_link_regex() + return hrefs.sub(lambda m: self._link_replacer(siteurl, m), content) - def replacer(m): + def get_static_links(self): + static_links = set() + hrefs = self._get_intrasite_link_regex() + for m in hrefs.finditer(self._content): what = m.group('what') value = urlparse(m.group('value')) path = value.path - origin = m.group('path') - - # XXX Put this in a different location. - if what in {'filename', 'attach'}: - if path.startswith('/'): - path = path[1:] - else: - # relative to the source path of this content - path = self.get_relative_source_path( - os.path.join(self.relative_dir, path) - ) - - if path not in self._context['filenames']: - unquoted_path = path.replace('%20', ' ') - - if unquoted_path in self._context['filenames']: - path = unquoted_path - - linked_content = self._context['filenames'].get(path) - if linked_content: - if what == 'attach': - if isinstance(linked_content, Static): - linked_content.attach_to(self) - else: - logger.warning( - "%s used {attach} link syntax on a " - "non-static file. Use {filename} instead.", - self.get_relative_source_path()) - origin = '/'.join((siteurl, linked_content.url)) - origin = origin.replace('\\', '/') # for Windows paths. - else: - logger.warning( - "Unable to find `%s`, skipping url replacement.", - value.geturl(), extra={ - 'limit_msg': ("Other resources were not found " - "and their urls not replaced")}) - elif what == 'category': - origin = '/'.join((siteurl, Category(path, self.settings).url)) - elif what == 'tag': - origin = '/'.join((siteurl, Tag(path, self.settings).url)) - elif what == 'index': - origin = '/'.join((siteurl, self.settings['INDEX_SAVE_AS'])) - elif what == 'author': - origin = '/'.join((siteurl, Author(path, self.settings).url)) + if what not in {'static', 'attach'}: + continue + if path.startswith('/'): + path = path[1:] else: - logger.warning( - "Replacement Indicator '%s' not recognized, " - "skipping replacement", - what) - - # keep all other parts, such as query, fragment, etc. - parts = list(value) - parts[2] = origin - origin = urlunparse(parts) - - return ''.join((m.group('markup'), m.group('quote'), origin, - m.group('quote'))) - - return hrefs.sub(replacer, content) + # relative to the source path of this content + path = self.get_relative_source_path( + os.path.join(self.relative_dir, path) + ) + path = path.replace('%20', ' ') + static_links.add(path) + return static_links def get_siteurl(self): return self._context.get('localsiteurl', '') @@ -296,8 +390,8 @@ This is based on the summary metadata if set, otherwise truncate the content. """ - if hasattr(self, '_summary'): - return self._update_content(self._summary, siteurl) + if 'summary' in self.metadata: + return self.metadata['summary'] if self.settings['SUMMARY_MAX_LENGTH'] is None: return self.content @@ -322,6 +416,15 @@ pass @property + def status(self): + return self._status + + @status.setter + def status(self, value): + # TODO maybe typecheck + self._status = value.lower() + + @property def url(self): return self.get_url_setting('url') @@ -363,28 +466,71 @@ os.path.abspath(self.source_path), os.path.abspath(self.settings['PATH'])))) + def refresh_metadata_intersite_links(self): + for key in self.settings['FORMATTED_FIELDS']: + if key in self.metadata and key != 'summary': + value = self._update_content( + self.metadata[key], + self.get_siteurl() + ) + self.metadata[key] = value + setattr(self, key.lower(), value) + + # _summary is an internal variable that some plugins may be writing to, + # so ensure changes to it are picked up + if ('summary' in self.settings['FORMATTED_FIELDS'] and + 'summary' in self.metadata): + self._summary = self._update_content( + self._summary, + self.get_siteurl() + ) + self.metadata['summary'] = self._summary + class Page(Content): mandatory_properties = ('title',) + allowed_statuses = ('published', 'hidden', 'draft') + default_status = 'published' default_template = 'page' + def _expand_settings(self, key): + klass = 'draft_page' if self.status == 'draft' else None + return super(Page, self)._expand_settings(key, klass) + -class Article(Page): +class Article(Content): mandatory_properties = ('title', 'date', 'category') + allowed_statuses = ('published', 'draft') + default_status = 'published' default_template = 'article' + def __init__(self, *args, **kwargs): + super(Article, self).__init__(*args, **kwargs) -class Draft(Page): - mandatory_properties = ('title', 'category') - default_template = 'article' - + # handle WITH_FUTURE_DATES (designate article to draft based on date) + if not self.settings['WITH_FUTURE_DATES'] and hasattr(self, 'date'): + if self.date.tzinfo is None: + now = SafeDatetime.now() + else: + now = SafeDatetime.utcnow().replace(tzinfo=pytz.utc) + if self.date > now: + self.status = 'draft' + + # if we are a draft and there is no date provided, set max datetime + if not hasattr(self, 'date') and self.status == 'draft': + self.date = SafeDatetime.max -class Quote(Page): - base_properties = ('author', 'date') + def _expand_settings(self, key): + klass = 'draft' if self.status == 'draft' else 'article' + return super(Article, self)._expand_settings(key, klass) @python_2_unicode_compatible -class Static(Page): +class Static(Content): + mandatory_properties = ('title',) + default_status = 'published' + default_template = None + def __init__(self, *args, **kwargs): super(Static, self).__init__(*args, **kwargs) self._output_location_referenced = False @@ -465,14 +611,3 @@ self.override_save_as = new_save_as self.override_url = new_url - - -def is_valid_content(content, f): - try: - content.check_properties() - return True - except NameError as e: - logger.error( - "Skipping %s: could not find information about '%s'", - f, six.text_type(e)) - return False diff -Nru pelican-3.7.1+dfsg/pelican/generators.py pelican-4.0.1+dfsg/pelican/generators.py --- pelican-3.7.1+dfsg/pelican/generators.py 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/generators.py 2018-11-30 16:31:43.000000000 +0000 @@ -2,6 +2,7 @@ from __future__ import print_function, unicode_literals import calendar +import errno import fnmatch import logging import os @@ -18,9 +19,9 @@ from pelican import signals from pelican.cache import FileStampDataCacher -from pelican.contents import Article, Draft, Page, Static, is_valid_content +from pelican.contents import Article, Page, Static from pelican.readers import Readers -from pelican.utils import (DateFormatter, copy, copy_file_metadata, mkdir_p, +from pelican.utils import (DateFormatter, copy, mkdir_p, order_content, posixize_path, process_translations, python_2_unicode_compatible) @@ -51,20 +52,25 @@ # templates cache self._templates = {} - self._templates_path = [] - self._templates_path.append(os.path.expanduser( - os.path.join(self.theme, 'templates'))) - self._templates_path += self.settings['EXTRA_TEMPLATES_PATHS'] + self._templates_path = list(self.settings['THEME_TEMPLATES_OVERRIDES']) - theme_path = os.path.dirname(os.path.abspath(__file__)) + theme_templates_path = os.path.expanduser( + os.path.join(self.theme, 'templates')) + self._templates_path.append(theme_templates_path) + theme_loader = FileSystemLoader(theme_templates_path) + + simple_theme_path = os.path.dirname(os.path.abspath(__file__)) + simple_loader = FileSystemLoader( + os.path.join(simple_theme_path, "themes", "simple", "templates")) - simple_loader = FileSystemLoader(os.path.join(theme_path, - "themes", "simple", "templates")) self.env = Environment( loader=ChoiceLoader([ FileSystemLoader(self._templates_path), simple_loader, # implicit inheritance - PrefixLoader({'!simple': simple_loader}) # explicit one + PrefixLoader({ + '!simple': simple_loader, + '!theme': theme_loader + }) # explicit ones ]), **self.settings['JINJA_ENVIRONMENT'] ) @@ -86,12 +92,19 @@ templates ready to use with Jinja2. """ if name not in self._templates: - try: - self._templates[name] = self.env.get_template(name + '.html') - except TemplateNotFound: + for ext in self.settings['TEMPLATE_EXTENSIONS']: + try: + self._templates[name] = self.env.get_template(name + ext) + break + except TemplateNotFound: + continue + + if name not in self._templates: raise PelicanTemplateNotFound( - '[templates] unable to load {}.html from {}'.format( - name, self._templates_path)) + '[templates] unable to load {}[{}] from {}'.format( + name, ', '.join(self.settings['TEMPLATE_EXTENSIONS']), + self._templates_path)) + return self._templates[name] def _include_path(self, path, extensions=None): @@ -134,7 +147,7 @@ parent_path, subdir = os.path.split(os.path.join(self.path, e)) exclusions_by_dirpath.setdefault(parent_path, set()).add(subdir) - files = [] + files = set() ignores = self.settings['IGNORE_FILES'] for path in paths: # careful: os.path.join() will add a slash when path == ''. @@ -157,33 +170,41 @@ for f in temp_files: fp = os.path.join(reldir, f) if self._include_path(fp, extensions): - files.append(fp) + files.add(fp) elif os.path.exists(root) and self._include_path(path, extensions): - files.append(path) # can't walk non-directories + files.add(path) # can't walk non-directories return files - def add_source_path(self, content): + def add_source_path(self, content, static=False): """Record a source file path that a Generator found and processed. Store a reference to its Content object, for url lookups later. """ location = content.get_relative_source_path() - self.context['filenames'][location] = content + key = 'static_content' if static else 'generated_content' + self.context[key][location] = content - def _add_failed_source_path(self, path): + def _add_failed_source_path(self, path, static=False): """Record a source file path that a Generator failed to process. (For example, one that was missing mandatory metadata.) The path argument is expected to be relative to self.path. """ - self.context['filenames'][posixize_path(os.path.normpath(path))] = None + key = 'static_content' if static else 'generated_content' + self.context[key][posixize_path(os.path.normpath(path))] = None - def _is_potential_source_path(self, path): + def _is_potential_source_path(self, path, static=False): """Return True if path was supposed to be used as a source file. (This includes all source files that have been found by generators before this method is called, even if they failed to process.) The path argument is expected to be relative to self.path. """ - return (posixize_path(os.path.normpath(path)) - in self.context['filenames']) + key = 'static_content' if static else 'generated_content' + return (posixize_path(os.path.normpath(path)) in self.context[key]) + + def add_static_links(self, content): + """Add file links in content to context to be processed as Static + content. + """ + self.context['static_links'] |= content.get_static_links() def _update_context(self, items): """Update the context with the given items from the currrent @@ -255,7 +276,7 @@ template = self.env.get_template(source) rurls = self.settings['RELATIVE_URLS'] writer.write_file(dest, template, self.context, rurls, - override_output=True) + override_output=True, url='') finally: del self.env.loader.loaders[0] @@ -281,68 +302,130 @@ """Generate the feeds from the current context, and output files.""" if self.settings.get('FEED_ATOM'): - writer.write_feed(self.articles, self.context, - self.settings['FEED_ATOM']) + writer.write_feed( + self.articles, + self.context, + self.settings['FEED_ATOM'], + self.settings.get('FEED_ATOM_URL', self.settings['FEED_ATOM']) + ) if self.settings.get('FEED_RSS'): - writer.write_feed(self.articles, self.context, - self.settings['FEED_RSS'], feed_type='rss') + writer.write_feed( + self.articles, + self.context, + self.settings['FEED_RSS'], + self.settings.get('FEED_RSS_URL', self.settings['FEED_RSS']), + feed_type='rss' + ) if (self.settings.get('FEED_ALL_ATOM') or self.settings.get('FEED_ALL_RSS')): all_articles = list(self.articles) for article in self.articles: all_articles.extend(article.translations) - all_articles.sort(key=attrgetter('date'), reverse=True) + order_content(all_articles, + order_by=self.settings['ARTICLE_ORDER_BY']) if self.settings.get('FEED_ALL_ATOM'): - writer.write_feed(all_articles, self.context, - self.settings['FEED_ALL_ATOM']) + writer.write_feed( + all_articles, + self.context, + self.settings['FEED_ALL_ATOM'], + self.settings.get('FEED_ALL_ATOM_URL', + self.settings['FEED_ALL_ATOM']) + ) if self.settings.get('FEED_ALL_RSS'): - writer.write_feed(all_articles, self.context, - self.settings['FEED_ALL_RSS'], - feed_type='rss') + writer.write_feed( + all_articles, + self.context, + self.settings['FEED_ALL_RSS'], + self.settings.get('FEED_ALL_RSS_URL', + self.settings['FEED_ALL_RSS']), + feed_type='rss' + ) for cat, arts in self.categories: - arts.sort(key=attrgetter('date'), reverse=True) if self.settings.get('CATEGORY_FEED_ATOM'): - writer.write_feed(arts, self.context, - self.settings['CATEGORY_FEED_ATOM'] - % cat.slug, feed_title=cat.name) + writer.write_feed( + arts, + self.context, + self.settings['CATEGORY_FEED_ATOM'].format(slug=cat.slug), + self.settings.get( + 'CATEGORY_FEED_ATOM_URL', + self.settings['CATEGORY_FEED_ATOM']).format( + slug=cat.slug + ), + feed_title=cat.name + ) if self.settings.get('CATEGORY_FEED_RSS'): - writer.write_feed(arts, self.context, - self.settings['CATEGORY_FEED_RSS'] - % cat.slug, feed_title=cat.name, - feed_type='rss') + writer.write_feed( + arts, + self.context, + self.settings['CATEGORY_FEED_RSS'].format(slug=cat.slug), + self.settings.get( + 'CATEGORY_FEED_RSS_URL', + self.settings['CATEGORY_FEED_RSS']).format( + slug=cat.slug + ), + feed_title=cat.name, + feed_type='rss' + ) for auth, arts in self.authors: - arts.sort(key=attrgetter('date'), reverse=True) if self.settings.get('AUTHOR_FEED_ATOM'): - writer.write_feed(arts, self.context, - self.settings['AUTHOR_FEED_ATOM'] - % auth.slug, feed_title=auth.name) + writer.write_feed( + arts, + self.context, + self.settings['AUTHOR_FEED_ATOM'].format(slug=auth.slug), + self.settings.get( + 'AUTHOR_FEED_ATOM_URL', + self.settings['AUTHOR_FEED_ATOM'] + ).format(slug=auth.slug), + feed_title=auth.name + ) if self.settings.get('AUTHOR_FEED_RSS'): - writer.write_feed(arts, self.context, - self.settings['AUTHOR_FEED_RSS'] - % auth.slug, feed_title=auth.name, - feed_type='rss') + writer.write_feed( + arts, + self.context, + self.settings['AUTHOR_FEED_RSS'].format(slug=auth.slug), + self.settings.get( + 'AUTHOR_FEED_RSS_URL', + self.settings['AUTHOR_FEED_RSS'] + ).format(slug=auth.slug), + feed_title=auth.name, + feed_type='rss' + ) if (self.settings.get('TAG_FEED_ATOM') or self.settings.get('TAG_FEED_RSS')): for tag, arts in self.tags.items(): - arts.sort(key=attrgetter('date'), reverse=True) if self.settings.get('TAG_FEED_ATOM'): - writer.write_feed(arts, self.context, - self.settings['TAG_FEED_ATOM'] - % tag.slug, feed_title=tag.name) + writer.write_feed( + arts, + self.context, + self.settings['TAG_FEED_ATOM'].format(slug=tag.slug), + self.settings.get( + 'TAG_FEED_ATOM_URL', + self.settings['TAG_FEED_ATOM'] + ).format(slug=tag.slug), + feed_title=tag.name + ) if self.settings.get('TAG_FEED_RSS'): - writer.write_feed(arts, self.context, - self.settings['TAG_FEED_RSS'] % tag.slug, - feed_title=tag.name, feed_type='rss') + writer.write_feed( + arts, + self.context, + self.settings['TAG_FEED_RSS'].format(slug=tag.slug), + self.settings.get( + 'TAG_FEED_RSS_URL', + self.settings['TAG_FEED_RSS'] + ).format(slug=tag.slug), + feed_title=tag.name, + feed_type='rss' + ) if (self.settings.get('TRANSLATION_FEED_ATOM') or self.settings.get('TRANSLATION_FEED_RSS')): @@ -351,16 +434,31 @@ translations_feeds[article.lang].append(article) for lang, items in translations_feeds.items(): - items.sort(key=attrgetter('date'), reverse=True) + items = order_content( + items, order_by=self.settings['ARTICLE_ORDER_BY']) if self.settings.get('TRANSLATION_FEED_ATOM'): writer.write_feed( - items, self.context, - self.settings['TRANSLATION_FEED_ATOM'] % lang) + items, + self.context, + self.settings['TRANSLATION_FEED_ATOM'] + .format(lang=lang), + self.settings.get( + 'TRANSLATION_FEED_ATOM_URL', + self.settings['TRANSLATION_FEED_ATOM'] + ).format(lang=lang), + ) if self.settings.get('TRANSLATION_FEED_RSS'): writer.write_feed( - items, self.context, - self.settings['TRANSLATION_FEED_RSS'] % lang, - feed_type='rss') + items, + self.context, + self.settings['TRANSLATION_FEED_RSS'] + .format(lang=lang), + self.settings.get( + 'TRANSLATION_FEED_RSS_URL', + self.settings['TRANSLATION_FEED_RSS'] + ).format(lang=lang), + feed_type='rss' + ) def generate_articles(self, write): """Generate the articles.""" @@ -369,7 +467,7 @@ write(article.save_as, self.get_template(article.template), self.context, article=article, category=article.category, override_output=hasattr(article, 'override_save_as'), - blog=True) + url=article.url, blog=True) def generate_period_archives(self, write): """Generate per-year, per-month, and per-day archives.""" @@ -384,24 +482,32 @@ 'day': self.settings['DAY_ARCHIVE_SAVE_AS'], } + period_url = { + 'year': self.settings['YEAR_ARCHIVE_URL'], + 'month': self.settings['MONTH_ARCHIVE_URL'], + 'day': self.settings['DAY_ARCHIVE_URL'], + } + period_date_key = { 'year': attrgetter('date.year'), 'month': attrgetter('date.year', 'date.month'), 'day': attrgetter('date.year', 'date.month', 'date.day') } - def _generate_period_archives(dates, key, save_as_fmt): + def _generate_period_archives(dates, key, save_as_fmt, url_fmt): """Generate period archives from `dates`, grouped by `key` and written to `save_as`. """ # `dates` is already sorted by date for _period, group in groupby(dates, key=key): archive = list(group) + articles = [a for a in self.articles if a in archive] # arbitrarily grab the first date so that the usual # format string syntax can be used for specifying the # period archive dates date = archive[0].date save_as = save_as_fmt.format(date=date) + url = url_fmt.format(date=date) context = self.context.copy() if key == period_date_key['year']: @@ -418,62 +524,60 @@ month_name, _period[2]) - write(save_as, template, context, - dates=archive, blog=True) + write(save_as, template, context, articles=articles, + dates=archive, template_name='period_archives', + blog=True, url=url) for period in 'year', 'month', 'day': save_as = period_save_as[period] + url = period_url[period] if save_as: key = period_date_key[period] - _generate_period_archives(self.dates, key, save_as) + _generate_period_archives(self.dates, key, save_as, url) def generate_direct_templates(self, write): """Generate direct templates pages""" - PAGINATED_TEMPLATES = self.settings['PAGINATED_DIRECT_TEMPLATES'] for template in self.settings['DIRECT_TEMPLATES']: - paginated = {} - if template in PAGINATED_TEMPLATES: - paginated = {'articles': self.articles, 'dates': self.dates} save_as = self.settings.get("%s_SAVE_AS" % template.upper(), '%s.html' % template) + url = self.settings.get("%s_URL" % template.upper(), + '%s.html' % template) if not save_as: continue - write(save_as, self.get_template(template), - self.context, blog=True, paginated=paginated, - page_name=os.path.splitext(save_as)[0]) + write(save_as, self.get_template(template), self.context, + articles=self.articles, dates=self.dates, blog=True, + template_name=template, + page_name=os.path.splitext(save_as)[0], url=url) def generate_tags(self, write): """Generate Tags pages.""" tag_template = self.get_template('tag') for tag, articles in self.tags.items(): - articles.sort(key=attrgetter('date'), reverse=True) dates = [article for article in self.dates if article in articles] write(tag.save_as, tag_template, self.context, tag=tag, - articles=articles, dates=dates, - paginated={'articles': articles, 'dates': dates}, blog=True, - page_name=tag.page_name, all_articles=self.articles) + url=tag.url, articles=articles, dates=dates, + template_name='tag', blog=True, page_name=tag.page_name, + all_articles=self.articles) def generate_categories(self, write): """Generate category pages.""" category_template = self.get_template('category') for cat, articles in self.categories: - articles.sort(key=attrgetter('date'), reverse=True) dates = [article for article in self.dates if article in articles] - write(cat.save_as, category_template, self.context, + write(cat.save_as, category_template, self.context, url=cat.url, category=cat, articles=articles, dates=dates, - paginated={'articles': articles, 'dates': dates}, blog=True, - page_name=cat.page_name, all_articles=self.articles) + template_name='category', blog=True, page_name=cat.page_name, + all_articles=self.articles) def generate_authors(self, write): """Generate Author pages.""" author_template = self.get_template('author') for aut, articles in self.authors: - articles.sort(key=attrgetter('date'), reverse=True) dates = [article for article in self.dates if article in articles] write(aut.save_as, author_template, self.context, - author=aut, articles=articles, dates=dates, - paginated={'articles': articles, 'dates': dates}, blog=True, + url=aut.url, author=aut, articles=articles, dates=dates, + template_name='author', blog=True, page_name=aut.page_name, all_articles=self.articles) def generate_drafts(self, write): @@ -482,7 +586,7 @@ write(draft.save_as, self.get_template(draft.template), self.context, article=draft, category=draft.category, override_output=hasattr(draft, 'override_save_as'), - blog=True, all_articles=self.articles) + blog=True, all_articles=self.articles, url=draft.url) def generate_pages(self, writer): """Generate the pages on the disk""" @@ -509,12 +613,10 @@ for f in self.get_files( self.settings['ARTICLE_PATHS'], exclude=self.settings['ARTICLE_EXCLUDES']): - article_or_draft = self.get_cached_data(f, None) - if article_or_draft is None: - # TODO needs overhaul, maybe nomad for read_file - # solution, unified behaviour + article = self.get_cached_data(f, None) + if article is None: try: - article_or_draft = self.readers.read_file( + article = self.readers.read_file( base_path=self.path, path=f, content_class=Article, context=self.context, preread_signal=signals.article_generator_preread, @@ -528,40 +630,27 @@ self._add_failed_source_path(f) continue - if not is_valid_content(article_or_draft, f): + if not article.is_valid(): self._add_failed_source_path(f) continue - if article_or_draft.status.lower() == "published": - pass - elif article_or_draft.status.lower() == "draft": - article_or_draft = self.readers.read_file( - base_path=self.path, path=f, content_class=Draft, - context=self.context, - preread_signal=signals.article_generator_preread, - preread_sender=self, - context_signal=signals.article_generator_context, - context_sender=self) - else: - logger.error( - "Unknown status '%s' for file %s, skipping it.", - article_or_draft.status, f) - self._add_failed_source_path(f) - continue - - self.cache_data(f, article_or_draft) + self.cache_data(f, article) - if article_or_draft.status.lower() == "published": - all_articles.append(article_or_draft) - else: - all_drafts.append(article_or_draft) - self.add_source_path(article_or_draft) + if article.status == "published": + all_articles.append(article) + elif article.status == "draft": + all_drafts.append(article) + self.add_source_path(article) + self.add_static_links(article) + + def _process(arts): + origs, translations = process_translations( + arts, translation_id=self.settings['ARTICLE_TRANSLATION_ID']) + origs = order_content(origs, self.settings['ARTICLE_ORDER_BY']) + return origs, translations - self.articles, self.translations = process_translations( - all_articles, - order_by=self.settings['ARTICLE_ORDER_BY']) - self.drafts, self.drafts_translations = \ - process_translations(all_drafts) + self.articles, self.translations = _process(all_articles) + self.drafts, self.drafts_translations = _process(all_drafts) signals.article_generator_pretaxonomy.send(self) @@ -600,20 +689,32 @@ self.generate_pages(writer) signals.article_writer_finalized.send(self, writer=writer) + def refresh_metadata_intersite_links(self): + for e in chain(self.articles, + self.translations, + self.drafts, + self.drafts_translations): + if hasattr(e, 'refresh_metadata_intersite_links'): + e.refresh_metadata_intersite_links() + class PagesGenerator(CachingGenerator): """Generate pages""" def __init__(self, *args, **kwargs): self.pages = [] + self.translations = [] self.hidden_pages = [] self.hidden_translations = [] + self.draft_pages = [] + self.draft_translations = [] super(PagesGenerator, self).__init__(*args, **kwargs) signals.page_generator_init.send(self) def generate_context(self): all_pages = [] hidden_pages = [] + draft_pages = [] for f in self.get_files( self.settings['PAGE_PATHS'], exclude=self.settings['PAGE_EXCLUDES']): @@ -634,32 +735,32 @@ self._add_failed_source_path(f) continue - if not is_valid_content(page, f): - self._add_failed_source_path(f) - continue - - if page.status.lower() not in ("published", "hidden"): - logger.error( - "Unknown status '%s' for file %s, skipping it.", - page.status, f) + if not page.is_valid(): self._add_failed_source_path(f) continue self.cache_data(f, page) - if page.status.lower() == "published": + if page.status == "published": all_pages.append(page) - elif page.status.lower() == "hidden": + elif page.status == "hidden": hidden_pages.append(page) + elif page.status == "draft": + draft_pages.append(page) self.add_source_path(page) + self.add_static_links(page) - self.pages, self.translations = process_translations( - all_pages, - order_by=self.settings['PAGE_ORDER_BY']) - self.hidden_pages, self.hidden_translations = \ - process_translations(hidden_pages) + def _process(pages): + origs, translations = process_translations( + pages, translation_id=self.settings['PAGE_TRANSLATION_ID']) + origs = order_content(origs, self.settings['PAGE_ORDER_BY']) + return origs, translations + + self.pages, self.translations = _process(all_pages) + self.hidden_pages, self.hidden_translations = _process(hidden_pages) + self.draft_pages, self.draft_translations = _process(draft_pages) - self._update_context(('pages', 'hidden_pages')) + self._update_context(('pages', 'hidden_pages', 'draft_pages')) self.save_cache() self.readers.save_cache() @@ -667,14 +768,26 @@ def generate_output(self, writer): for page in chain(self.translations, self.pages, - self.hidden_translations, self.hidden_pages): + self.hidden_translations, self.hidden_pages, + self.draft_translations, self.draft_pages): + signals.page_generator_write_page.send(self, content=page) writer.write_file( page.save_as, self.get_template(page.template), self.context, page=page, relative_urls=self.settings['RELATIVE_URLS'], - override_output=hasattr(page, 'override_save_as')) + override_output=hasattr(page, 'override_save_as'), + url=page.url) signals.page_writer_finalized.send(self, writer=writer) + def refresh_metadata_intersite_links(self): + for e in chain(self.pages, + self.hidden_pages, + self.hidden_translations, + self.draft_pages, + self.draft_translations): + if hasattr(e, 'refresh_metadata_intersite_links'): + e.refresh_metadata_intersite_links() + class StaticGenerator(Generator): """copy static paths (what you want to copy, like images, medias etc. @@ -682,26 +795,17 @@ def __init__(self, *args, **kwargs): super(StaticGenerator, self).__init__(*args, **kwargs) + self.fallback_to_symlinks = False signals.static_generator_init.send(self) - def _copy_paths(self, paths, source, destination, output_path, - final_path=None): - """Copy all the paths from source to destination""" - for path in paths: - if final_path: - copy(os.path.join(source, path), - os.path.join(output_path, destination, final_path), - self.settings['IGNORE_FILES']) - else: - copy(os.path.join(source, path), - os.path.join(output_path, destination, path), - self.settings['IGNORE_FILES']) - def generate_context(self): self.staticfiles = [] - for f in self.get_files(self.settings['STATIC_PATHS'], - exclude=self.settings['STATIC_EXCLUDES'], - extensions=False): + linked_files = {os.path.join(self.path, path) + for path in self.context['static_links']} + found_files = self.get_files(self.settings['STATIC_PATHS'], + exclude=self.settings['STATIC_EXCLUDES'], + extensions=False) + for f in linked_files | found_files: # skip content source files unless the user explicitly wants them if self.settings['STATIC_EXCLUDE_SOURCES']: @@ -716,7 +820,7 @@ context_signal=signals.static_generator_context, context_sender=self) self.staticfiles.append(static) - self.add_source_path(static) + self.add_source_path(static, static=True) self._update_context(('staticfiles',)) signals.static_generator_finalized.send(self) @@ -724,13 +828,95 @@ self._copy_paths(self.settings['THEME_STATIC_PATHS'], self.theme, self.settings['THEME_STATIC_DIR'], self.output_path, os.curdir) - # copy all Static files for sc in self.context['staticfiles']: - source_path = os.path.join(self.path, sc.source_path) - save_as = os.path.join(self.output_path, sc.save_as) - mkdir_p(os.path.dirname(save_as)) - logger.info('Copying %s to %s', sc.source_path, sc.save_as) - copy_file_metadata(source_path, save_as) + if self._file_update_required(sc): + self._link_or_copy_staticfile(sc) + else: + logger.debug('%s is up to date, not copying', sc.source_path) + + def _copy_paths(self, paths, source, destination, output_path, + final_path=None): + """Copy all the paths from source to destination""" + for path in paths: + source_path = os.path.join(source, path) + + if final_path: + if os.path.isfile(source_path): + destination_path = os.path.join(output_path, destination, + final_path, + os.path.basename(path)) + else: + destination_path = os.path.join(output_path, destination, + final_path) + else: + destination_path = os.path.join(output_path, destination, path) + + copy(source_path, destination_path, + self.settings['IGNORE_FILES']) + + def _file_update_required(self, staticfile): + source_path = os.path.join(self.path, staticfile.source_path) + save_as = os.path.join(self.output_path, staticfile.save_as) + if not os.path.exists(save_as): + return True + elif (self.settings['STATIC_CREATE_LINKS'] and + os.path.samefile(source_path, save_as)): + return False + elif (self.settings['STATIC_CREATE_LINKS'] and + os.path.realpath(save_as) == source_path): + return False + elif not self.settings['STATIC_CHECK_IF_MODIFIED']: + return True + else: + return self._source_is_newer(staticfile) + + def _source_is_newer(self, staticfile): + source_path = os.path.join(self.path, staticfile.source_path) + save_as = os.path.join(self.output_path, staticfile.save_as) + s_mtime = os.path.getmtime(source_path) + d_mtime = os.path.getmtime(save_as) + return s_mtime - d_mtime > 0.000001 + + def _link_or_copy_staticfile(self, sc): + if self.settings['STATIC_CREATE_LINKS']: + self._link_staticfile(sc) + else: + self._copy_staticfile(sc) + + def _copy_staticfile(self, sc): + source_path = os.path.join(self.path, sc.source_path) + save_as = os.path.join(self.output_path, sc.save_as) + self._mkdir(os.path.dirname(save_as)) + copy(source_path, save_as) + logger.info('Copying %s to %s', sc.source_path, sc.save_as) + + def _link_staticfile(self, sc): + source_path = os.path.join(self.path, sc.source_path) + save_as = os.path.join(self.output_path, sc.save_as) + self._mkdir(os.path.dirname(save_as)) + try: + if os.path.lexists(save_as): + os.unlink(save_as) + logger.info('Linking %s and %s', sc.source_path, sc.save_as) + if self.fallback_to_symlinks: + os.symlink(source_path, save_as) + else: + os.link(source_path, save_as) + except OSError as err: + if err.errno == errno.EXDEV: # 18: Invalid cross-device link + logger.debug( + "Cross-device links not valid. " + "Creating symbolic links instead." + ) + self.fallback_to_symlinks = True + self._link_staticfile(sc) + else: + raise err + + def _mkdir(self, path): + if os.path.lexists(path) and not os.path.isdir(path): + os.unlink(path) + mkdir_p(path) class SourceFileGenerator(Generator): diff -Nru pelican-3.7.1+dfsg/pelican/__init__.py pelican-4.0.1+dfsg/pelican/__init__.py --- pelican-3.7.1+dfsg/pelican/__init__.py 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/__init__.py 2018-11-30 16:31:43.000000000 +0000 @@ -5,27 +5,31 @@ import collections import locale import logging +import multiprocessing import os +import pprint import re import sys import time +import traceback import six # pelican.log has to be the first pelican module to be loaded # because logging.setLoggerClass has to be called before logging.getLogger -from pelican.log import init # noqa -from pelican import signals +from pelican.log import init as init_logging +from pelican import signals # noqa from pelican.generators import (ArticlesGenerator, PagesGenerator, SourceFileGenerator, StaticGenerator, TemplatePagesGenerator) from pelican.readers import Readers +from pelican.server import ComplexHTTPRequestHandler, RootedHTTPServer from pelican.settings import read_settings from pelican.utils import (clean_output_dir, file_watcher, folder_watcher, maybe_pluralize) from pelican.writers import Writer -__version__ = "3.7.1" +__version__ = "4.0.1" DEFAULT_CONFIG_NAME = 'pelicanconf.py' logger = logging.getLogger(__name__) @@ -111,10 +115,10 @@ structure = self.settings['ARTICLE_PERMALINK_STRUCTURE'] # Convert %(variable) into {variable}. - structure = re.sub('%\((\w+)\)s', '{\g<1>}', structure) + structure = re.sub(r'%\((\w+)\)s', r'{\g<1>}', structure) # Convert %x into {date:%x} for strftime - structure = re.sub('(%[A-z])', '{date:\g<1>}', structure) + structure = re.sub(r'(%[A-z])', r'{date:\g<1>}', structure) # Strip a / prefix structure = re.sub('^/', '', structure) @@ -146,8 +150,11 @@ start_time = time.time() context = self.settings.copy() - # Share these among all the generators and content objects: - context['filenames'] = {} # maps source path to Content object or None + # Share these among all the generators and content objects + # They map source paths to Content objects or None + context['generated_content'] = {} + context['static_links'] = set() + context['static_content'] = {} context['localsiteurl'] = self.settings['SITEURL'] generators = [ @@ -170,6 +177,10 @@ if hasattr(p, 'generate_context'): p.generate_context() + for p in generators: + if hasattr(p, 'refresh_metadata_intersite_links'): + p.refresh_metadata_intersite_links() + signals.all_generators_finalized.send(generators) writer = self.get_writer() @@ -205,13 +216,20 @@ len(pages_generator.hidden_translations)), 'hidden page', 'hidden pages') - - print('Done: Processed {}, {}, {} and {} in {:.2f} seconds.'.format( - pluralized_articles, - pluralized_drafts, - pluralized_pages, - pluralized_hidden_pages, - time.time() - start_time)) + pluralized_draft_pages = maybe_pluralize( + (len(pages_generator.draft_pages) + + len(pages_generator.draft_translations)), + 'draft page', + 'draft pages') + + print('Done: Processed {}, {}, {}, {} and {} in {:.2f} seconds.' + .format( + pluralized_articles, + pluralized_drafts, + pluralized_pages, + pluralized_hidden_pages, + pluralized_draft_pages, + time.time() - start_time)) def get_generator_classes(self): generators = [ArticlesGenerator, PagesGenerator] @@ -255,6 +273,32 @@ return writer(self.output_path, settings=self.settings) +class PrintSettings(argparse.Action): + def __call__(self, parser, namespace, values, option_string): + instance, settings = get_instance(namespace) + + if values: + # One or more arguments provided, so only print those settings + for setting in values: + if setting in settings: + # Only add newline between setting name and value if dict + if isinstance(settings[setting], dict): + setting_format = '\n{}:\n{}' + else: + setting_format = '\n{}: {}' + print(setting_format.format( + setting, + pprint.pformat(settings[setting]))) + else: + print('\n{} is not a recognized setting.'.format(setting)) + break + else: + # No argument was given to --print-settings, so print all settings + pprint.pprint(settings) + + parser.exit() + + def parse_arguments(): parser = argparse.ArgumentParser( description='A tool to generate a static blog, ' @@ -305,6 +349,12 @@ help='Relaunch pelican each time a modification occurs' ' on the content files.') + parser.add_argument('--print-settings', dest='print_settings', nargs='*', + action=PrintSettings, metavar='SETTING_NAME', + help='Print current configuration settings and exit. ' + 'Append one or more setting name arguments to see the ' + 'values for specific settings only.') + parser.add_argument('--relative-urls', dest='relative_paths', action='store_true', help='Use relative urls in output, ' @@ -327,7 +377,29 @@ help=('Exit the program with non-zero status if any ' 'errors/warnings encountered.')) - return parser.parse_args() + parser.add_argument('--logs-dedup-min-level', default='WARNING', + choices=('DEBUG', 'INFO', 'WARNING', 'ERROR'), + help=('Only enable log de-duplication for levels equal' + ' to or above the specified value')) + + parser.add_argument('-l', '--listen', dest='listen', action='store_true', + help='Serve content files via HTTP and port 8000.') + + parser.add_argument('-p', '--port', dest='port', type=int, + help='Port to serve HTTP files at. (default: 8000)') + + parser.add_argument('-b', '--bind', dest='bind', + help='IP to bind to when serving files via HTTP ' + '(default: 127.0.0.1)') + + args = parser.parse_args() + + if args.port is not None and not args.listen: + logger.warning('--port without --listen has no effect') + if args.bind is not None and not args.listen: + logger.warning('--bind without --listen has no effect') + + return args def get_config(args): @@ -350,6 +422,10 @@ config['WRITE_SELECTED'] = args.selected_paths.split(',') if args.relative_paths: config['RELATIVE_URLS'] = args.relative_paths + if args.port is not None: + config['PORT'] = args.port + if args.bind is not None: + config['BIND'] = args.bind config['DEBUG'] = args.verbosity == logging.DEBUG # argparse returns bytes in Py2. There is no definite answer as to which @@ -382,16 +458,118 @@ return cls(settings), settings +def autoreload(watchers, args, old_static, reader_descs, excqueue=None): + while True: + try: + # Check source dir for changed files ending with the given + # extension in the settings. In the theme dir is no such + # restriction; all files are recursively checked if they + # have changed, no matter what extension the filenames + # have. + modified = {k: next(v) for k, v in watchers.items()} + + if modified['settings']: + pelican, settings = get_instance(args) + + # Adjust static watchers if there are any changes + new_static = settings.get("STATIC_PATHS", []) + + # Added static paths + # Add new watchers and set them as modified + new_watchers = set(new_static).difference(old_static) + for static_path in new_watchers: + static_key = '[static]%s' % static_path + watchers[static_key] = folder_watcher( + os.path.join(pelican.path, static_path), + [''], + pelican.ignore_files) + modified[static_key] = next(watchers[static_key]) + + # Removed static paths + # Remove watchers and modified values + old_watchers = set(old_static).difference(new_static) + for static_path in old_watchers: + static_key = '[static]%s' % static_path + watchers.pop(static_key) + modified.pop(static_key) + + # Replace old_static with the new one + old_static = new_static + + if any(modified.values()): + print('\n-> Modified: {}. re-generating...'.format( + ', '.join(k for k, v in modified.items() if v))) + + if modified['content'] is None: + logger.warning( + 'No valid files found in content for ' + + 'the active readers:\n' + + '\n'.join(reader_descs)) + + if modified['theme'] is None: + logger.warning('Empty theme folder. Using `basic` ' + 'theme.') + + pelican.run() + + except KeyboardInterrupt as e: + logger.warning("Keyboard interrupt, quitting.") + if excqueue is not None: + excqueue.put(traceback.format_exception_only(type(e), e)[-1]) + return + + except Exception as e: + if (args.verbosity == logging.DEBUG): + if excqueue is not None: + excqueue.put( + traceback.format_exception_only(type(e), e)[-1]) + else: + raise + logger.warning( + 'Caught exception "%s". Reloading.', e) + + finally: + time.sleep(.5) # sleep to avoid cpu load + + +def listen(server, port, output, excqueue=None): + RootedHTTPServer.allow_reuse_address = True + try: + httpd = RootedHTTPServer( + output, (server, port), ComplexHTTPRequestHandler) + except OSError as e: + logging.error("Could not listen on port %s, server %s.", port, server) + if excqueue is not None: + excqueue.put(traceback.format_exception_only(type(e), e)[-1]) + return + + logging.info("Serving at port %s, server %s.", port, server) + try: + httpd.serve_forever() + except Exception as e: + if excqueue is not None: + excqueue.put(traceback.format_exception_only(type(e), e)[-1]) + return + + def main(): args = parse_arguments() - init(args.verbosity, args.fatal) + logs_dedup_min_level = getattr(logging, args.logs_dedup_min_level) + init_logging(args.verbosity, args.fatal, + logs_dedup_min_level=logs_dedup_min_level) logger.debug('Pelican version: %s', __version__) logger.debug('Python version: %s', sys.version.split()[0]) try: pelican, settings = get_instance(args) + readers = Readers(settings) + reader_descs = sorted(set(['%s (%s)' % + (type(r).__name__, + ', '.join(r.file_extensions)) + for r in readers.readers.values() + if r.enabled])) watchers = {'content': folder_watcher(pelican.path, readers.extensions, @@ -410,76 +588,34 @@ [''], pelican.ignore_files) - if args.autoreload: + if args.autoreload and args.listen: + excqueue = multiprocessing.Queue() + p1 = multiprocessing.Process( + target=autoreload, + args=(watchers, args, old_static, reader_descs, excqueue)) + p2 = multiprocessing.Process( + target=listen, + args=(settings.get('BIND'), settings.get('PORT'), + settings.get("OUTPUT_PATH"), excqueue)) + p1.start() + p2.start() + exc = excqueue.get() + p1.terminate() + p2.terminate() + logger.critical(exc) + elif args.autoreload: print(' --- AutoReload Mode: Monitoring `content`, `theme` and' ' `settings` for changes. ---') - - while True: - try: - # Check source dir for changed files ending with the given - # extension in the settings. In the theme dir is no such - # restriction; all files are recursively checked if they - # have changed, no matter what extension the filenames - # have. - modified = {k: next(v) for k, v in watchers.items()} - - if modified['settings']: - pelican, settings = get_instance(args) - - # Adjust static watchers if there are any changes - new_static = settings.get("STATIC_PATHS", []) - - # Added static paths - # Add new watchers and set them as modified - new_watchers = set(new_static).difference(old_static) - for static_path in new_watchers: - static_key = '[static]%s' % static_path - watchers[static_key] = folder_watcher( - os.path.join(pelican.path, static_path), - [''], - pelican.ignore_files) - modified[static_key] = next(watchers[static_key]) - - # Removed static paths - # Remove watchers and modified values - old_watchers = set(old_static).difference(new_static) - for static_path in old_watchers: - static_key = '[static]%s' % static_path - watchers.pop(static_key) - modified.pop(static_key) - - # Replace old_static with the new one - old_static = new_static - - if any(modified.values()): - print('\n-> Modified: {}. re-generating...'.format( - ', '.join(k for k, v in modified.items() if v))) - - if modified['content'] is None: - logger.warning('No valid files found in content.') - - if modified['theme'] is None: - logger.warning('Empty theme folder. Using `basic` ' - 'theme.') - - pelican.run() - - except KeyboardInterrupt: - logger.warning("Keyboard interrupt, quitting.") - break - - except Exception as e: - if (args.verbosity == logging.DEBUG): - raise - logger.warning( - 'Caught exception "%s". Reloading.', e) - - finally: - time.sleep(.5) # sleep to avoid cpu load - + autoreload(watchers, args, old_static, reader_descs) + elif args.listen: + listen(settings.get('BIND'), settings.get('PORT'), + settings.get("OUTPUT_PATH")) else: if next(watchers['content']) is None: - logger.warning('No valid files found in content.') + logger.warning( + 'No valid files found in content for ' + + 'the active readers:\n' + + '\n'.join(reader_descs)) if next(watchers['theme']) is None: logger.warning('Empty theme folder. Using `basic` theme.') diff -Nru pelican-3.7.1+dfsg/pelican/log.py pelican-4.0.1+dfsg/pelican/log.py --- pelican-3.7.1+dfsg/pelican/log.py 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/log.py 2018-11-30 16:31:43.000000000 +0000 @@ -24,6 +24,9 @@ record.__dict__['customlevelname'] = customlevel # format multiline messages 'nicely' to make it clear they are together record.msg = record.msg.replace('\n', '\n | ') + record.args = tuple(arg.replace('\n', '\n | ') if + isinstance(arg, six.string_types) else + arg for arg in record.args) return super(BaseFormatter, self).format(record) def formatException(self, ei): @@ -91,6 +94,8 @@ E.g.: log.warning(('43 is not the answer', 'More erroneous answers')) """ + LOGS_DEDUP_MIN_LEVEL = logging.WARNING + _ignore = set() _raised_messages = set() _threshold = 5 @@ -98,7 +103,7 @@ def filter(self, record): # don't limit log messages for anything above "warning" - if record.levelno > logging.WARN: + if record.levelno > self.LOGS_DEDUP_MIN_LEVEL: return True # extract group @@ -197,6 +202,7 @@ if FatalLogger.errors_fatal: raise RuntimeError('Error encountered') + logging.setLoggerClass(FatalLogger) @@ -225,7 +231,8 @@ return TextFormatter() -def init(level=None, fatal='', handler=logging.StreamHandler(), name=None): +def init(level=None, fatal='', handler=logging.StreamHandler(), name=None, + logs_dedup_min_level=None): FatalLogger.warnings_fatal = fatal.startswith('warning') FatalLogger.errors_fatal = bool(fatal) @@ -236,6 +243,8 @@ if level: logger.setLevel(level) + if logs_dedup_min_level: + LimitFilter.LOGS_DEDUP_MIN_LEVEL = logs_dedup_min_level def log_warnings(): diff -Nru pelican-3.7.1+dfsg/pelican/paginator.py pelican-4.0.1+dfsg/pelican/paginator.py --- pelican-3.7.1+dfsg/pelican/paginator.py 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/paginator.py 2018-11-30 16:31:43.000000000 +0000 @@ -17,14 +17,14 @@ class Paginator(object): - def __init__(self, name, object_list, settings): + def __init__(self, name, url, object_list, settings, per_page=None): self.name = name + self.url = url self.object_list = object_list self.settings = settings - - if settings.get('DEFAULT_PAGINATION'): - self.per_page = settings.get('DEFAULT_PAGINATION') - self.orphans = settings.get('DEFAULT_ORPHANS') + if per_page: + self.per_page = per_page + self.orphans = settings['DEFAULT_ORPHANS'] else: self.per_page = len(object_list) self.orphans = 0 @@ -37,8 +37,8 @@ top = bottom + self.per_page if top + self.orphans >= self.count: top = self.count - return Page(self.name, self.object_list[bottom:top], number, self, - self.settings) + return Page(self.name, self.url, self.object_list[bottom:top], number, + self, self.settings) def _get_count(self): "Returns the total number of objects, across all pages." @@ -65,8 +65,12 @@ class Page(object): - def __init__(self, name, object_list, number, paginator, settings): + def __init__(self, name, url, object_list, number, paginator, settings): + self.full_name = name self.name, self.extension = os.path.splitext(name) + dn, fn = os.path.split(name) + self.base_name = dn if fn in ('index.htm', 'index.html') else self.name + self.base_url = url self.object_list = object_list self.number = number self.paginator = paginator @@ -133,24 +137,16 @@ # URL or SAVE_AS is a string, format it with a controlled context context = { - 'name': self.name.replace(os.sep, '/'), - 'object_list': self.object_list, - 'number': self.number, - 'paginator': self.paginator, - 'settings': self.settings, - 'base_name': os.path.dirname(self.name), - 'number_sep': '/', + 'save_as': self.full_name, + 'url': self.base_url, + 'name': self.name, + 'base_name': self.base_name, 'extension': self.extension, + 'number': self.number, } - if self.number == 1: - # no page numbers on the first page - context['number'] = '' - context['number_sep'] = '' - ret = prop_value.format(**context) - if ret[0] == '/': - ret = ret[1:] + ret = ret.lstrip('/') return ret url = property(functools.partial(_from_settings, key='URL')) diff -Nru pelican-3.7.1+dfsg/pelican/readers.py pelican-4.0.1+dfsg/pelican/readers.py --- pelican-3.7.1+dfsg/pelican/readers.py 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/readers.py 2018-11-30 16:31:43.000000000 +0000 @@ -9,9 +9,11 @@ import docutils import docutils.core import docutils.io -from docutils.writers.html4css1 import HTMLTranslator +from docutils.parsers.rst.languages import get_language as get_docutils_lang +from docutils.writers.html4css1 import HTMLTranslator, Writer import six +from six import StringIO from six.moves.html_parser import HTMLParser from pelican import rstdirectives # NOQA @@ -31,6 +33,20 @@ # This means that _filter_discardable_metadata() must be called on processed # metadata dicts before use, to remove the items with the special value. _DISCARD = object() + +DUPLICATES_DEFINITIONS_ALLOWED = { + 'tags': False, + 'date': False, + 'modified': False, + 'status': False, + 'category': False, + 'author': False, + 'save_as': False, + 'url': False, + 'authors': False, + 'slug': False +} + METADATA_PROCESSORS = { 'tags': lambda x, y: ([ Tag(tag, y) @@ -135,12 +151,19 @@ pass -def render_node_to_html(document, node): - visitor = _FieldBodyTranslator(document) +def render_node_to_html(document, node, field_body_translator_class): + visitor = field_body_translator_class(document) node.walkabout(visitor) return visitor.astext() +class PelicanHTMLWriter(Writer): + + def __init__(self): + Writer.__init__(self) + self.translator_class = PelicanHTMLTranslator + + class PelicanHTMLTranslator(HTMLTranslator): def visit_abbreviation(self, node): @@ -160,11 +183,26 @@ class RstReader(BaseReader): - """Reader for reStructuredText files""" + """Reader for reStructuredText files + + By default the output HTML is written using + docutils.writers.html4css1.Writer and translated using a subclass of + docutils.writers.html4css1.HTMLTranslator. If you want to override it with + your own writer/translator (e.g. a HTML5-based one), pass your classes to + these two attributes. Look in the source code for details. + + writer_class Used for writing contents + field_body_translator_class Used for translating metadata such + as article summary + + """ enabled = bool(docutils) file_extensions = ['rst'] + writer_class = PelicanHTMLWriter + field_body_translator_class = _FieldBodyTranslator + class FileInput(docutils.io.FileInput): """Patch docutils.io.FileInput to remove "U" mode in py3. @@ -181,18 +219,35 @@ def __init__(self, *args, **kwargs): super(RstReader, self).__init__(*args, **kwargs) - def _parse_metadata(self, document): + lang_code = self.settings.get('DEFAULT_LANG', 'en') + if get_docutils_lang(lang_code): + self._language_code = lang_code + else: + logger.warning("Docutils has no localization for '%s'." + " Using 'en' instead.", lang_code) + self._language_code = 'en' + + def _parse_metadata(self, document, source_path): """Return the dict containing document metadata""" formatted_fields = self.settings['FORMATTED_FIELDS'] output = {} + + if document.first_child_matching_class(docutils.nodes.title) is None: + logger.warning( + 'Document title missing in file %s: ' + 'Ensure exactly one top level section', + source_path) + for docinfo in document.traverse(docutils.nodes.docinfo): for element in docinfo.children: if element.tagname == 'field': # custom fields (e.g. summary) name_elem, body_elem = element.children name = name_elem.astext() if name in formatted_fields: - value = render_node_to_html(document, body_elem) + value = render_node_to_html( + document, body_elem, + self.field_body_translator_class) else: value = body_elem.astext() elif element.tagname == 'authors': # author list @@ -210,20 +265,23 @@ extra_params = {'initial_header_level': '2', 'syntax_highlight': 'short', 'input_encoding': 'utf-8', - 'exit_status_level': 2, + 'language_code': self._language_code, + 'halt_level': 2, + 'traceback': True, + 'warning_stream': StringIO(), 'embed_stylesheet': False} user_params = self.settings.get('DOCUTILS_SETTINGS') if user_params: extra_params.update(user_params) pub = docutils.core.Publisher( + writer=self.writer_class(), source_class=self.FileInput, destination_class=docutils.io.StringOutput) pub.set_components('standalone', 'restructuredtext', 'html') - pub.writer.translator_class = PelicanHTMLTranslator pub.process_programmatic_settings(None, extra_params, None) pub.set_source(source_path=source_path) - pub.publish(enable_exit_status=True) + pub.publish() return pub def read(self, source_path): @@ -232,7 +290,7 @@ parts = pub.writer.parts content = parts.get('body') - metadata = self._parse_metadata(pub.document) + metadata = self._parse_metadata(pub.document, source_path) metadata.setdefault('title', parts.get('title')) return content, metadata @@ -270,7 +328,7 @@ self._md.reset() formatted = self._md.convert(formatted_values) output[name] = self.process_metadata(name, formatted) - elif name in METADATA_PROCESSORS: + elif not DUPLICATES_DEFINITIONS_ALLOWED.get(name, True): if len(value) > 1: logger.warning( 'Duplicate definition of `%s` ' @@ -416,7 +474,17 @@ if name == 'keywords': name = 'tags' - self.metadata[name] = contents + + if name in self.metadata: + # if this metadata already exists (i.e. a previous tag with the + # same name has already been specified then either convert to + # list or append to list + if isinstance(self.metadata[name], list): + self.metadata[name].append(contents) + else: + self.metadata[name] = [self.metadata[name], contents] + else: + self.metadata[name] = contents @classmethod def _attr_value(cls, attrs, name, default=None): @@ -636,13 +704,13 @@ def parse_path_metadata(source_path, settings=None, process=None): - """Extract a metadata dictionary from a file's path + r"""Extract a metadata dictionary from a file's path >>> import pprint >>> settings = { - ... 'FILENAME_METADATA': '(?P[^.]*).*', + ... 'FILENAME_METADATA': r'(?P[^.]*).*', ... 'PATH_METADATA': - ... '(?P[^/]*)/(?P\d{4}-\d{2}-\d{2})/.*', + ... r'(?P[^/]*)/(?P\d{4}-\d{2}-\d{2})/.*', ... } >>> reader = BaseReader(settings=settings) >>> metadata = parse_path_metadata( @@ -672,7 +740,7 @@ # .items() for py3k compat. for k, v in match.groupdict().items(): k = k.lower() # metadata must be lowercase - if k not in metadata: + if v is not None and k not in metadata: if process: v = process(k, v) metadata[k] = v diff -Nru pelican-3.7.1+dfsg/pelican/rstdirectives.py pelican-4.0.1+dfsg/pelican/rstdirectives.py --- pelican-3.7.1+dfsg/pelican/rstdirectives.py 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/rstdirectives.py 2018-11-30 16:31:43.000000000 +0000 @@ -70,11 +70,12 @@ parsed = highlight('\n'.join(self.content), lexer, formatter) return [nodes.raw('', parsed, format='html')] + directives.register_directive('code-block', Pygments) directives.register_directive('sourcecode', Pygments) -_abbr_re = re.compile('\((.*)\)$', re.DOTALL) +_abbr_re = re.compile(r'\((.*)\)$', re.DOTALL) class abbreviation(nodes.Inline, nodes.TextElement): @@ -90,4 +91,5 @@ expl = m.group(1) return [abbreviation(abbr, abbr, explanation=expl)], [] + roles.register_local_role('abbr', abbr_role) diff -Nru pelican-3.7.1+dfsg/pelican/server.py pelican-4.0.1+dfsg/pelican/server.py --- pelican-3.7.1+dfsg/pelican/server.py 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/server.py 2018-11-30 16:31:43.000000000 +0000 @@ -1,8 +1,11 @@ # -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals +import argparse import logging import os +import posixpath +import ssl import sys try: @@ -10,37 +13,85 @@ except ImportError: magic_from_file = None +from six.moves import BaseHTTPServer from six.moves import SimpleHTTPServer as srvmod -from six.moves import socketserver +from six.moves import urllib + +from pelican.log import init as init_logging +logger = logging.getLogger(__name__) + + +def parse_arguments(): + parser = argparse.ArgumentParser( + description='Pelican Development Server', + formatter_class=argparse.ArgumentDefaultsHelpFormatter + ) + parser.add_argument("port", default=8000, type=int, nargs="?", + help="Port to Listen On") + parser.add_argument("server", default="", nargs="?", + help="Interface to Listen On") + parser.add_argument('--ssl', action="store_true", + help='Activate SSL listener') + parser.add_argument('--cert', default="./cert.pem", nargs="?", + help='Path to certificate file. ' + + 'Relative to current directory') + parser.add_argument('--key', default="./key.pem", nargs="?", + help='Path to certificate key file. ' + + 'Relative to current directory') + parser.add_argument('--path', default=".", + help='Path to pelican source directory to serve. ' + + 'Relative to current directory') + return parser.parse_args() class ComplexHTTPRequestHandler(srvmod.SimpleHTTPRequestHandler): - SUFFIXES = ['', '.html', '/index.html'] + SUFFIXES = ['.html', '/index.html', '/', ''] + + def translate_path(self, path): + # abandon query parameters + path = path.split('?', 1)[0] + path = path.split('#', 1)[0] + # Don't forget explicit trailing slash when normalizing. Issue17324 + trailing_slash = path.rstrip().endswith('/') + path = urllib.parse.unquote(path) + path = posixpath.normpath(path) + words = path.split('/') + words = filter(None, words) + path = self.base_path + for word in words: + if os.path.dirname(word) or word in (os.curdir, os.pardir): + # Ignore components that are not a simple file/directory name + continue + path = os.path.join(path, word) + if trailing_slash: + path += '/' + return path def do_GET(self): # cut off a query string - if '?' in self.path: - self.path, _ = self.path.split('?', 1) - + original_path = self.path.split('?', 1)[0] + # try to find file + self.path = self.get_path_that_exists(original_path) + + if not self.path: + return + + srvmod.SimpleHTTPRequestHandler.do_GET(self) + + def get_path_that_exists(self, original_path): + # Try to strip trailing slash + original_path = original_path.rstrip('/') # Try to detect file by applying various suffixes + tries = [] for suffix in self.SUFFIXES: - if not hasattr(self, 'original_path'): - self.original_path = self.path - - self.path = self.original_path + suffix - path = self.translate_path(self.path) - - if os.path.exists(path): - srvmod.SimpleHTTPRequestHandler.do_GET(self) - logging.info("Found `%s`." % self.path) - break - - logging.info("Tried to find `%s`, but it doesn't exist.", - self.path) - else: - # Fallback if there were no matches - logging.warning("Unable to find `%s` or variations.", - self.original_path) + path = original_path + suffix + if os.path.exists(self.translate_path(path)): + return path + tries.append(path) + logger.warning("Unable to find `%s` or variations:\n%s", + original_path, + '\n'.join(tries)) + return None def guess_type(self, path): """Guess at the mime type for the specified file. @@ -54,21 +105,39 @@ return mimetype -if __name__ == '__main__': - PORT = len(sys.argv) in (2, 3) and int(sys.argv[1]) or 8000 - SERVER = len(sys.argv) == 3 and sys.argv[2] or "" +class RootedHTTPServer(BaseHTTPServer.HTTPServer): + def __init__(self, base_path, *args, **kwargs): + BaseHTTPServer.HTTPServer.__init__(self, *args, **kwargs) + self.RequestHandlerClass.base_path = base_path - socketserver.TCPServer.allow_reuse_address = True + +if __name__ == '__main__': + init_logging(level=logging.INFO) + logger.warning("'python -m pelican.server' is deprecated.\nThe " + "Pelican development server should be run via " + "'pelican --listen' or 'pelican -l'.\nThis can be combined " + "with regeneration as 'pelican -lr'.\nRerun 'pelican-" + "quickstart' to get new Makefile and tasks.py files.") + args = parse_arguments() + RootedHTTPServer.allow_reuse_address = True try: - httpd = socketserver.TCPServer( - (SERVER, PORT), ComplexHTTPRequestHandler) - except OSError as e: - logging.error("Could not listen on port %s, server %s.", PORT, SERVER) + httpd = RootedHTTPServer( + args.path, (args.server, args.port), ComplexHTTPRequestHandler) + if args.ssl: + httpd.socket = ssl.wrap_socket( + httpd.socket, keyfile=args.key, + certfile=args.cert, server_side=True) + except ssl.SSLError as e: + logger.error("Couldn't open certificate file %s or key file %s", + args.cert, args.key) + logger.error("Could not listen on port %s, server %s.", + args.port, args.server) sys.exit(getattr(e, 'exitcode', 1)) - logging.info("Serving at port %s, server %s.", PORT, SERVER) + logger.info("Serving at port %s, server %s.", + args.port, args.server) try: httpd.serve_forever() except KeyboardInterrupt as e: - logging.info("Shutting down server.") + logger.info("Shutting down server.") httpd.socket.close() diff -Nru pelican-3.7.1+dfsg/pelican/settings.py pelican-4.0.1+dfsg/pelican/settings.py --- pelican-3.7.1+dfsg/pelican/settings.py 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/settings.py 2018-11-30 16:31:43.000000000 +0000 @@ -6,6 +6,7 @@ import locale import logging import os +import re from os.path import isabs from posixpath import join as posix_join @@ -14,13 +15,13 @@ from pelican.log import LimitFilter try: - # SourceFileLoader is the recommended way in 3.3+ + # SourceFileLoader is the recommended way in Python 3.3+ from importlib.machinery import SourceFileLoader def load_source(name, path): return SourceFileLoader(name, path).load_module() except ImportError: - # but it does not exist in 3.2-, so fall back to imp + # but it does not exist in Python 2.7, so fall back to imp import imp load_source = imp.load_source @@ -44,10 +45,10 @@ 'THEME_STATIC_DIR': 'theme', 'THEME_STATIC_PATHS': ['static', ], 'FEED_ALL_ATOM': posix_join('feeds', 'all.atom.xml'), - 'CATEGORY_FEED_ATOM': posix_join('feeds', '%s.atom.xml'), - 'AUTHOR_FEED_ATOM': posix_join('feeds', '%s.atom.xml'), - 'AUTHOR_FEED_RSS': posix_join('feeds', '%s.rss.xml'), - 'TRANSLATION_FEED_ATOM': posix_join('feeds', 'all-%s.atom.xml'), + 'CATEGORY_FEED_ATOM': posix_join('feeds', '{slug}.atom.xml'), + 'AUTHOR_FEED_ATOM': posix_join('feeds', '{slug}.atom.xml'), + 'AUTHOR_FEED_RSS': posix_join('feeds', '{slug}.rss.xml'), + 'TRANSLATION_FEED_ATOM': posix_join('feeds', 'all-{lang}.atom.xml'), 'FEED_MAX_ITEMS': '', 'RSS_FEED_SUMMARY_ONLY': True, 'SITEURL': '', @@ -80,8 +81,15 @@ 'PAGE_ORDER_BY': 'basename', 'PAGE_LANG_URL': 'pages/{slug}-{lang}.html', 'PAGE_LANG_SAVE_AS': posix_join('pages', '{slug}-{lang}.html'), + 'DRAFT_PAGE_URL': 'drafts/pages/{slug}.html', + 'DRAFT_PAGE_SAVE_AS': posix_join('drafts', 'pages', '{slug}.html'), + 'DRAFT_PAGE_LANG_URL': 'drafts/pages/{slug}-{lang}.html', + 'DRAFT_PAGE_LANG_SAVE_AS': posix_join('drafts', 'pages', + '{slug}-{lang}.html'), 'STATIC_URL': '{path}', 'STATIC_SAVE_AS': '{path}', + 'STATIC_CREATE_LINKS': False, + 'STATIC_CHECK_IF_MODIFIED': False, 'CATEGORY_URL': 'category/{slug}.html', 'CATEGORY_SAVE_AS': posix_join('category', '{slug}.html'), 'TAG_URL': 'tag/{slug}.html', @@ -89,16 +97,23 @@ 'AUTHOR_URL': 'author/{slug}.html', 'AUTHOR_SAVE_AS': posix_join('author', '{slug}.html'), 'PAGINATION_PATTERNS': [ - (0, '{name}{number}{extension}', '{name}{number}{extension}'), + (1, '{name}{extension}', '{name}{extension}'), + (2, '{name}{number}{extension}', '{name}{number}{extension}'), ], + 'YEAR_ARCHIVE_URL': '', 'YEAR_ARCHIVE_SAVE_AS': '', + 'MONTH_ARCHIVE_URL': '', 'MONTH_ARCHIVE_SAVE_AS': '', + 'DAY_ARCHIVE_URL': '', 'DAY_ARCHIVE_SAVE_AS': '', 'RELATIVE_URLS': False, 'DEFAULT_LANG': 'en', + 'ARTICLE_TRANSLATION_ID': 'slug', + 'PAGE_TRANSLATION_ID': 'slug', 'DIRECT_TEMPLATES': ['index', 'tags', 'categories', 'authors', 'archives'], - 'EXTRA_TEMPLATES_PATHS': [], - 'PAGINATED_DIRECT_TEMPLATES': ['index'], + 'THEME_TEMPLATES_OVERRIDES': [], + 'PAGINATED_TEMPLATES': {'index': None, 'tag': None, 'category': None, + 'author': None}, 'PELICAN_CLASS': 'pelican.Pelican', 'DEFAULT_DATE_FORMAT': '%a %d %B %Y', 'DATE_FORMATS': {}, @@ -121,10 +136,9 @@ 'DEFAULT_PAGINATION': False, 'DEFAULT_ORPHANS': 0, 'DEFAULT_METADATA': {}, - 'FILENAME_METADATA': '(?P\d{4}-\d{2}-\d{2}).*', + 'FILENAME_METADATA': r'(?P\d{4}-\d{2}-\d{2}).*', 'PATH_METADATA': '', 'EXTRA_PATH_METADATA': {}, - 'DEFAULT_STATUS': 'published', 'ARTICLE_PERMALINK_STRUCTURE': '', 'TYPOGRIFY': False, 'TYPOGRIFY_IGNORE_TAGS': [], @@ -133,8 +147,14 @@ 'PLUGINS': [], 'PYGMENTS_RST_OPTIONS': {}, 'TEMPLATE_PAGES': {}, + 'TEMPLATE_EXTENSIONS': ['.html'], 'IGNORE_FILES': ['.#*'], - 'SLUG_SUBSTITUTIONS': (), + 'SLUG_REGEX_SUBSTITUTIONS': [ + (r'[^\w\s-]', ''), # remove non-alphabetical/whitespace/'-' chars + (r'(?u)\A\s*', ''), # strip leading whitespace + (r'(?u)\s*\Z', ''), # strip trailing whitespace + (r'[-\s]+', '-'), # reduce multiple whitespace or '-' to single '-' + ], 'INTRASITE_LINK_REGEX': '[{|](?P.*?)[|}]', 'SLUGIFY_SOURCE': 'title', 'CACHE_CONTENT': False, @@ -145,85 +165,70 @@ 'LOAD_CONTENT_CACHE': False, 'WRITE_SELECTED': [], 'FORMATTED_FIELDS': ['summary'], + 'PORT': 8000, + 'BIND': '', } PYGMENTS_RST_OPTIONS = None def read_settings(path=None, override=None): + settings = override or {} + + if path: + settings = dict(get_settings_from_file(path), **settings) + + if settings: + settings = handle_deprecated_settings(settings) + if path: - local_settings = get_settings_from_file(path) - # Make the paths relative to the settings file + # Make relative paths absolute + def getabs(maybe_relative, base_path=path): + if isabs(maybe_relative): + return maybe_relative + return os.path.abspath(os.path.normpath(os.path.join( + os.path.dirname(base_path), maybe_relative))) + for p in ['PATH', 'OUTPUT_PATH', 'THEME', 'CACHE_PATH']: - if p in local_settings and local_settings[p] is not None \ - and not isabs(local_settings[p]): - absp = os.path.abspath(os.path.normpath(os.path.join( - os.path.dirname(path), local_settings[p]))) + if settings.get(p) is not None: + absp = getabs(settings[p]) + # THEME may be a name rather than a path if p != 'THEME' or os.path.exists(absp): - local_settings[p] = absp + settings[p] = absp - if 'PLUGIN_PATH' in local_settings: - logger.warning('PLUGIN_PATH setting has been replaced by ' - 'PLUGIN_PATHS, moving it to the new setting name.') - local_settings['PLUGIN_PATHS'] = local_settings['PLUGIN_PATH'] - del local_settings['PLUGIN_PATH'] - if 'JINJA_EXTENSIONS' in local_settings: - logger.warning('JINJA_EXTENSIONS setting has been deprecated, ' - 'moving it to JINJA_ENVIRONMENT setting.') - local_settings['JINJA_ENVIRONMENT']['extensions'] = \ - local_settings['JINJA_EXTENSIONS'] - del local_settings['JINJA_EXTENSIONS'] - if isinstance(local_settings['PLUGIN_PATHS'], six.string_types): - logger.warning("Defining PLUGIN_PATHS setting as string " - "has been deprecated (should be a list)") - local_settings['PLUGIN_PATHS'] = [local_settings['PLUGIN_PATHS']] - elif local_settings['PLUGIN_PATHS'] is not None: - def getabs(path, pluginpath): - if isabs(pluginpath): - return pluginpath - else: - path_dirname = os.path.dirname(path) - path_joined = os.path.join(path_dirname, pluginpath) - path_normed = os.path.normpath(path_joined) - path_absolute = os.path.abspath(path_normed) - return path_absolute - - pluginpath_list = [getabs(path, pluginpath) - for pluginpath - in local_settings['PLUGIN_PATHS']] - local_settings['PLUGIN_PATHS'] = pluginpath_list - else: - local_settings = copy.deepcopy(DEFAULT_CONFIG) + if settings.get('PLUGIN_PATHS') is not None: + settings['PLUGIN_PATHS'] = [getabs(pluginpath) + for pluginpath + in settings['PLUGIN_PATHS']] - if override: - local_settings.update(override) + settings = dict(copy.deepcopy(DEFAULT_CONFIG), **settings) + settings = configure_settings(settings) - parsed_settings = configure_settings(local_settings) # This is because there doesn't seem to be a way to pass extra # parameters to docutils directive handlers, so we have to have a # variable here that we'll import from within Pygments.run (see # rstdirectives.py) to see what the user defaults were. global PYGMENTS_RST_OPTIONS - PYGMENTS_RST_OPTIONS = parsed_settings.get('PYGMENTS_RST_OPTIONS', None) - return parsed_settings + PYGMENTS_RST_OPTIONS = settings.get('PYGMENTS_RST_OPTIONS', None) + return settings -def get_settings_from_module(module=None, default_settings=DEFAULT_CONFIG): +def get_settings_from_module(module=None): """Loads settings from a module, returns a dictionary.""" - context = copy.deepcopy(default_settings) + context = {} if module is not None: context.update( (k, v) for k, v in inspect.getmembers(module) if k.isupper()) return context -def get_settings_from_file(path, default_settings=DEFAULT_CONFIG): +def get_settings_from_file(path): """Loads settings from a file path, returning a dict.""" name, ext = os.path.splitext(os.path.basename(path)) module = load_source(name, path) - return get_settings_from_module(module, default_settings=default_settings) + return get_settings_from_module(module) def get_jinja_environment(settings): @@ -240,6 +245,202 @@ return settings +def _printf_s_to_format_field(printf_string, format_field): + """Tries to replace %s with {format_field} in the provided printf_string. + Raises ValueError in case of failure. + """ + TEST_STRING = 'PELICAN_PRINTF_S_DEPRECATION' + expected = printf_string % TEST_STRING + + result = printf_string.replace('{', '{{').replace('}', '}}') \ + % '{{{}}}'.format(format_field) + if result.format(**{format_field: TEST_STRING}) != expected: + raise ValueError('Failed to safely replace %s with {{{}}}'.format( + format_field)) + + return result + + +def handle_deprecated_settings(settings): + """Converts deprecated settings and issues warnings. Issues an exception + if both old and new setting is specified. + """ + + # PLUGIN_PATH -> PLUGIN_PATHS + if 'PLUGIN_PATH' in settings: + logger.warning('PLUGIN_PATH setting has been replaced by ' + 'PLUGIN_PATHS, moving it to the new setting name.') + settings['PLUGIN_PATHS'] = settings['PLUGIN_PATH'] + del settings['PLUGIN_PATH'] + + # PLUGIN_PATHS: str -> [str] + if isinstance(settings.get('PLUGIN_PATHS'), six.string_types): + logger.warning("Defining PLUGIN_PATHS setting as string " + "has been deprecated (should be a list)") + settings['PLUGIN_PATHS'] = [settings['PLUGIN_PATHS']] + + # JINJA_EXTENSIONS -> JINJA_ENVIRONMENT > extensions + if 'JINJA_EXTENSIONS' in settings: + logger.warning('JINJA_EXTENSIONS setting has been deprecated, ' + 'moving it to JINJA_ENVIRONMENT setting.') + settings['JINJA_ENVIRONMENT']['extensions'] = \ + settings['JINJA_EXTENSIONS'] + del settings['JINJA_EXTENSIONS'] + + # {ARTICLE,PAGE}_DIR -> {ARTICLE,PAGE}_PATHS + for key in ['ARTICLE', 'PAGE']: + old_key = key + '_DIR' + new_key = key + '_PATHS' + if old_key in settings: + logger.warning( + 'Deprecated setting %s, moving it to %s list', + old_key, new_key) + settings[new_key] = [settings[old_key]] # also make a list + del settings[old_key] + + # EXTRA_TEMPLATES_PATHS -> THEME_TEMPLATES_OVERRIDES + if 'EXTRA_TEMPLATES_PATHS' in settings: + logger.warning('EXTRA_TEMPLATES_PATHS is deprecated use ' + 'THEME_TEMPLATES_OVERRIDES instead.') + if ('THEME_TEMPLATES_OVERRIDES' in settings and + settings['THEME_TEMPLATES_OVERRIDES']): + raise Exception( + 'Setting both EXTRA_TEMPLATES_PATHS and ' + 'THEME_TEMPLATES_OVERRIDES is not permitted. Please move to ' + 'only setting THEME_TEMPLATES_OVERRIDES.') + settings['THEME_TEMPLATES_OVERRIDES'] = \ + settings['EXTRA_TEMPLATES_PATHS'] + del settings['EXTRA_TEMPLATES_PATHS'] + + # MD_EXTENSIONS -> MARKDOWN + if 'MD_EXTENSIONS' in settings: + logger.warning('MD_EXTENSIONS is deprecated use MARKDOWN ' + 'instead. Falling back to the default.') + settings['MARKDOWN'] = DEFAULT_CONFIG['MARKDOWN'] + + # LESS_GENERATOR -> Webassets plugin + # FILES_TO_COPY -> STATIC_PATHS, EXTRA_PATH_METADATA + for old, new, doc in [ + ('LESS_GENERATOR', 'the Webassets plugin', None), + ('FILES_TO_COPY', 'STATIC_PATHS and EXTRA_PATH_METADATA', + 'https://github.com/getpelican/pelican/' + 'blob/master/docs/settings.rst#path-metadata'), + ]: + if old in settings: + message = 'The {} setting has been removed in favor of {}'.format( + old, new) + if doc: + message += ', see {} for details'.format(doc) + logger.warning(message) + + # PAGINATED_DIRECT_TEMPLATES -> PAGINATED_TEMPLATES + if 'PAGINATED_DIRECT_TEMPLATES' in settings: + message = 'The {} setting has been removed in favor of {}'.format( + 'PAGINATED_DIRECT_TEMPLATES', 'PAGINATED_TEMPLATES') + logger.warning(message) + + # set PAGINATED_TEMPLATES + if 'PAGINATED_TEMPLATES' not in settings: + settings['PAGINATED_TEMPLATES'] = { + 'tag': None, 'category': None, 'author': None} + + for t in settings['PAGINATED_DIRECT_TEMPLATES']: + if t not in settings['PAGINATED_TEMPLATES']: + settings['PAGINATED_TEMPLATES'][t] = None + del settings['PAGINATED_DIRECT_TEMPLATES'] + + # {SLUG,CATEGORY,TAG,AUTHOR}_SUBSTITUTIONS -> + # {SLUG,CATEGORY,TAG,AUTHOR}_REGEX_SUBSTITUTIONS + url_settings_url = \ + 'http://docs.getpelican.com/en/latest/settings.html#url-settings' + flavours = {'SLUG', 'CATEGORY', 'TAG', 'AUTHOR'} + old_values = {f: settings[f + '_SUBSTITUTIONS'] + for f in flavours if f + '_SUBSTITUTIONS' in settings} + new_values = {f: settings[f + '_REGEX_SUBSTITUTIONS'] + for f in flavours if f + '_REGEX_SUBSTITUTIONS' in settings} + if old_values and new_values: + raise Exception( + 'Setting both {new_key} and {old_key} (or variants thereof) is ' + 'not permitted. Please move to only setting {new_key}.' + .format(old_key='SLUG_SUBSTITUTIONS', + new_key='SLUG_REGEX_SUBSTITUTIONS')) + if old_values: + message = ('{} and variants thereof are deprecated and will be ' + 'removed in the future. Please use {} and variants thereof ' + 'instead. Check {}.' + .format('SLUG_SUBSTITUTIONS', 'SLUG_REGEX_SUBSTITUTIONS', + url_settings_url)) + logger.warning(message) + if old_values.get('SLUG'): + for f in {'CATEGORY', 'TAG'}: + if old_values.get(f): + old_values[f] = old_values['SLUG'] + old_values[f] + old_values['AUTHOR'] = old_values.get('AUTHOR', []) + for f in flavours: + if old_values.get(f) is not None: + regex_subs = [] + # by default will replace non-alphanum characters + replace = True + for tpl in old_values[f]: + try: + src, dst, skip = tpl + if skip: + replace = False + except ValueError: + src, dst = tpl + regex_subs.append( + (re.escape(src), dst.replace('\\', r'\\'))) + + if replace: + regex_subs += [ + (r'[^\w\s-]', ''), + (r'(?u)\A\s*', ''), + (r'(?u)\s*\Z', ''), + (r'[-\s]+', '-'), + ] + else: + regex_subs += [ + (r'(?u)\A\s*', ''), + (r'(?u)\s*\Z', ''), + ] + settings[f + '_REGEX_SUBSTITUTIONS'] = regex_subs + settings.pop(f + '_SUBSTITUTIONS', None) + + # `%s` -> '{slug}` or `{lang}` in FEED settings + for key in ['TRANSLATION_FEED_ATOM', + 'TRANSLATION_FEED_RSS' + ]: + if settings.get(key) and '%s' in settings[key]: + logger.warning('%%s usage in %s is deprecated, use {lang} ' + 'instead.', key) + try: + settings[key] = _printf_s_to_format_field( + settings[key], 'lang') + except ValueError: + logger.warning('Failed to convert %%s to {lang} for %s. ' + 'Falling back to default.', key) + settings[key] = DEFAULT_CONFIG[key] + for key in ['AUTHOR_FEED_ATOM', + 'AUTHOR_FEED_RSS', + 'CATEGORY_FEED_ATOM', + 'CATEGORY_FEED_RSS', + 'TAG_FEED_ATOM', + 'TAG_FEED_RSS', + ]: + if settings.get(key) and '%s' in settings[key]: + logger.warning('%%s usage in %s is deprecated, use {slug} ' + 'instead.', key) + try: + settings[key] = _printf_s_to_format_field( + settings[key], 'slug') + except ValueError: + logger.warning('Failed to convert %%s to {slug} for %s. ' + 'Falling back to default.', key) + settings[key] = DEFAULT_CONFIG[key] + + return settings + + def configure_settings(settings): """Provide optimizations, error checking, and warnings for the given settings. @@ -364,23 +565,12 @@ key=lambda r: r[0], ) - # move {ARTICLE,PAGE}_DIR -> {ARTICLE,PAGE}_PATHS - for key in ['ARTICLE', 'PAGE']: - old_key = key + '_DIR' - new_key = key + '_PATHS' - if old_key in settings: - logger.warning( - 'Deprecated setting %s, moving it to %s list', - old_key, new_key) - settings[new_key] = [settings[old_key]] # also make a list - del settings[old_key] - # Save people from accidentally setting a string rather than a list path_keys = ( 'ARTICLE_EXCLUDES', 'DEFAULT_METADATA', 'DIRECT_TEMPLATES', - 'EXTRA_TEMPLATES_PATHS', + 'THEME_TEMPLATES_OVERRIDES', 'FILES_TO_COPY', 'IGNORE_FILES', 'PAGINATED_DIRECT_TEMPLATES', @@ -398,12 +588,6 @@ PATH_KEY) settings[PATH_KEY] = DEFAULT_CONFIG[PATH_KEY] - # Deprecated warning of MD_EXTENSIONS - if 'MD_EXTENSIONS' in settings: - logger.warning('MD_EXTENSIONS is deprecated use MARKDOWN ' - 'instead. Falling back to the default.') - settings['MARKDOWN'] = DEFAULT_CONFIG['MARKDOWN'] - # Add {PAGE,ARTICLE}_PATHS to {ARTICLE,PAGE}_EXCLUDES mutually_exclusive = ('ARTICLE', 'PAGE') for type_1, type_2 in [mutually_exclusive, mutually_exclusive[::-1]]: @@ -416,17 +600,4 @@ except KeyError: continue # setting not specified, nothing to do - for old, new, doc in [ - ('LESS_GENERATOR', 'the Webassets plugin', None), - ('FILES_TO_COPY', 'STATIC_PATHS and EXTRA_PATH_METADATA', - 'https://github.com/getpelican/pelican/' - 'blob/master/docs/settings.rst#path-metadata'), - ]: - if old in settings: - message = 'The {} setting has been removed in favor of {}'.format( - old, new) - if doc: - message += ', see {} for details'.format(doc) - logger.warning(message) - return settings diff -Nru pelican-3.7.1+dfsg/pelican/signals.py pelican-4.0.1+dfsg/pelican/signals.py --- pelican-3.7.1+dfsg/pelican/signals.py 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/signals.py 2018-11-30 16:31:43.000000000 +0000 @@ -27,6 +27,7 @@ page_generator_init = signal('page_generator_init') page_generator_finalized = signal('page_generator_finalized') +page_generator_write_page = signal('page_generator_write_page') page_writer_finalized = signal('page_writer_finalized') static_generator_init = signal('static_generator_init') @@ -47,4 +48,5 @@ # Writers signals content_written = signal('content_written') +feed_generated = signal('feed_generated') feed_written = signal('feed_written') diff -Nru pelican-3.7.1+dfsg/pelican/tests/content/article_with_multiple_metadata_tags.html pelican-4.0.1+dfsg/pelican/tests/content/article_with_multiple_metadata_tags.html --- pelican-3.7.1+dfsg/pelican/tests/content/article_with_multiple_metadata_tags.html 1970-01-01 00:00:00.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/content/article_with_multiple_metadata_tags.html 2018-11-30 16:31:43.000000000 +0000 @@ -0,0 +1,11 @@ + + + Metadata tags as list! + + + + + When custom metadata tags are specified more than once + they are collected into a list! + + diff -Nru pelican-3.7.1+dfsg/pelican/tests/content/bloggerexport.xml pelican-4.0.1+dfsg/pelican/tests/content/bloggerexport.xml --- pelican-3.7.1+dfsg/pelican/tests/content/bloggerexport.xml 1970-01-01 00:00:00.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/content/bloggerexport.xml 2018-11-30 16:31:43.000000000 +0000 @@ -0,0 +1,1067 @@ + + + + tag:blogger.com,1999:blog-6303278419262689239.archive + + 2018-08-02T12:38:27.320-07:00 + + Notes of a Young Doctor + + + + + + Mikhail Afanasyevich Bulgakov + + https://www.blogger.com/profile/000082957 + + noreply@blogger.com + + + + Blogger + + + tag:blogger.com,1999:blog-6303278419262689239.layout + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Template: Notes of a Young Doctor + [Over 2000 lines of mostly css that we don't need here.] + + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_PUBLISHING_MODE + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Het type publicatie voor deze blog. + PUBLISH_MODE_BLOGSPOT + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_ADMIN_PERMISSION + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + De lijst van e-mails van beheerders voor de blog. + mikhail.afanasyevich.bulgakov@gmail.com + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_ADULT_CONTENT + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Hier wordt aangegeven of deze blog content voor volwassenen bevat + false + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_ALTERNATE_JSRENDER_ALLOWED + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Hier wordt aangegeven of alternatieve weergaven in JavaScript zijn toegestaan + true + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_ANALYTICS_ACCOUNT_NUMBER + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Google Analytics-accountnummer voor een blog + + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_ARCHIVE_DATE_FORMAT + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Het getal van de datumnotatie voor de archiefindex + 9 + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_ARCHIVE_FREQUENCY + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Hoe vaak deze blog moet worden gearchiveerd + MONTHLY + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_AUTHOR_PERMISSION + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + De lijst van e-mails van auteurs die toestemming hebben om te publiceren. + + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_BACKLINKS_ALLOWED + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Hier wordt aangegeven of reactiebacklinks op de blog moeten worden getoond + false + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_BY_POST_ARCHIVING + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Hier wordt aangegeven of iedere post moet worden voorzien van een archiefpagina + true + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_COMMENT_ACCESS + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Wie kan reacties achterlaten + BLOGGERS + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_COMMENT_CAPTCHA + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Hier wordt aangegeven of personen die reacties geven, een Captcha (woordverificatie) moeten invullen + true + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_COMMENT_EMAIL + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Lijst met e-mailadressen om meldingen van nieuwe reacties naar te sturen + mikhail.afanasyevich.bulgakov@gmail.com + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_COMMENT_FEED + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Het type feed dat voor blogreacties moet worden gegeven + FULL + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_COMMENT_FORM_LOCATION + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Locatie van formulier voor blogreacties + EMBEDDED_IFRAME + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_COMMENT_MESSAGE + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Bericht bij blogreactie + + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_COMMENT_MODERATION + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Hier wordt aangegeven of het modereren van reacties moet worden ingeschakeld + DISABLED + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_COMMENT_MODERATION_DELAY + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Aantal dagen waarna nieuwe reacties in aanmerking komen voor moderaten + 14 + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_COMMENT_MODERATION_EMAIL + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + E-mailadres waar meldingen binnenkomen over welke nieuwe reacties bewerkt of verwijderd moeten worden + + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_COMMENT_PROFILE_IMAGES + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Hier wordt aangegeven of profielafbeeldingen in reacties moeten worden getoond + true + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_COMMENTS_ALLOWED + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Hier wordt aangegeven of er reacties moeten worden weergegeven + true + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_COMMENTS_TIME_STAMP_FORMAT + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Getal van de tijdstempelnotatie voor reacties + 29 + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_CONVERT_LINE_BREAKS + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Hier wordt aangegeven of de regelscheidingen moeten worden omgezet in <br />-tags in de posteditor + true + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_CUSTOM_ADS_TXT + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + De aangepaste ads.txt-content van de blog die aan advertentiezoekmachines wordt getoond. + + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_CUSTOM_ADS_TXT_ENABLED + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Bepaalt of deze blog aangepaste ads.txt-content aan advertentiezoekmachines toont. + false + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_CUSTOM_PAGE_NOT_FOUND + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + De content die wordt weergegeven wanneer een post of pagina niet is gevonden. + + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_CUSTOM_ROBOTS_TXT + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + De aangepaste robots.txt-content van de blog wordt aan zoekmachines getoond. + + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_CUSTOM_ROBOTS_TXT_ENABLED + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Bepaalt of deze blog aangepaste robots.txt-content aan zoekmachines toont. + false + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_DATE_FORMAT + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Het getal van de datumnotatie voor koppen + 26 + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_DEFAULT_BACKLINKS_MODE + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Standaardbacklinks voor posts + DEFAULT_HAVE_BACKLINKS + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_DEFAULT_COMMENTS_MODE + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Standaardreactie voor posts + DEFAULT_HAVE_COMMENTS + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_DESCRIPTION + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Een beschrijving van de blog + + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_EMAIL_POST_LINKS + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Hier wordt aangegeven of er een link moet worden weergegeven waarmee gebruikers posts kunnen e-mailen + true + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_FEED_REDIRECT_URL + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + URL waar verzoeken om postfeed naartoe worden geleid + + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_FLOAT_ALIGNMENT + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Hier wordt aangegeven of zwevende uitlijning is ingeschakeld voor de blog + true + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_LOCALE + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Taal voor deze blog + nl + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_M2B_WHITELIST_EMAIL + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Lijst met e-mailadressen die via e-mail posts op de blog kunnen plaatsen. + + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_MAX_NUM + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Maximaal aantal items voor weergave op de hoofdpagina" + 100 + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_MAX_UNIT + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Eenheid van items voor weergave op de hoofdpagina + POSTS + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_META_DESCRIPTION + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + De metabeschrijving van de blog die wordt gebruikt door zoekmachines. + + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_META_DESCRIPTION_ENABLED + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Of deze blog wordt weergegeven met metabeschrijvingen. + false + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_NAME + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + De naam van de blog + Notes of a Young Doctor + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_PER_POST_FEED + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Het type feed dat voor reacties op afzonderlijke posts moet worden gegeven + FULL + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_POST_FEED + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Het type feed dat voor blogposts moet worden gegeven + FULL + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_POST_FEED_FOOTER + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Voettekst om aan het einde van iedere vermelding in de postfeed toe te voegen + + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_POST_TEMPLATE + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + De template voor blogposts + + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_PROMOTED + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Hier wordt aangegeven of deze blog op Blogger kan worden aangeprezen + true + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_QUICK_EDITING + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Hier wordt aangegeven of Snel bewerken is ingeschakeld + true + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_READ_ACCESS_MODE + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Het type toegang voor de lezers van de blog. + PUBLIC + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_READER_PERMISSION + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + De e-maillijst voor gebruikers die toestemming hebben om de blog te lezen. + + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_SEARCHABLE + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Hier wordt aangegeven of deze blog door zoekmachines moet worden geïndexeerd + true + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_SEND_EMAIL + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Door komma's gescheiden lijst met e-mailadressen om nieuwe blogposts naar te sturen + + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_SHOW_TITLE + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Hier wordt aangegeven of het titelveld moet worden weergegeven + true + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_SHOW_URL + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Hier wordt aangegeven of er een verwante link in de postopsteller moet worden weergegeven + false + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_SUBDOMAIN + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Het subdomein van BlogSpot om je blog op te publiceren + youngdoctornotes + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_TIME_STAMP_FORMAT + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Het getal van de tijdstempelnotatie + 27 + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_TIME_ZONE + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + De tijdzone voor deze blog + America/Los_Angeles + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.settings.BLOG_USE_LIGHTBOX + 2010-11-27T07:08:20.877-08:00 + 2018-08-02T12:38:27.320-07:00 + + Of afbeeldingen worden weergegeven in de lightbox wanneer erop wordt geklikt + true + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.post-1276418104709695660 + 2010-11-27T08:21:00.000-08:00 + 2018-08-02T12:22:48.286-07:00 + + yes + + + + + Black as Egypt's Night + Write next story here + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + 0 + + + tag:blogger.com,1999:blog-6303278419262689239.post-1858599377741856733 + 2010-11-27T07:12:00.000-08:00 + 2010-11-27T07:56:43.964-08:00 + + The Steel Windpipe + It was a cold Winter's night.<br /><br /><ul><li>Very cold indeed.</li><br /><li>Note to self: pad out ending</li></ul> + + + + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + 1 + + + tag:blogger.com,1999:blog-6303278419262689239.page-4386962582497458967 + 2018-08-02T12:38:00.001-07:00 + 2018-08-02T12:38:27.171-07:00 + + yes + + + Test page 2 + <div dir="ltr" style="text-align: left;" trbidi="on">This is a second test</div> + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.page-1406163839769953231 + 2018-08-02T12:37:00.004-07:00 + 2018-08-02T12:37:47.424-07:00 + + Test page + <div dir="ltr" style="text-align: left;" trbidi="on">This is a test.</div> + + + + + Mikhail Afanasyevich Bulgakov + https://www.blogger.com/profile/000082957 + noreply@blogger.com + + + + + tag:blogger.com,1999:blog-6303278419262689239.post-5590533389087749201 + 2010-11-29T12:35:44.027-08:00 + 2010-11-29T12:35:44.027-08:00 + + Mishka, always a pleasure to read your adventures!... + Mishka, always a pleasure to read your adventures!<br /><br />It's a shame you don't get more time for writing. + + + + + Thomas Isidore Noël Sankara + https://www.blogger.com/profile/0617349827 + noreply@blogger.com + + + + + + + \ No newline at end of file diff -Nru pelican-3.7.1+dfsg/pelican/tests/content/wordpressexport.xml pelican-4.0.1+dfsg/pelican/tests/content/wordpressexport.xml --- pelican-3.7.1+dfsg/pelican/tests/content/wordpressexport.xml 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/content/wordpressexport.xml 2018-11-30 16:31:43.000000000 +0000 @@ -554,7 +554,11 @@ -Bottom line: don't mess up with birds]]> +Bottom line: don't mess up with birds + +"That's a 'wonderful' shoe." + +“That’s a ‘magic’ sock.”]]> 173 2012-02-16 15:52:55 diff -Nru pelican-3.7.1+dfsg/pelican/tests/cyclic_intersite_links/first-article.rst pelican-4.0.1+dfsg/pelican/tests/cyclic_intersite_links/first-article.rst --- pelican-3.7.1+dfsg/pelican/tests/cyclic_intersite_links/first-article.rst 1970-01-01 00:00:00.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/cyclic_intersite_links/first-article.rst 2018-11-30 16:31:43.000000000 +0000 @@ -0,0 +1,7 @@ +First article +############# + +:date: 2018-11-10 +:summary: Here's the `second <{filename}/second-article.rst>`_, + `third <{filename}/third-article.rst>`_ and a + `nonexistent article <{filename}/nonexistent.rst>`_. diff -Nru pelican-3.7.1+dfsg/pelican/tests/cyclic_intersite_links/second-article.rst pelican-4.0.1+dfsg/pelican/tests/cyclic_intersite_links/second-article.rst --- pelican-3.7.1+dfsg/pelican/tests/cyclic_intersite_links/second-article.rst 1970-01-01 00:00:00.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/cyclic_intersite_links/second-article.rst 2018-11-30 16:31:43.000000000 +0000 @@ -0,0 +1,7 @@ +Second article +############## + +:date: 2018-11-10 +:summary: Here's the `first <{filename}/first-article.rst>`_, + `third <{filename}/third-article.rst>`_ and a + `nonexistent article <{filename}/nonexistent.rst>`_. diff -Nru pelican-3.7.1+dfsg/pelican/tests/cyclic_intersite_links/third-article.rst pelican-4.0.1+dfsg/pelican/tests/cyclic_intersite_links/third-article.rst --- pelican-3.7.1+dfsg/pelican/tests/cyclic_intersite_links/third-article.rst 1970-01-01 00:00:00.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/cyclic_intersite_links/third-article.rst 2018-11-30 16:31:43.000000000 +0000 @@ -0,0 +1,7 @@ +Third article +############# + +:date: 2018-11-10 +:summary: Here's the `first <{filename}/first-article.rst>`_, + `second <{filename}/second-article.rst>`_ and a + `nonexistent article <{filename}/nonexistent.rst>`_. diff -Nru pelican-3.7.1+dfsg/pelican/tests/default_conf.py pelican-4.0.1+dfsg/pelican/tests/default_conf.py --- pelican-3.7.1+dfsg/pelican/tests/default_conf.py 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/default_conf.py 2018-11-30 16:31:43.000000000 +0000 @@ -12,7 +12,7 @@ DEFAULT_PAGINATION = 2 FEED_RSS = 'feeds/all.rss.xml' -CATEGORY_FEED_RSS = 'feeds/%s.rss.xml' +CATEGORY_FEED_RSS = 'feeds/{slug}.rss.xml' LINKS = (('Biologeek', 'http://biologeek.org'), ('Filyb', "http://filyb.info/"), diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/a-markdown-powered-article.html pelican-4.0.1+dfsg/pelican/tests/output/basic/a-markdown-powered-article.html --- pelican-3.7.1+dfsg/pelican/tests/output/basic/a-markdown-powered-article.html 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/a-markdown-powered-article.html 2018-11-30 16:31:43.000000000 +0000 @@ -5,10 +5,6 @@ A markdown powered article - - diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/archives.html pelican-4.0.1+dfsg/pelican/tests/output/basic/archives.html --- pelican-3.7.1+dfsg/pelican/tests/output/basic/archives.html 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/archives.html 2018-11-30 16:31:43.000000000 +0000 @@ -5,10 +5,6 @@ A Pelican Blog - - diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/article-1.html pelican-4.0.1+dfsg/pelican/tests/output/basic/article-1.html --- pelican-3.7.1+dfsg/pelican/tests/output/basic/article-1.html 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/article-1.html 2018-11-30 16:31:43.000000000 +0000 @@ -5,10 +5,6 @@ Article 1 - - diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/article-2.html pelican-4.0.1+dfsg/pelican/tests/output/basic/article-2.html --- pelican-3.7.1+dfsg/pelican/tests/output/basic/article-2.html 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/article-2.html 2018-11-30 16:31:43.000000000 +0000 @@ -5,10 +5,6 @@ Article 2 - - diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/article-3.html pelican-4.0.1+dfsg/pelican/tests/output/basic/article-3.html --- pelican-3.7.1+dfsg/pelican/tests/output/basic/article-3.html 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/article-3.html 2018-11-30 16:31:43.000000000 +0000 @@ -5,10 +5,6 @@ Article 3 - - diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/author/alexis-metaireau.html pelican-4.0.1+dfsg/pelican/tests/output/basic/author/alexis-metaireau.html --- pelican-3.7.1+dfsg/pelican/tests/output/basic/author/alexis-metaireau.html 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/author/alexis-metaireau.html 2018-11-30 16:31:43.000000000 +0000 @@ -5,10 +5,6 @@ A Pelican Blog - Alexis Métaireau - - @@ -46,8 +42,8 @@

This is a simple title

And here comes the cool stuff.

-alternate text -alternate text +alternate text +alternate text
 >>> from ipdb import set_trace
 >>> set_trace()
@@ -82,7 +78,7 @@
 

Why not ?

After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !

-alternate text +alternate text
read more diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/authors.html pelican-4.0.1+dfsg/pelican/tests/output/basic/authors.html --- pelican-3.7.1+dfsg/pelican/tests/output/basic/authors.html 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/authors.html 2018-11-30 16:31:43.000000000 +0000 @@ -5,10 +5,6 @@ A Pelican Blog - Authors - - diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/categories.html pelican-4.0.1+dfsg/pelican/tests/output/basic/categories.html --- pelican-3.7.1+dfsg/pelican/tests/output/basic/categories.html 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/categories.html 2018-11-30 16:31:43.000000000 +0000 @@ -2,13 +2,9 @@ - A Pelican Blog + A Pelican Blog - Categories - - @@ -24,12 +20,13 @@
  • yeah
  • - +

    Categories on A Pelican Blog

    +
    diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/category/cat1.html pelican-4.0.1+dfsg/pelican/tests/output/basic/category/cat1.html --- pelican-3.7.1+dfsg/pelican/tests/output/basic/category/cat1.html 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/category/cat1.html 2018-11-30 16:31:43.000000000 +0000 @@ -5,10 +5,6 @@ A Pelican Blog - cat1 - - diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/category/misc.html pelican-4.0.1+dfsg/pelican/tests/output/basic/category/misc.html --- pelican-3.7.1+dfsg/pelican/tests/output/basic/category/misc.html 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/category/misc.html 2018-11-30 16:31:43.000000000 +0000 @@ -5,10 +5,6 @@ A Pelican Blog - misc - - @@ -57,7 +53,7 @@

    In misc.

    tags: foo bar baz

    Translations: - fr + fr

    This is some article, in english

    diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/category/yeah.html pelican-4.0.1+dfsg/pelican/tests/output/basic/category/yeah.html --- pelican-3.7.1+dfsg/pelican/tests/output/basic/category/yeah.html 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/category/yeah.html 2018-11-30 16:31:43.000000000 +0000 @@ -5,10 +5,6 @@ A Pelican Blog - yeah - - @@ -46,8 +42,8 @@

    This is a simple title

    And here comes the cool stuff.

    -alternate text -alternate text +alternate text +alternate text
     >>> from ipdb import set_trace
     >>> set_trace()
    diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/drafts/a-draft-article.html pelican-4.0.1+dfsg/pelican/tests/output/basic/drafts/a-draft-article.html
    --- pelican-3.7.1+dfsg/pelican/tests/output/basic/drafts/a-draft-article.html	1970-01-01 00:00:00.000000000 +0000
    +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/drafts/a-draft-article.html	2018-11-30 16:31:43.000000000 +0000
    @@ -0,0 +1,65 @@
    +
    +
    +
    +        
    +        A draft article
    +        
    +        
    +
    +
    +
    +        
    +
    +
    +
    +

    + A draft article

    +
    + +
    +
    + + Published: + + +

    In misc.

    + +

    This is a draft article, it should live under the /drafts/ folder and not be +listed anywhere else.

    + +
    + +
    +
    +
    + +
    + + + + + \ No newline at end of file diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/feeds/alexis-metaireau.atom.xml pelican-4.0.1+dfsg/pelican/tests/output/basic/feeds/alexis-metaireau.atom.xml --- pelican-3.7.1+dfsg/pelican/tests/output/basic/feeds/alexis-metaireau.atom.xml 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/feeds/alexis-metaireau.atom.xml 2018-11-30 16:31:43.000000000 +0000 @@ -5,8 +5,8 @@ <div class="section" id="this-is-a-simple-title"> <h2>This is a simple title</h2> <p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> -<img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> -<img alt="alternate text" src="|filename|/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" /> <pre class="literal-block"> &gt;&gt;&gt; from ipdb import set_trace &gt;&gt;&gt; set_trace() @@ -17,12 +17,12 @@ <h2>Why not ?</h2> <p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !</p> -<img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> </div> <div class="section" id="why-not"> <h2>Why not ?</h2> <p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !</p> -<img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> </div> \ No newline at end of file diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/feeds/alexis-metaireau.rss.xml pelican-4.0.1+dfsg/pelican/tests/output/basic/feeds/alexis-metaireau.rss.xml --- pelican-3.7.1+dfsg/pelican/tests/output/basic/feeds/alexis-metaireau.rss.xml 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/feeds/alexis-metaireau.rss.xml 2018-11-30 16:31:43.000000000 +0000 @@ -5,6 +5,6 @@ <h2>Why not ?</h2> <p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !</p> -<img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> </div> Alexis MétaireauWed, 20 Oct 2010 10:14:00 +0000tag:None,2010-10-20:/oh-yeah.htmlohbaryeah \ No newline at end of file diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/feeds/all.atom.xml pelican-4.0.1+dfsg/pelican/tests/output/basic/feeds/all.atom.xml --- pelican-3.7.1+dfsg/pelican/tests/output/basic/feeds/all.atom.xml 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/feeds/all.atom.xml 2018-11-30 16:31:43.000000000 +0000 @@ -21,8 +21,8 @@ <div class="section" id="this-is-a-simple-title"> <h2>This is a simple title</h2> <p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> -<img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> -<img alt="alternate text" src="|filename|/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" /> <pre class="literal-block"> &gt;&gt;&gt; from ipdb import set_trace &gt;&gt;&gt; set_trace() @@ -33,13 +33,13 @@ <h2>Why not ?</h2> <p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !</p> -<img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> </div> <div class="section" id="why-not"> <h2>Why not ?</h2> <p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !</p> -<img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> </div> Unbelievable !2010-10-15T20:30:00+00:002010-10-15T20:30:00+00:00tag:None,2010-10-15:/unbelievable.html<p>Or completely awesome. Depends the needs.</p> <p><a class="reference external" href="/a-markdown-powered-article.html">a root-relative link to markdown-article</a> diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/feeds/all-en.atom.xml pelican-4.0.1+dfsg/pelican/tests/output/basic/feeds/all-en.atom.xml --- pelican-3.7.1+dfsg/pelican/tests/output/basic/feeds/all-en.atom.xml 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/feeds/all-en.atom.xml 2018-11-30 16:31:43.000000000 +0000 @@ -19,8 +19,8 @@ <div class="section" id="this-is-a-simple-title"> <h2>This is a simple title</h2> <p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> -<img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> -<img alt="alternate text" src="|filename|/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" /> <pre class="literal-block"> &gt;&gt;&gt; from ipdb import set_trace &gt;&gt;&gt; set_trace() @@ -31,13 +31,13 @@ <h2>Why not ?</h2> <p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !</p> -<img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> </div> <div class="section" id="why-not"> <h2>Why not ?</h2> <p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !</p> -<img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> </div> Unbelievable !2010-10-15T20:30:00+00:002010-10-15T20:30:00+00:00tag:None,2010-10-15:/unbelievable.html<p>Or completely awesome. Depends the needs.</p> <p><a class="reference external" href="/a-markdown-powered-article.html">a root-relative link to markdown-article</a> diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/feeds/bar.atom.xml pelican-4.0.1+dfsg/pelican/tests/output/basic/feeds/bar.atom.xml --- pelican-3.7.1+dfsg/pelican/tests/output/basic/feeds/bar.atom.xml 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/feeds/bar.atom.xml 2018-11-30 16:31:43.000000000 +0000 @@ -3,12 +3,12 @@ <h2>Why not ?</h2> <p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !</p> -<img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> </div> <div class="section" id="why-not"> <h2>Why not ?</h2> <p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !</p> -<img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> </div> \ No newline at end of file diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/feeds/yeah.atom.xml pelican-4.0.1+dfsg/pelican/tests/output/basic/feeds/yeah.atom.xml --- pelican-3.7.1+dfsg/pelican/tests/output/basic/feeds/yeah.atom.xml 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/feeds/yeah.atom.xml 2018-11-30 16:31:43.000000000 +0000 @@ -5,8 +5,8 @@ <div class="section" id="this-is-a-simple-title"> <h2>This is a simple title</h2> <p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> -<img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> -<img alt="alternate text" src="|filename|/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" /> <pre class="literal-block"> &gt;&gt;&gt; from ipdb import set_trace &gt;&gt;&gt; set_trace() diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/filename_metadata-example.html pelican-4.0.1+dfsg/pelican/tests/output/basic/filename_metadata-example.html --- pelican-3.7.1+dfsg/pelican/tests/output/basic/filename_metadata-example.html 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/filename_metadata-example.html 2018-11-30 16:31:43.000000000 +0000 @@ -5,10 +5,6 @@ FILENAME_METADATA example - - diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/index.html pelican-4.0.1+dfsg/pelican/tests/output/basic/index.html --- pelican-3.7.1+dfsg/pelican/tests/output/basic/index.html 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/index.html 2018-11-30 16:31:43.000000000 +0000 @@ -5,10 +5,6 @@ A Pelican Blog - - @@ -57,7 +53,7 @@

    In misc.

    tags: foo bar baz

    Translations: - fr + fr

    This is some article, in english

    @@ -195,7 +191,7 @@

    Why not ?

    After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !

    -alternate text +alternate text
    read more diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/oh-yeah.html pelican-4.0.1+dfsg/pelican/tests/output/basic/oh-yeah.html --- pelican-3.7.1+dfsg/pelican/tests/output/basic/oh-yeah.html 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/oh-yeah.html 2018-11-30 16:31:43.000000000 +0000 @@ -5,10 +5,6 @@ Oh yeah ! - - @@ -47,7 +43,7 @@

    Why not ?

    After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !

    -alternate text +alternate text diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/override/index.html pelican-4.0.1+dfsg/pelican/tests/output/basic/override/index.html --- pelican-3.7.1+dfsg/pelican/tests/output/basic/override/index.html 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/override/index.html 2018-11-30 16:31:43.000000000 +0000 @@ -5,10 +5,6 @@ Override url/save_as - - diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/pages/this-is-a-test-hidden-page.html pelican-4.0.1+dfsg/pelican/tests/output/basic/pages/this-is-a-test-hidden-page.html --- pelican-3.7.1+dfsg/pelican/tests/output/basic/pages/this-is-a-test-hidden-page.html 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/pages/this-is-a-test-hidden-page.html 2018-11-30 16:31:43.000000000 +0000 @@ -5,10 +5,6 @@ This is a test hidden page - - diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/pages/this-is-a-test-page.html pelican-4.0.1+dfsg/pelican/tests/output/basic/pages/this-is-a-test-page.html --- pelican-3.7.1+dfsg/pelican/tests/output/basic/pages/this-is-a-test-page.html 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/pages/this-is-a-test-page.html 2018-11-30 16:31:43.000000000 +0000 @@ -5,10 +5,6 @@ This is a test page - - Binary files /tmp/tmpTOs8nQ/oV_jHM2uQd/pelican-3.7.1+dfsg/pelican/tests/output/basic/pictures/Sushi.jpg and /tmp/tmpTOs8nQ/VbdhRKwjVP/pelican-4.0.1+dfsg/pelican/tests/output/basic/pictures/Sushi.jpg differ Binary files /tmp/tmpTOs8nQ/oV_jHM2uQd/pelican-3.7.1+dfsg/pelican/tests/output/basic/pictures/Sushi_Macro.jpg and /tmp/tmpTOs8nQ/VbdhRKwjVP/pelican-4.0.1+dfsg/pelican/tests/output/basic/pictures/Sushi_Macro.jpg differ diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/second-article-fr.html pelican-4.0.1+dfsg/pelican/tests/output/basic/second-article-fr.html --- pelican-3.7.1+dfsg/pelican/tests/output/basic/second-article-fr.html 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/second-article-fr.html 2018-11-30 16:31:43.000000000 +0000 @@ -1,14 +1,12 @@ - + Deuxième article + - @@ -40,7 +38,7 @@

    In misc.

    tags: foo bar baz

    Translations: - en + en

    Ceci est un article, en français.

    diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/second-article.html pelican-4.0.1+dfsg/pelican/tests/output/basic/second-article.html --- pelican-3.7.1+dfsg/pelican/tests/output/basic/second-article.html 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/second-article.html 2018-11-30 16:31:43.000000000 +0000 @@ -5,10 +5,8 @@ Second article + - @@ -40,7 +38,7 @@

    In misc.

    tags: foo bar baz

    Translations: - fr + fr

    This is some article, in english

    diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/tag/bar.html pelican-4.0.1+dfsg/pelican/tests/output/basic/tag/bar.html --- pelican-3.7.1+dfsg/pelican/tests/output/basic/tag/bar.html 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/tag/bar.html 2018-11-30 16:31:43.000000000 +0000 @@ -5,10 +5,6 @@ A Pelican Blog - bar - - @@ -35,7 +31,7 @@

    In misc.

    tags: foo bar baz

    Translations: - fr + fr

    This is some article, in english

    @@ -94,7 +90,7 @@

    Why not ?

    After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !

    -alternate text +alternate text read more diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/tag/baz.html pelican-4.0.1+dfsg/pelican/tests/output/basic/tag/baz.html --- pelican-3.7.1+dfsg/pelican/tests/output/basic/tag/baz.html 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/tag/baz.html 2018-11-30 16:31:43.000000000 +0000 @@ -5,10 +5,6 @@ The baz tag - - diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/tag/foobar.html pelican-4.0.1+dfsg/pelican/tests/output/basic/tag/foobar.html --- pelican-3.7.1+dfsg/pelican/tests/output/basic/tag/foobar.html 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/tag/foobar.html 2018-11-30 16:31:43.000000000 +0000 @@ -5,10 +5,6 @@ A Pelican Blog - foobar - - @@ -46,8 +42,8 @@

    This is a simple title

    And here comes the cool stuff.

    -alternate text -alternate text +alternate text +alternate text
     >>> from ipdb import set_trace
     >>> set_trace()
    diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/tag/foo.html pelican-4.0.1+dfsg/pelican/tests/output/basic/tag/foo.html
    --- pelican-3.7.1+dfsg/pelican/tests/output/basic/tag/foo.html	2017-01-10 21:34:09.000000000 +0000
    +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/tag/foo.html	2018-11-30 16:31:43.000000000 +0000
    @@ -5,10 +5,6 @@
             A Pelican Blog - foo
             
             
    -
    -        
     
     
     
    @@ -35,7 +31,7 @@
     
     

    In misc.

    tags: foo bar baz

    Translations: - fr + fr

    This is some article, in english

    diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/tag/oh.html pelican-4.0.1+dfsg/pelican/tests/output/basic/tag/oh.html --- pelican-3.7.1+dfsg/pelican/tests/output/basic/tag/oh.html 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/tag/oh.html 2018-11-30 16:31:43.000000000 +0000 @@ -5,10 +5,6 @@ Oh Oh Oh - - diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/tag/yeah.html pelican-4.0.1+dfsg/pelican/tests/output/basic/tag/yeah.html --- pelican-3.7.1+dfsg/pelican/tests/output/basic/tag/yeah.html 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/tag/yeah.html 2018-11-30 16:31:43.000000000 +0000 @@ -5,10 +5,6 @@ A Pelican Blog - yeah - - @@ -42,7 +38,7 @@

    Why not ?

    After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !

    -alternate text +alternate text
    diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/tags.html pelican-4.0.1+dfsg/pelican/tests/output/basic/tags.html --- pelican-3.7.1+dfsg/pelican/tests/output/basic/tags.html 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/tags.html 2018-11-30 16:31:43.000000000 +0000 @@ -5,10 +5,6 @@ A Pelican Blog - Tags - - diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/css/fonts.css pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/css/fonts.css --- pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/css/fonts.css 1970-01-01 00:00:00.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/css/fonts.css 2018-11-30 16:31:43.000000000 +0000 @@ -0,0 +1,12 @@ +@font-face { + font-family: 'Yanone Kaffeesatz'; + font-style: normal; + font-weight: 400; + src: + local('Yanone Kaffeesatz Regular'), + local('YanoneKaffeesatz-Regular'), + /* from https://fonts.gstatic.com/s/yanonekaffeesatz/v8/YDAoLskQQ5MOAgvHUQCcLRTHiN2BPBirwIkMLKUspj4.woff */ + url('../fonts/Yanone_Kaffeesatz_400.woff') format('woff'), + /* from https://fonts.gstatic.com/s/yanonekaffeesatz/v8/YDAoLskQQ5MOAgvHUQCcLfGwxTS8d1Q9KiDNCMKLFUM.woff2 */ + url('../fonts/Yanone_Kaffeesatz_400.woff2') format('woff2'); +} diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/css/main.css pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/css/main.css --- pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/css/main.css 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/css/main.css 2018-11-30 16:31:43.000000000 +0000 @@ -12,7 +12,7 @@ @import url("reset.css"); @import url("pygment.css"); @import url("typogrify.css"); -@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz&subset=latin); +@import url("fonts.css"); /***** Global *****/ /* Body */ @@ -43,7 +43,7 @@ } h3, h4, h5, h6 { margin-top: .8em; } - + hr { border: 2px solid #EEEEEE; } /* Anchors */ @@ -64,7 +64,7 @@ h1 a:hover { background-color: inherit } - + /* Paragraphs */ div.line-block, p { margin-top: 1em; @@ -124,7 +124,7 @@ /* Tables */ table {margin: .5em auto 1.5em auto; width: 98%;} - + /* Thead */ thead th {padding: .5em .4em; text-align: left;} thead td {} @@ -132,14 +132,14 @@ /* Tbody */ tbody td {padding: .5em .4em;} tbody th {} - + tbody .alt td {} tbody .alt th {} - + /* Tfoot */ tfoot th {} tfoot td {} - + /* HTML5 tags */ header, section, footer, aside, nav, article, figure { @@ -173,9 +173,9 @@ color: #C74350; text-shadow: none; } - + #banner h1 strong {font-size: 0.36em; font-weight: normal;} - + /* Main Nav */ #banner nav { background: #000305; @@ -186,15 +186,15 @@ padding: 0; text-align: center; width: 800px; - + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; } - + #banner nav ul {list-style: none; margin: 0 auto; width: 800px;} #banner nav li {float: left; display: inline; margin: 0;} - + #banner nav a:link, #banner nav a:visited { color: #fff; display: inline-block; @@ -208,12 +208,12 @@ color: #fff; text-shadow: none !important; } - + #banner nav li:first-child a { border-top-left-radius: 5px; -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; - + border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; @@ -228,7 +228,7 @@ overflow: hidden; padding: 20px; width: 760px; - + border-radius: 10px; -moz-border-radius: 10px; -webkit-border-radius: 10px; @@ -257,7 +257,7 @@ overflow: hidden; padding: 20px 20px; width: 760px; - + border-radius: 10px; -moz-border-radius: 10px; -webkit-border-radius: 10px; @@ -292,21 +292,21 @@ float: left; width: 615px; } - + #extras .blogroll li {float: left; margin: 0 20px 0 0; width: 185px;} - + /* Social */ #extras .social { float: right; width: 175px; } - + #extras div[class='social'] a { background-repeat: no-repeat; background-position: 3px 6px; padding-left: 25px; } - + /* Icons */ .social a[href*='about.me'] {background-image: url('../images/icons/aboutme.png');} .social a[href*='bitbucket.org'] {background-image: url('../images/icons/bitbucket.png');} @@ -346,7 +346,7 @@ padding: 20px; text-align: left; width: 760px; - + border-radius: 10px; -moz-border-radius: 10px; -webkit-border-radius: 10px; @@ -390,7 +390,7 @@ /* Blog Index */ #posts-list {list-style: none; margin: 0;} #posts-list .hentry {padding-left: 10px; position: relative;} - + #posts-list footer { left: 10px; position: relative; @@ -398,7 +398,7 @@ top: 0.5em; width: 190px; } - + /* About the Author */ #about-author { background: #f9f9f9; @@ -406,21 +406,21 @@ font-style: normal; margin: 2em 0; padding: 10px 20px 15px 20px; - + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; } - + #about-author strong { color: #C64350; clear: both; display: block; font-size: 1.429em; } - + #about-author .photo {border: 1px solid #ddd; float: left; margin: 5px 1em 0 0;} - + /* Comments */ #comments-list {list-style: none; margin: 0 1em;} #comments-list blockquote { @@ -429,24 +429,24 @@ font-style: normal; margin: 0; padding: 15px 20px; - + border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; } #comments-list footer {color: #888; padding: .5em 1em 0 0; text-align: right;} - + #comments-list li:nth-child(2n) blockquote {background: #F5f5f5;} - + /* Add a Comment */ #add-comment label {clear: left; float: left; text-align: left; width: 150px;} #add-comment input[type='text'], #add-comment input[type='email'], #add-comment input[type='url'] {float: left; width: 200px;} - + #add-comment textarea {float: left; height: 150px; width: 495px;} - + #add-comment p.req {clear: both; margin: 0 .5em 1em 0; text-align: right;} - + #add-comment input[type='submit'] {float: right; margin: 0 .5em;} #add-comment * {margin-bottom: .5em;} diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/css/typogrify.css pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/css/typogrify.css --- pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/css/typogrify.css 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/css/typogrify.css 2018-11-30 16:31:43.000000000 +0000 @@ -1,3 +1,3 @@ .caps {font-size:.92em;} -.amp {color:#666; font-size:1.05em;font-family:"Warnock Pro", "Goudy Old Style","Palatino","Book Antiqua",serif; font-style:italic;} +.amp {color:#666; font-size:1.05em;font-family:"Warnock Pro", "Goudy Old Style","Palatino","Book Antiqua",serif; font-style:italic;} .dquo {margin-left:-.38em;} diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/fonts/font.css pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/fonts/font.css --- pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/fonts/font.css 1970-01-01 00:00:00.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/fonts/font.css 2018-11-30 16:31:43.000000000 +0000 @@ -0,0 +1,12 @@ +@font-face { + font-family: 'Yanone Kaffeesatz'; + font-style: normal; + font-weight: 400; + src: + local('Yanone Kaffeesatz Regular'), + local('YanoneKaffeesatz-Regular'), + /* from https://fonts.gstatic.com/s/yanonekaffeesatz/v8/YDAoLskQQ5MOAgvHUQCcLRTHiN2BPBirwIkMLKUspj4.woff */ + url('Yanone_Kaffeesatz_400.woff') format('woff'), + /* from https://fonts.gstatic.com/s/yanonekaffeesatz/v8/YDAoLskQQ5MOAgvHUQCcLfGwxTS8d1Q9KiDNCMKLFUM.woff2 */ + url('Yanone_Kaffeesatz_400.woff2') format('woff2'); +} Binary files /tmp/tmpTOs8nQ/oV_jHM2uQd/pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/fonts/Yanone_Kaffeesatz_400.eot and /tmp/tmpTOs8nQ/VbdhRKwjVP/pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/fonts/Yanone_Kaffeesatz_400.eot differ diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/fonts/Yanone_Kaffeesatz_400.svg pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/fonts/Yanone_Kaffeesatz_400.svg --- pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/fonts/Yanone_Kaffeesatz_400.svg 1970-01-01 00:00:00.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/fonts/Yanone_Kaffeesatz_400.svg 2018-11-30 16:31:43.000000000 +0000 @@ -0,0 +1,407 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Binary files /tmp/tmpTOs8nQ/oV_jHM2uQd/pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/fonts/Yanone_Kaffeesatz_400.ttf and /tmp/tmpTOs8nQ/VbdhRKwjVP/pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/fonts/Yanone_Kaffeesatz_400.ttf differ Binary files /tmp/tmpTOs8nQ/oV_jHM2uQd/pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/fonts/Yanone_Kaffeesatz_400.woff and /tmp/tmpTOs8nQ/VbdhRKwjVP/pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/fonts/Yanone_Kaffeesatz_400.woff differ Binary files /tmp/tmpTOs8nQ/oV_jHM2uQd/pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/fonts/Yanone_Kaffeesatz_400.woff2 and /tmp/tmpTOs8nQ/VbdhRKwjVP/pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/fonts/Yanone_Kaffeesatz_400.woff2 differ Binary files /tmp/tmpTOs8nQ/oV_jHM2uQd/pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/images/icons/aboutme.png and /tmp/tmpTOs8nQ/VbdhRKwjVP/pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/images/icons/aboutme.png differ Binary files /tmp/tmpTOs8nQ/oV_jHM2uQd/pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/images/icons/bitbucket.png and /tmp/tmpTOs8nQ/VbdhRKwjVP/pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/images/icons/bitbucket.png differ Binary files /tmp/tmpTOs8nQ/oV_jHM2uQd/pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/images/icons/delicious.png and /tmp/tmpTOs8nQ/VbdhRKwjVP/pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/images/icons/delicious.png differ Binary files /tmp/tmpTOs8nQ/oV_jHM2uQd/pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/images/icons/facebook.png and /tmp/tmpTOs8nQ/VbdhRKwjVP/pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/images/icons/facebook.png differ Binary files /tmp/tmpTOs8nQ/oV_jHM2uQd/pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/images/icons/github.png and /tmp/tmpTOs8nQ/VbdhRKwjVP/pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/images/icons/github.png differ Binary files /tmp/tmpTOs8nQ/oV_jHM2uQd/pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/images/icons/gitorious.png and /tmp/tmpTOs8nQ/VbdhRKwjVP/pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/images/icons/gitorious.png differ Binary files /tmp/tmpTOs8nQ/oV_jHM2uQd/pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/images/icons/gittip.png and /tmp/tmpTOs8nQ/VbdhRKwjVP/pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/images/icons/gittip.png differ Binary files /tmp/tmpTOs8nQ/oV_jHM2uQd/pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/images/icons/google-groups.png and /tmp/tmpTOs8nQ/VbdhRKwjVP/pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/images/icons/google-groups.png differ Binary files /tmp/tmpTOs8nQ/oV_jHM2uQd/pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/images/icons/google-plus.png and /tmp/tmpTOs8nQ/VbdhRKwjVP/pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/images/icons/google-plus.png differ Binary files /tmp/tmpTOs8nQ/oV_jHM2uQd/pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/images/icons/hackernews.png and /tmp/tmpTOs8nQ/VbdhRKwjVP/pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/images/icons/hackernews.png differ Binary files /tmp/tmpTOs8nQ/oV_jHM2uQd/pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/images/icons/lastfm.png and /tmp/tmpTOs8nQ/VbdhRKwjVP/pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/images/icons/lastfm.png differ Binary files /tmp/tmpTOs8nQ/oV_jHM2uQd/pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/images/icons/linkedin.png and /tmp/tmpTOs8nQ/VbdhRKwjVP/pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/images/icons/linkedin.png differ Binary files /tmp/tmpTOs8nQ/oV_jHM2uQd/pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/images/icons/reddit.png and /tmp/tmpTOs8nQ/VbdhRKwjVP/pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/images/icons/reddit.png differ Binary files /tmp/tmpTOs8nQ/oV_jHM2uQd/pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/images/icons/rss.png and /tmp/tmpTOs8nQ/VbdhRKwjVP/pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/images/icons/rss.png differ Binary files /tmp/tmpTOs8nQ/oV_jHM2uQd/pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/images/icons/slideshare.png and /tmp/tmpTOs8nQ/VbdhRKwjVP/pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/images/icons/slideshare.png differ Binary files /tmp/tmpTOs8nQ/oV_jHM2uQd/pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/images/icons/speakerdeck.png and /tmp/tmpTOs8nQ/VbdhRKwjVP/pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/images/icons/speakerdeck.png differ Binary files /tmp/tmpTOs8nQ/oV_jHM2uQd/pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/images/icons/stackoverflow.png and /tmp/tmpTOs8nQ/VbdhRKwjVP/pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/images/icons/stackoverflow.png differ Binary files /tmp/tmpTOs8nQ/oV_jHM2uQd/pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/images/icons/twitter.png and /tmp/tmpTOs8nQ/VbdhRKwjVP/pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/images/icons/twitter.png differ Binary files /tmp/tmpTOs8nQ/oV_jHM2uQd/pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/images/icons/vimeo.png and /tmp/tmpTOs8nQ/VbdhRKwjVP/pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/images/icons/vimeo.png differ Binary files /tmp/tmpTOs8nQ/oV_jHM2uQd/pelican-3.7.1+dfsg/pelican/tests/output/basic/theme/images/icons/youtube.png and /tmp/tmpTOs8nQ/VbdhRKwjVP/pelican-4.0.1+dfsg/pelican/tests/output/basic/theme/images/icons/youtube.png differ diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/this-is-a-super-article.html pelican-4.0.1+dfsg/pelican/tests/output/basic/this-is-a-super-article.html --- pelican-3.7.1+dfsg/pelican/tests/output/basic/this-is-a-super-article.html 2017-01-10 21:34:09.000000000 +0000 +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/this-is-a-super-article.html 2018-11-30 16:31:43.000000000 +0000 @@ -5,10 +5,6 @@ This is a super article ! - - @@ -51,8 +47,8 @@

    This is a simple title

    And here comes the cool stuff.

    -alternate text -alternate text +alternate text +alternate text
     >>> from ipdb import set_trace
     >>> set_trace()
    diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/basic/unbelievable.html pelican-4.0.1+dfsg/pelican/tests/output/basic/unbelievable.html
    --- pelican-3.7.1+dfsg/pelican/tests/output/basic/unbelievable.html	2017-01-10 21:34:09.000000000 +0000
    +++ pelican-4.0.1+dfsg/pelican/tests/output/basic/unbelievable.html	2018-11-30 16:31:43.000000000 +0000
    @@ -5,10 +5,6 @@
             Unbelievable !
             
             
    -
    -        
     
     
     
    diff -Nru pelican-3.7.1+dfsg/pelican/tests/output/custom/a-markdown-powered-article.html pelican-4.0.1+dfsg/pelican/tests/output/custom/a-markdown-powered-article.html
    --- pelican-3.7.1+dfsg/pelican/tests/output/custom/a-markdown-powered-article.html	2017-01-10 21:34:09.000000000 +0000
    +++ pelican-4.0.1+dfsg/pelican/tests/output/custom/a-markdown-powered-article.html	2018-11-30 16:31:43.000000000 +0000
    @@ -6,10 +6,6 @@
             
             
             
    -
    -        
     
     
     
    @@ -17,7 +13,7 @@
     Fork me on GitHub