mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge branch 'master' of https://github.com/getpelican/pelican
This commit is contained in:
commit
8a8424d565
153 changed files with 994 additions and 742 deletions
|
|
@ -4,7 +4,17 @@ Release history
|
|||
Next release
|
||||
============
|
||||
|
||||
- Nothing yet
|
||||
* ``SLUG_SUBSTITUTIONS`` now accepts 3-tuple elements, allowing to keep
|
||||
non-alphanum characters. Existing 2-tuple configurations will continue to work
|
||||
without change in behavior. The new 3rd parameter has side effects when there
|
||||
are multiple substitutions defined. Plese see the docs.
|
||||
* Tag and category slugs can be controlled with greater precision using the
|
||||
``TAG_SUBSTITUTIONS`` and ``CATEGORY_SUBSTITUTIONS`` settings. These also
|
||||
allow for keeping non-alphanum characters for backward compatibility with
|
||||
existing URLs.
|
||||
* Author slugs can be controlled with greater precision using the
|
||||
``AUTHOR_SUBSTITUTIONS`` setting. Keeping non-alphanum characters is supported
|
||||
as well but discouraged.
|
||||
|
||||
3.6.3 (2015-08-14)
|
||||
==================
|
||||
|
|
|
|||
|
|
@ -455,7 +455,13 @@ Option Valid values Description
|
|||
============= ============ =========================================
|
||||
anchorlinenos N/A If present wrap line numbers in <a> tags.
|
||||
classprefix string String to prepend to token class names
|
||||
hl_lines numbers List of lines to be highlighted.
|
||||
hl_lines numbers List of lines to be highlighted, where
|
||||
line numbers to highlight are separated
|
||||
by a space. This is similar to
|
||||
``emphasize-lines`` in Sphinx, but it
|
||||
does not support a range of line numbers
|
||||
separated by a hyphen, or comma-separated
|
||||
line numbers.
|
||||
lineanchors string Wrap each line in an anchor using this
|
||||
string and -linenumber.
|
||||
linenos string If present or set to "table" output line
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ To clone the Pelican source::
|
|||
To install the development dependencies::
|
||||
|
||||
$ cd src/pelican
|
||||
$ pip install -r dev_requirements.txt
|
||||
$ pip install -r requirements/developer.pip
|
||||
|
||||
To install Pelican and its dependencies::
|
||||
|
||||
|
|
@ -69,14 +69,15 @@ or bugfix.
|
|||
The tests live in ``pelican/tests`` and you can run them using the
|
||||
"discover" feature of ``unittest``::
|
||||
|
||||
$ python -m unittest discover
|
||||
$ python -Wd -m unittest discover
|
||||
|
||||
After making your changes and running the tests, you may see a test failure
|
||||
mentioning that "some generated files differ from the expected functional tests
|
||||
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, you can use 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/
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
Installing Pelican
|
||||
##################
|
||||
|
||||
Pelican currently runs best on Python 2.7.x; earlier versions of Python are
|
||||
not supported. There is provisional support for Python 3.3+, although there may
|
||||
be rough edges, particularly with regards to optional 3rd-party components.
|
||||
Pelican currently runs best on Python 2.7.x and 3.3+; earlier versions of
|
||||
Python are not supported.
|
||||
|
||||
You can install Pelican via several different methods. The simplest is via
|
||||
`pip <http://www.pip-installer.org/>`_::
|
||||
|
|
@ -23,7 +22,7 @@ session and create a new virtual environment for Pelican::
|
|||
source bin/activate
|
||||
|
||||
Once the virtual environment has been created and activated, Pelican can be
|
||||
be installed via ``pip install pelican`` as noted above. Alternatively, if
|
||||
installed via ``pip install pelican`` as noted above. Alternatively, if
|
||||
you have the project source, you can install Pelican using the distutils
|
||||
method::
|
||||
|
||||
|
|
@ -88,7 +87,7 @@ If you installed Pelican via distutils or the bleeding-edge method, simply
|
|||
perform the same step to install the most recent version.
|
||||
|
||||
Kickstart your site
|
||||
===================
|
||||
-------------------
|
||||
|
||||
Once Pelican has been installed, you can create a skeleton project via the
|
||||
``pelican-quickstart`` command, which begins by asking some questions about
|
||||
|
|
|
|||
|
|
@ -61,6 +61,8 @@ Setting name (followed by default value, if any)
|
|||
If ``'fs'``, Pelican will use the file system
|
||||
timestamp information (mtime) if it can't get
|
||||
date information from the metadata.
|
||||
If given any other string, it will be parsed by the same method
|
||||
as article metadata.
|
||||
If set to a tuple object, the default datetime object will instead
|
||||
be generated by passing the tuple to the
|
||||
``datetime.datetime`` constructor.
|
||||
|
|
@ -306,8 +308,14 @@ Setting name (followed by default value, if any) What does it do?
|
|||
``DAY_ARCHIVE_SAVE_AS = ''`` The location to save per-day archives of your posts.
|
||||
``SLUG_SUBSTITUTIONS = ()`` Substitutions to make prior to stripping out
|
||||
non-alphanumerics when generating slugs. Specified
|
||||
as a list of 2-tuples of ``(from, to)`` which are
|
||||
applied in order.
|
||||
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.
|
||||
``AUTHOR_SUBSTITUTIONS = ()`` Substitutions for authors. ``SLUG_SUBSTITUTIONS`` is not
|
||||
taken into account here!
|
||||
``CATEGORY_SUBSTITUTIONS = ()`` Added to ``SLUG_SUBSTITUTIONS`` for categories.
|
||||
``TAG_SUBSTITUTIONS = ()`` Added to ``SLUG_SUBSTITUTIONS`` for tags.
|
||||
====================================================== ==============================================================
|
||||
|
||||
.. note::
|
||||
|
|
@ -317,6 +325,20 @@ Setting name (followed by default value, if any) What does it do?
|
|||
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.
|
||||
|
|
@ -700,15 +722,18 @@ Following are example ways to specify your preferred theme::
|
|||
The built-in ``notmyidea`` theme can make good use of the following settings. Feel
|
||||
free to use them in your themes as well.
|
||||
|
||||
======================= =======================================================
|
||||
======================= =====================================================
|
||||
Setting name What does it do?
|
||||
======================= =======================================================
|
||||
======================= =====================================================
|
||||
``SITESUBTITLE`` A subtitle to appear in the header.
|
||||
``DISQUS_SITENAME`` Pelican can handle Disqus comments. Specify the
|
||||
Disqus sitename identifier here.
|
||||
``GITHUB_URL`` Your GitHub URL (if you have one). It will then
|
||||
use this information to create a GitHub ribbon.
|
||||
``GOOGLE_ANALYTICS`` Set to 'UA-XXXX-YYYY' to activate Google Analytics.
|
||||
``GOOGLE_ANALYTICS`` Set to ``UA-XXXXX-Y`` Property's tracking ID to
|
||||
activate Google Analytics.
|
||||
``GA_COOKIE_DOMAIN`` Set cookie domain field of Google Analytics tracking
|
||||
code. Defaults to ``auto``.
|
||||
``GOSQUARED_SITENAME`` Set to 'XXX-YYYYYY-X' to activate GoSquared.
|
||||
``MENUITEMS`` A list of tuples (Title, URL) for additional menu
|
||||
items to appear at the beginning of the main menu.
|
||||
|
|
@ -729,7 +754,7 @@ Setting name What does it do?
|
|||
If not specified, defaults to "links".
|
||||
``SOCIAL_WIDGET_NAME`` Allows override of the name of the "social" widget.
|
||||
If not specified, defaults to "social".
|
||||
======================= =======================================================
|
||||
======================= =====================================================
|
||||
|
||||
In addition, you can use the "wide" version of the ``notmyidea`` theme by
|
||||
adding the following to your configuration::
|
||||
|
|
@ -752,6 +777,18 @@ be filtered out.
|
|||
|
||||
For example: ``[(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')]``
|
||||
|
||||
**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.
|
||||
|
||||
Note: This option does nothing ``--debug`` is passed.
|
||||
|
||||
.. _reading_only_modified_content:
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ Custom 404 Pages
|
|||
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, such as this Markdown-formatted
|
||||
example::
|
||||
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
|
||||
Status: hidden
|
||||
|
|
@ -28,8 +28,8 @@ configuration file's ``location`` block::
|
|||
For Apache::
|
||||
|
||||
ErrorDocument 404 /404.html
|
||||
|
||||
For Amazon S3, first navigate to the ``Static Site Hosting`` menu in the
|
||||
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue