2010-12-14 15:31:11 +00:00
|
|
|
Settings
|
|
|
|
|
########
|
|
|
|
|
|
2011-05-08 16:15:43 +01:00
|
|
|
Pelican is configurable thanks to a configuration file you can pass to
|
2010-12-14 15:31:11 +00:00
|
|
|
the command line::
|
|
|
|
|
|
|
|
|
|
$ pelican -s path/to/your/settingsfile.py path
|
|
|
|
|
|
2012-03-06 06:13:17 -08:00
|
|
|
Settings are configured in the form of a Python module (a file). You can see an
|
2010-12-15 18:01:29 +00:00
|
|
|
example by looking at `/samples/pelican.conf.py
|
2012-07-27 00:27:08 +02:00
|
|
|
<https://github.com/getpelican/pelican/raw/master/samples/pelican.conf.py>`_
|
2010-12-15 18:01:29 +00:00
|
|
|
|
2012-03-06 06:13:17 -08:00
|
|
|
All the setting identifiers must be set in all-caps, otherwise they will not be
|
2012-07-31 11:51:38 -07:00
|
|
|
processed. Setting values that are numbers (5, 20, etc.), booleans (True,
|
|
|
|
|
False, None, etc.), dictionaries, or tuples should *not* be enclosed in
|
|
|
|
|
quotation marks. All other values (i.e., strings) *must* be enclosed in
|
|
|
|
|
quotation marks.
|
2010-12-15 18:14:54 +00:00
|
|
|
|
2012-12-03 16:31:55 -08:00
|
|
|
Unless otherwise specified, settings that refer to paths can be either absolute
|
|
|
|
|
or relative to the configuration file.
|
2012-09-11 09:27:26 -07:00
|
|
|
|
2011-05-08 16:15:43 +01:00
|
|
|
The settings you define in the configuration file will be passed to the
|
2012-03-06 06:13:17 -08:00
|
|
|
templates, which allows you to use your settings to add site-wide content.
|
2011-05-08 16:15:43 +01:00
|
|
|
|
2012-03-06 06:13:17 -08:00
|
|
|
Here is a list of settings for Pelican:
|
2010-12-14 15:31:11 +00:00
|
|
|
|
2011-05-08 16:15:43 +01:00
|
|
|
Basic settings
|
|
|
|
|
==============
|
2011-02-01 02:06:54 +00:00
|
|
|
|
2012-05-09 23:24:31 +01:00
|
|
|
===================================================================== =====================================================================
|
|
|
|
|
Setting name (default value) What does it do?
|
|
|
|
|
===================================================================== =====================================================================
|
|
|
|
|
`AUTHOR` Default author (put your name)
|
2012-12-03 16:31:55 -08:00
|
|
|
`DATE_FORMATS` (``{}``) If you manage multiple languages, you can set the date formatting
|
|
|
|
|
here. See the "Date format and locales" section below for details.
|
|
|
|
|
`USE_FOLDER_AS_CATEGORY` (``True``) When you don't specify a category in your post metadata, set this
|
|
|
|
|
setting to ``True``, and organize your articles in subfolders, the
|
|
|
|
|
subfolder will become the category of your post. If set to ``False``,
|
2012-09-23 10:04:51 +02:00
|
|
|
``DEFAULT_CATEGORY`` will be used as a fallback.
|
2012-05-09 23:24:31 +01:00
|
|
|
`DEFAULT_CATEGORY` (``'misc'``) The default category to fall back on.
|
|
|
|
|
`DEFAULT_DATE_FORMAT` (``'%a %d %B %Y'``) The default date format you want to use.
|
|
|
|
|
`DISPLAY_PAGES_ON_MENU` (``True``) Whether to display pages on the menu of the
|
2013-02-10 00:38:18 +02:00
|
|
|
template. Templates may or may not honor this
|
2013-04-01 21:52:30 +10:00
|
|
|
setting.
|
|
|
|
|
`DISPLAY_CATEGORIES_ON_MENU` (``True``) Whether to display categories on the menu of the
|
|
|
|
|
template. Templates may or not honor this
|
2012-05-09 23:24:31 +01:00
|
|
|
setting.
|
2012-11-24 00:26:46 +01:00
|
|
|
`DEFAULT_DATE` (``None``) The default date you want to use.
|
2012-12-03 16:31:55 -08:00
|
|
|
If ``fs``, Pelican will use the file system
|
2012-05-09 23:24:31 +01:00
|
|
|
timestamp information (mtime) if it can't get
|
|
|
|
|
date information from the metadata.
|
2012-12-03 16:31:55 -08:00
|
|
|
If set to a tuple object, the default datetime object will instead
|
|
|
|
|
be generated by passing the tuple to the
|
|
|
|
|
``datetime.datetime`` constructor.
|
2012-11-28 01:01:15 +01:00
|
|
|
`DEFAULT_METADATA` (``()``) The default metadata you want to use for all articles
|
|
|
|
|
and pages.
|
|
|
|
|
`FILENAME_METADATA` (``'(?P<date>\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 default value will only extract the date from
|
|
|
|
|
the filename.
|
|
|
|
|
For example, if you would like to extract both the
|
|
|
|
|
date and the slug, you could set something like:
|
2012-11-30 09:48:30 +01:00
|
|
|
``'(?P<date>\d{4}-\d{2}-\d{2})_(?P<slug>.*)'``.
|
2013-01-18 19:00:45 -05:00
|
|
|
See :ref:`path_metadata`.
|
2013-01-04 14:30:40 -05:00
|
|
|
`PATH_METADATA` (``''``) Like ``FILENAME_METADATA``, but parsed from a page's
|
|
|
|
|
full path relative to the content source directory.
|
2013-01-18 19:00:45 -05:00
|
|
|
See :ref:`path_metadata`.
|
2013-06-03 15:15:53 -04:00
|
|
|
`EXTRA_PATH_METADATA` (``{}``) Extra metadata dictionaries keyed by relative path.
|
2013-01-18 19:00:45 -05:00
|
|
|
See :ref:`path_metadata`.
|
2013-05-02 17:18:19 -07:00
|
|
|
`DELETE_OUTPUT_DIRECTORY` (``False``) Delete the output directory, and **all** of its contents, before
|
|
|
|
|
generating new files. This can be useful in preventing older,
|
|
|
|
|
unnecessary files from persisting in your output. However, **this is
|
|
|
|
|
a destructive setting and should be handled with extreme care.**
|
2013-06-23 11:44:53 -07:00
|
|
|
`OUTPUT_RETENTION` (``()``) A tuple of filenames that should be retained and not deleted from the
|
|
|
|
|
output directory. One use case would be the preservation of version
|
|
|
|
|
control data. For example: ``(".hg", ".git", ".bzr")``
|
2012-10-01 19:06:40 +03:00
|
|
|
`JINJA_EXTENSIONS` (``[]``) A list of any Jinja2 extensions you want to use.
|
2013-03-20 16:08:54 +01:00
|
|
|
`JINJA_FILTERS` (``{}``) A list of custom Jinja2 filters you want to use.
|
2013-03-20 21:21:47 +01:00
|
|
|
The dictionary should map the filtername to the filter function.
|
|
|
|
|
For example: ``{'urlencode': urlencode_filter}``
|
2013-03-19 13:05:03 +01:00
|
|
|
See `Jinja custom filters documentation`_.
|
2012-05-09 23:24:31 +01:00
|
|
|
`LOCALE` (''[#]_) Change the locale. A list of locales can be provided
|
|
|
|
|
here or a single string representing one locale.
|
|
|
|
|
When providing a list, all the locales will be tried
|
|
|
|
|
until one works.
|
2013-08-04 22:03:37 +02:00
|
|
|
`READERS` (``{}``) A dict of file extensions / Reader classes to overwrite or
|
|
|
|
|
add file readers. for instance, to avoid processing .html files:
|
|
|
|
|
``READERS = {'html': None}``. Or to add a custom reader for the
|
|
|
|
|
`foo` extension: ``READERS = {'foo': FooReader}``
|
2013-04-22 20:50:11 -04:00
|
|
|
`IGNORE_FILES` (``['.#*']``) A list of file globbing patterns to match against the
|
|
|
|
|
source files to be ignored by the processor. For example,
|
|
|
|
|
the default ``['.#*']`` will ignore emacs lock files.
|
2013-04-02 18:09:21 -04:00
|
|
|
`MD_EXTENSIONS` (``['codehilite(css_class=highlight)','extra']``) A list of the extensions that the Markdown processor
|
|
|
|
|
will use. Refer to the Python Markdown documentation's
|
|
|
|
|
`Extensions section <http://pythonhosted.org/Markdown/extensions/>`_
|
|
|
|
|
for a complete list of supported extensions. (Note that
|
|
|
|
|
defining this in your settings file will override and
|
|
|
|
|
replace the default values. If your goal is to *add*
|
|
|
|
|
to the default values for this setting, you'll need to
|
|
|
|
|
include them explicitly and enumerate the full list of
|
|
|
|
|
desired Markdown extensions.)
|
2012-05-09 23:24:31 +01:00
|
|
|
`OUTPUT_PATH` (``'output/'``) Where to output the generated files.
|
2012-09-11 09:27:26 -07:00
|
|
|
`PATH` (``None``) Path to content directory to be processed by Pelican.
|
|
|
|
|
`PAGE_DIR` (``'pages'``) Directory to look at for pages, relative to `PATH`.
|
2012-05-09 23:24:31 +01:00
|
|
|
`PAGE_EXCLUDES` (``()``) A list of directories to exclude when looking for pages.
|
2012-09-11 09:27:26 -07:00
|
|
|
`ARTICLE_DIR` (``''``) Directory to look at for articles, relative to `PATH`.
|
2012-05-09 23:24:31 +01:00
|
|
|
`ARTICLE_EXCLUDES`: (``('pages',)``) A list of directories to exclude when looking for articles.
|
2012-12-03 16:31:55 -08:00
|
|
|
`PDF_GENERATOR` (``False``) Set to ``True`` if you want PDF versions of your documents to be.
|
|
|
|
|
generated. You will need to install ``rst2pdf``.
|
2012-09-07 08:46:38 +02:00
|
|
|
`OUTPUT_SOURCES` (``False``) Set to True if you want to copy the articles and pages in their
|
2012-12-03 16:31:55 -08:00
|
|
|
original format (e.g. Markdown or reStructuredText) to the
|
2012-09-07 08:46:38 +02:00
|
|
|
specified OUTPUT_PATH.
|
2012-09-28 14:59:05 +02:00
|
|
|
`OUTPUT_SOURCES_EXTENSION` (``.text``) Controls the extension that will be used by the SourcesGenerator.
|
2012-10-03 22:06:45 +02:00
|
|
|
Defaults to ``.text``. If not a valid string the default value
|
|
|
|
|
will be used.
|
2013-04-11 12:15:18 -07:00
|
|
|
`RELATIVE_URLS` (``False``) Defines whether Pelican should use document-relative URLs or
|
|
|
|
|
not. Only set this to ``True`` when developing/testing and only
|
|
|
|
|
if you fully understand the effect it can have on links/feeds.
|
2012-06-10 01:14:30 +02:00
|
|
|
`PLUGINS` (``[]``) The list of plugins to load. See :ref:`plugins`.
|
2012-05-09 23:24:31 +01:00
|
|
|
`SITENAME` (``'A Pelican Blog'``) Your site name
|
|
|
|
|
`SITEURL` Base URL of your website. Not defined by default,
|
2012-07-07 07:41:12 -07:00
|
|
|
so it is best to specify your SITEURL; if you do not, feeds
|
2012-08-25 23:16:50 +02:00
|
|
|
will not be generated with properly-formed URLs. You should
|
2012-07-07 07:41:12 -07:00
|
|
|
include ``http://`` and your domain, with no trailing
|
|
|
|
|
slash at the end. Example: ``SITEURL = 'http://mydomain.com'``
|
2012-10-30 00:27:18 +01:00
|
|
|
`TEMPLATE_PAGES` (``None``) A mapping containing template pages that will be rendered with
|
|
|
|
|
the blog entries. See :ref:`template_pages`.
|
2012-05-09 23:24:31 +01:00
|
|
|
`STATIC_PATHS` (``['images']``) The static paths you want to have accessible
|
|
|
|
|
on the output path "static". By default,
|
2012-12-03 16:31:55 -08:00
|
|
|
Pelican will copy the "images" folder to the
|
2012-05-09 23:24:31 +01:00
|
|
|
output folder.
|
|
|
|
|
`TIMEZONE` The timezone used in the date information, to
|
2012-12-03 16:31:55 -08:00
|
|
|
generate Atom and RSS feeds. See the *Timezone*
|
2012-05-09 23:24:31 +01:00
|
|
|
section below for more info.
|
2012-08-01 18:20:12 -07:00
|
|
|
`TYPOGRIFY` (``False``) If set to True, several typographical improvements will be
|
|
|
|
|
incorporated into the generated HTML via the `Typogrify
|
2012-05-09 23:24:31 +01:00
|
|
|
<http://static.mintchaos.com/projects/typogrify/>`_
|
2012-08-01 18:20:12 -07:00
|
|
|
library, which can be installed via: ``pip install typogrify``
|
2012-05-09 23:24:31 +01:00
|
|
|
`DIRECT_TEMPLATES` (``('index', 'tags', 'categories', 'archives')``) List of templates that are used directly to render
|
|
|
|
|
content. Typically direct templates are used to generate
|
2013-06-28 19:59:00 -07:00
|
|
|
index pages for collections of content (e.g., tags and
|
|
|
|
|
category index pages). If the tag and category collections
|
|
|
|
|
are not needed, set ``DIRECT_TEMPLATES = ('index', 'archives')``
|
2012-05-09 23:24:31 +01:00
|
|
|
`PAGINATED_DIRECT_TEMPLATES` (``('index',)``) Provides the direct templates that should be paginated.
|
2012-08-25 23:16:50 +02:00
|
|
|
`SUMMARY_MAX_LENGTH` (``50``) When creating a short summary of an article, this will
|
2012-06-11 08:39:13 -04:00
|
|
|
be the default length in words of the text created.
|
2012-08-25 23:16:50 +02:00
|
|
|
This only applies if your content does not otherwise
|
2012-12-03 16:31:55 -08:00
|
|
|
specify a summary. Setting to ``None`` will cause the summary
|
2012-06-11 08:39:13 -04:00
|
|
|
to be a copy of the original content.
|
2012-12-03 16:31:55 -08:00
|
|
|
`EXTRA_TEMPLATES_PATHS` (``[]``) A list of paths you want Jinja2 to search for templates.
|
2012-09-03 00:57:23 +01:00
|
|
|
Can be used to separate templates from the theme.
|
|
|
|
|
Example: projects, resume, profile ...
|
2012-12-03 16:31:55 -08:00
|
|
|
These templates need to use ``DIRECT_TEMPLATES`` setting.
|
|
|
|
|
`ASCIIDOC_OPTIONS` (``[]``) A list of options to pass to AsciiDoc. See the `manpage
|
2012-10-28 07:37:53 -07:00
|
|
|
<http://www.methods.co.nz/asciidoc/manpage.html>`_
|
2013-07-31 23:08:42 +01:00
|
|
|
`WITH_FUTURE_DATES` (``True``) If disabled, content with dates in the future will get a
|
|
|
|
|
default status of draft.
|
2013-09-01 01:01:25 +05:00
|
|
|
`INTRASITE_LINK_REGEX` (``'[{|](?P<what>.*?)[|}]'``) Regular expression that is used to parse internal links.
|
|
|
|
|
Default syntax of links to internal files, tags, etc. is
|
|
|
|
|
to enclose the identifier, say ``filename``, in ``{}`` or ``||``.
|
|
|
|
|
Identifier between ``{`` and ``}`` goes into the ``what`` capturing group.
|
|
|
|
|
For details see :ref:`ref-linking-to-internal-content`.
|
2012-05-09 23:24:31 +01:00
|
|
|
===================================================================== =====================================================================
|
2011-04-25 00:33:55 +02:00
|
|
|
|
2012-03-06 06:13:17 -08:00
|
|
|
.. [#] Default is the system locale.
|
|
|
|
|
|
2011-04-25 00:33:55 +02:00
|
|
|
|
2012-03-18 14:57:53 +08:00
|
|
|
URL settings
|
2011-12-23 22:01:32 +00:00
|
|
|
------------
|
2012-03-06 06:13:17 -08:00
|
|
|
|
2012-07-07 07:41:12 -07:00
|
|
|
The first thing to understand is that there are currently two supported methods
|
|
|
|
|
for URL formation: *relative* and *absolute*. Document-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 at the top of
|
2012-12-03 16:31:55 -08:00
|
|
|
the :doc:`Getting Started <getting_started>` page, which will produce two separate
|
2012-07-07 07:41:12 -07:00
|
|
|
configuration files for local development and publishing, respectively.
|
|
|
|
|
|
2012-03-16 20:27:26 -07:00
|
|
|
You can customize the URLs and locations where files will be saved. The URLs and
|
|
|
|
|
SAVE_AS variables use Python's format strings. These variables allow you to place
|
2012-12-03 16:31:55 -08:00
|
|
|
your articles in a location such as ``{slug}/index.html`` and link to them as
|
|
|
|
|
``{slug}`` for clean URLs. These settings give you the flexibility to place your
|
2011-12-23 22:01:32 +00:00
|
|
|
articles and pages anywhere you want.
|
2011-08-18 13:47:31 +02:00
|
|
|
|
2012-05-09 23:24:31 +01:00
|
|
|
.. note::
|
2012-04-28 18:02:10 +01:00
|
|
|
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.
|
2011-08-18 13:47:31 +02:00
|
|
|
|
2012-03-06 06:13:17 -08:00
|
|
|
Check the Python datetime documentation at http://bit.ly/cNcJUC for more
|
2011-08-18 13:47:31 +02:00
|
|
|
information.
|
|
|
|
|
|
2012-04-28 18:02:10 +01:00
|
|
|
Also, you can use other file metadata attributes as well:
|
2011-08-18 13:47:31 +02:00
|
|
|
|
2011-12-23 22:01:32 +00:00
|
|
|
* slug
|
|
|
|
|
* date
|
|
|
|
|
* lang
|
|
|
|
|
* author
|
|
|
|
|
* category
|
2011-08-18 13:47:31 +02:00
|
|
|
|
2012-04-28 18:02:10 +01:00
|
|
|
Example usage:
|
2011-08-18 13:47:31 +02:00
|
|
|
|
2012-10-01 17:54:20 +03:00
|
|
|
* ARTICLE_URL = ``'posts/{date:%Y}/{date:%b}/{date:%d}/{slug}/'``
|
|
|
|
|
* ARTICLE_SAVE_AS = ``'posts/{date:%Y}/{date:%b}/{date:%d}/{slug}/index.html'``
|
2011-12-23 22:01:32 +00:00
|
|
|
|
2012-12-03 16:31:55 -08:00
|
|
|
This would save your articles in something like ``/posts/2011/Aug/07/sample-post/index.html``,
|
|
|
|
|
and the URL to this would be ``/posts/2011/Aug/07/sample-post/``.
|
2011-12-23 22:01:32 +00:00
|
|
|
|
2013-03-09 21:01:47 -08:00
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
Example usage:
|
|
|
|
|
|
|
|
|
|
* YEAR_ARCHIVE_SAVE_AS = ``'posts/{date:%Y}/index.html'``
|
|
|
|
|
* MONTH_ARCHIVE_SAVE_AS = ``'posts/{date:%Y}/{date:%b}/index.html'``
|
|
|
|
|
|
|
|
|
|
With these settings, Pelican will create an archive of all your posts for the year
|
|
|
|
|
at (for instance) 'posts/2011/index.html', and an archive of all your posts for
|
|
|
|
|
the month at 'posts/2011/Aug/index.html'.
|
|
|
|
|
|
|
|
|
|
.. 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.
|
|
|
|
|
|
2012-10-01 17:54:20 +03:00
|
|
|
==================================================== =====================================================
|
|
|
|
|
Setting name (default value) What does it do?
|
|
|
|
|
==================================================== =====================================================
|
|
|
|
|
`ARTICLE_URL` (``'{slug}.html'``) The URL to refer to an ARTICLE.
|
|
|
|
|
`ARTICLE_SAVE_AS` (``'{slug}.html'``) The place where we will save an article.
|
|
|
|
|
`ARTICLE_LANG_URL` (``'{slug}-{lang}.html'``) The URL to refer to an ARTICLE which doesn't use the
|
|
|
|
|
default language.
|
|
|
|
|
`ARTICLE_LANG_SAVE_AS` (``'{slug}-{lang}.html'``) The place where we will save an article which
|
|
|
|
|
doesn't use the default language.
|
|
|
|
|
`PAGE_URL` (``'pages/{slug}.html'``) The URL we will use to link to a page.
|
2013-03-10 14:34:17 +01:00
|
|
|
`PAGE_SAVE_AS` (``'pages/{slug}.html'``) The location we will save the page. This value has to be
|
|
|
|
|
the same as PAGE_URL or you need to use a rewrite in
|
|
|
|
|
your server config.
|
2012-10-01 17:54:20 +03:00
|
|
|
`PAGE_LANG_URL` (``'pages/{slug}-{lang}.html'``) The URL we will use to link to a page which doesn't
|
|
|
|
|
use the default language.
|
|
|
|
|
`PAGE_LANG_SAVE_AS` (``'pages/{slug}-{lang}.html'``) The location we will save the page which doesn't
|
|
|
|
|
use the default language.
|
2012-11-13 01:46:43 +01:00
|
|
|
`CATEGORY_URL` (``'category/{slug}.html'``) The URL to use for a category.
|
|
|
|
|
`CATEGORY_SAVE_AS` (``'category/{slug}.html'``) The location to save a category.
|
2012-10-28 23:52:16 +01:00
|
|
|
`TAG_URL` (``'tag/{slug}.html'``) The URL to use for a tag.
|
|
|
|
|
`TAG_SAVE_AS` (``'tag/{slug}.html'``) The location to save the tag page.
|
2013-07-25 23:25:05 +02:00
|
|
|
`TAGS_URL` (``'tags.html'``) The URL to use for the tag list.
|
2013-06-28 00:53:26 +02:00
|
|
|
`TAGS_SAVE_AS` (``'tags.html'``) The location to save the tag list.
|
|
|
|
|
`AUTHOR_URL` (``'author/{slug}.html'``) The URL to use for an author.
|
|
|
|
|
`AUTHOR_SAVE_AS` (``'author/{slug}.html'``) The location to save an author.
|
|
|
|
|
`AUTHORS_URL` (``'authors.html'``) The URL to use for the author list.
|
|
|
|
|
`AUTHORS_SAVE_AS` (``'authors.html'``) The location to save the author list.
|
2012-10-01 17:54:20 +03:00
|
|
|
`<DIRECT_TEMPLATE_NAME>_SAVE_AS` The location to save content generated from direct
|
|
|
|
|
templates. Where <DIRECT_TEMPLATE_NAME> is the
|
|
|
|
|
upper case template name.
|
2013-06-10 19:42:53 -07:00
|
|
|
`ARCHIVES_SAVE_AS` (``'archives.html'``) The location to save the article archives page.
|
2013-03-09 21:01:47 -08:00
|
|
|
`YEAR_ARCHIVE_SAVE_AS` (False) The location to save per-year archives of your
|
|
|
|
|
posts.
|
|
|
|
|
`MONTH_ARCHIVE_SAVE_AS` (False) The location to save per-month archives of your
|
|
|
|
|
posts.
|
|
|
|
|
`DAY_ARCHIVE_SAVE_AS` (False) The location to save per-day archives of your
|
|
|
|
|
posts.
|
2013-06-14 15:54:06 +01:00
|
|
|
`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.
|
2012-10-01 17:54:20 +03:00
|
|
|
==================================================== =====================================================
|
2011-08-18 13:47:31 +02:00
|
|
|
|
2012-04-28 18:02:10 +01:00
|
|
|
.. note::
|
|
|
|
|
|
2013-06-28 19:59:00 -07:00
|
|
|
If you do not want one or more of the default pages to be created (e.g.,
|
|
|
|
|
you are the only author on your site and thus do not need an Authors page),
|
|
|
|
|
set the corresponding ``*_SAVE_AS`` setting to ``False`` to prevent the
|
|
|
|
|
relevant page from being generated.
|
2012-04-18 19:04:32 +11:00
|
|
|
|
2011-08-18 13:58:04 +02:00
|
|
|
Timezone
|
|
|
|
|
--------
|
|
|
|
|
|
2012-03-06 06:13:17 -08:00
|
|
|
If no timezone is defined, UTC is assumed. This means that the generated Atom
|
|
|
|
|
and RSS feeds will contain incorrect date information if your locale is not UTC.
|
2011-08-18 13:58:04 +02:00
|
|
|
|
|
|
|
|
Pelican issues a warning in case this setting is not defined, as it was not
|
2012-03-06 06:13:17 -08:00
|
|
|
mandatory in previous versions.
|
2011-08-18 13:58:04 +02:00
|
|
|
|
2012-03-06 06:13:17 -08:00
|
|
|
Have a look at `the wikipedia page`_ to get a list of valid timezone values.
|
2011-08-18 13:58:04 +02:00
|
|
|
|
|
|
|
|
.. _the wikipedia page: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
|
|
|
|
|
2012-02-28 03:08:39 +09:00
|
|
|
|
|
|
|
|
Date format and locale
|
|
|
|
|
----------------------
|
|
|
|
|
|
2013-04-16 10:13:47 -07:00
|
|
|
If no DATE_FORMATS are set, Pelican will fall back to DEFAULT_DATE_FORMAT. If
|
|
|
|
|
you need to maintain multiple languages with different date formats, you can
|
|
|
|
|
set this dict using the language name (``lang`` metadata in your post content)
|
|
|
|
|
as the key. Regarding available format codes, see `strftime document of python`_ :
|
2012-02-28 03:08:39 +09:00
|
|
|
|
2012-03-15 00:17:01 +00:00
|
|
|
.. parsed-literal::
|
|
|
|
|
|
2012-10-12 22:20:47 +02:00
|
|
|
DATE_FORMATS = {
|
2012-02-28 03:08:39 +09:00
|
|
|
'en': '%a, %d %b %Y',
|
|
|
|
|
'jp': '%Y-%m-%d(%a)',
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
You can set locale to further control date format:
|
|
|
|
|
|
2012-03-15 00:17:01 +00:00
|
|
|
.. parsed-literal::
|
|
|
|
|
|
2012-02-28 03:08:39 +09:00
|
|
|
LOCALE = ('usa', 'jpn', # On Windows
|
|
|
|
|
'en_US', 'ja_JP' # On Unix/Linux
|
|
|
|
|
)
|
|
|
|
|
|
2012-03-06 06:13:17 -08:00
|
|
|
Also, it is possible to set different locale settings for each language. If you
|
|
|
|
|
put (locale, format) tuples in the dict, this will override the LOCALE setting
|
2012-02-28 03:08:39 +09:00
|
|
|
above:
|
|
|
|
|
|
2012-03-15 00:17:01 +00:00
|
|
|
.. parsed-literal::
|
2012-02-28 03:08:39 +09:00
|
|
|
# On Unix/Linux
|
2012-10-12 22:20:47 +02:00
|
|
|
DATE_FORMATS = {
|
2012-02-28 03:08:39 +09:00
|
|
|
'en': ('en_US','%a, %d %b %Y'),
|
|
|
|
|
'jp': ('ja_JP','%Y-%m-%d(%a)'),
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# On Windows
|
2012-10-12 22:20:47 +02:00
|
|
|
DATE_FORMATS = {
|
2012-02-28 03:08:39 +09:00
|
|
|
'en': ('usa','%a, %d %b %Y'),
|
|
|
|
|
'jp': ('jpn','%Y-%m-%d(%a)'),
|
|
|
|
|
}
|
|
|
|
|
|
2012-03-06 06:13:17 -08:00
|
|
|
This is a list of available `locales on Windows`_ . On Unix/Linux, usually you
|
|
|
|
|
can get a list of available locales via the ``locale -a`` command; see manpage
|
|
|
|
|
`locale(1)`_ for more information.
|
2012-02-28 03:08:39 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
.. _strftime document of python: http://docs.python.org/library/datetime.html#strftime-strptime-behavior
|
|
|
|
|
|
|
|
|
|
.. _locales on Windows: http://msdn.microsoft.com/en-us/library/cdax410z%28VS.71%29.aspx
|
|
|
|
|
|
|
|
|
|
.. _locale(1): http://linux.die.net/man/1/locale
|
|
|
|
|
|
2012-03-18 09:59:12 +01:00
|
|
|
|
2012-10-30 00:27:18 +01:00
|
|
|
.. _template_pages:
|
2012-03-18 09:59:12 +01:00
|
|
|
|
2012-10-30 00:27:18 +01:00
|
|
|
Template pages
|
|
|
|
|
==============
|
2012-03-18 09:59:12 +01:00
|
|
|
|
2012-10-30 00:27:18 +01:00
|
|
|
If you want to generate custom pages besides your blog entries, you can point
|
2012-10-30 02:33:01 +01:00
|
|
|
any Jinja2 template file with a path pointing to the file and the destination
|
|
|
|
|
path for the generated file.
|
2012-03-18 09:59:12 +01:00
|
|
|
|
2012-12-03 16:31:55 -08:00
|
|
|
For instance, if you have a blog with three static pages — a list of books,
|
|
|
|
|
your resume, and a contact page — you could have::
|
2012-03-18 09:59:12 +01:00
|
|
|
|
2012-10-30 02:33:01 +01:00
|
|
|
TEMPLATE_PAGES = {'src/books.html': 'dest/books.html',
|
2012-12-03 16:31:55 -08:00
|
|
|
'src/resume.html': 'dest/resume.html',
|
|
|
|
|
'src/contact.html': 'dest/contact.html'}
|
2012-03-18 09:59:12 +01:00
|
|
|
|
2013-01-18 19:00:45 -05:00
|
|
|
|
|
|
|
|
.. _path_metadata:
|
|
|
|
|
|
|
|
|
|
Path metadata
|
|
|
|
|
=============
|
|
|
|
|
|
|
|
|
|
Not all metadata needs to be `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<name>…)``. 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::
|
|
|
|
|
|
|
|
|
|
EXTRA_PATH_METADATA = {
|
|
|
|
|
'relative/path/to/file-1': {
|
|
|
|
|
'key-1a': 'value-1a',
|
|
|
|
|
'key-1b': 'value-1b',
|
|
|
|
|
},
|
|
|
|
|
'relative/path/to/file-2': {
|
|
|
|
|
'key-2': 'value-2',
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
This can be a convenient way to shift the installed location of a
|
|
|
|
|
particular file:
|
|
|
|
|
|
|
|
|
|
.. parsed-literal::
|
|
|
|
|
|
|
|
|
|
# Take advantage of the following defaults
|
|
|
|
|
# STATIC_SAVE_AS = '{path}'
|
|
|
|
|
# STATIC_URL = '{path}'
|
|
|
|
|
STATIC_PATHS = [
|
|
|
|
|
'extra/robots.txt',
|
|
|
|
|
]
|
|
|
|
|
EXTRA_PATH_METADATA = {
|
|
|
|
|
'extra/robots.txt': {'path': 'robots.txt'},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
__ internal_metadata__
|
|
|
|
|
.. _group name notation:
|
|
|
|
|
http://docs.python.org/3/library/re.html#regular-expression-syntax
|
|
|
|
|
|
2011-05-08 16:15:43 +01:00
|
|
|
Feed settings
|
|
|
|
|
=============
|
2010-12-14 15:31:11 +00:00
|
|
|
|
2012-03-06 06:13:17 -08:00
|
|
|
By default, Pelican uses Atom feeds. However, it is also possible to use RSS
|
|
|
|
|
feeds if you prefer.
|
2011-02-22 11:35:06 +01:00
|
|
|
|
2011-05-11 11:10:14 +01:00
|
|
|
Pelican generates category feeds as well as feeds for all your articles. It does
|
2012-03-06 06:13:17 -08:00
|
|
|
not generate feeds for tags by default, but it is possible to do so using
|
2012-07-16 09:35:05 -07:00
|
|
|
the ``TAG_FEED_ATOM`` and ``TAG_FEED_RSS`` settings:
|
2011-05-11 11:10:14 +01:00
|
|
|
|
2011-05-08 16:15:43 +01:00
|
|
|
================================================ =====================================================
|
2012-03-06 06:13:17 -08:00
|
|
|
Setting name (default value) What does it do?
|
2011-05-08 16:15:43 +01:00
|
|
|
================================================ =====================================================
|
2012-03-16 20:27:26 -07:00
|
|
|
`FEED_DOMAIN` (``None``, i.e. base URL is "/") The domain prepended to feed URLs. Since feed URLs
|
|
|
|
|
should always be absolute, it is highly recommended
|
|
|
|
|
to define this (e.g., "http://feeds.example.com"). If
|
|
|
|
|
you have already explicitly defined SITEURL (see
|
|
|
|
|
above) and want to use the same domain for your
|
2012-11-12 23:44:12 +01:00
|
|
|
feeds, you can just set: ``FEED_DOMAIN = SITEURL``.
|
|
|
|
|
`FEED_ATOM` (``None``, i.e. no Atom feed) Relative URL to output the Atom feed.
|
2012-03-06 06:13:17 -08:00
|
|
|
`FEED_RSS` (``None``, i.e. no RSS) Relative URL to output the RSS feed.
|
2012-11-12 23:44:12 +01:00
|
|
|
`FEED_ALL_ATOM` (``'feeds/all.atom.xml'``) Relative URL to output the all posts Atom feed:
|
|
|
|
|
this feed will contain all posts regardless of their
|
|
|
|
|
language.
|
|
|
|
|
`FEED_ALL_RSS` (``None``, i.e. no all RSS) Relative URL to output the all posts RSS feed:
|
|
|
|
|
this feed will contain all posts regardless of their
|
|
|
|
|
language.
|
2012-07-16 09:35:05 -07:00
|
|
|
`CATEGORY_FEED_ATOM` ('feeds/%s.atom.xml'[2]_) Where to put the category Atom feeds.
|
2012-03-16 20:27:26 -07:00
|
|
|
`CATEGORY_FEED_RSS` (``None``, i.e. no RSS) Where to put the category RSS feeds.
|
2012-07-16 09:35:05 -07:00
|
|
|
`TAG_FEED_ATOM` (``None``, i.e. no tag feed) Relative URL to output the tag Atom feed. It should
|
2012-03-06 06:13:17 -08:00
|
|
|
be defined using a "%s" match in the tag name.
|
|
|
|
|
`TAG_FEED_RSS` (``None``, ie no RSS tag feed) Relative URL to output the tag RSS feed
|
|
|
|
|
`FEED_MAX_ITEMS` Maximum number of items allowed in a feed. Feed item
|
|
|
|
|
quantity is unrestricted by default.
|
2011-05-08 16:15:43 +01:00
|
|
|
================================================ =====================================================
|
2011-02-22 11:35:06 +01:00
|
|
|
|
2012-12-03 16:31:55 -08:00
|
|
|
If you don't want to generate some or any of these feeds, set the above variables to ``None``.
|
2012-03-10 21:18:01 +09:00
|
|
|
|
2011-05-08 16:15:43 +01:00
|
|
|
.. [2] %s is the name of the category.
|
2011-02-22 11:35:06 +01:00
|
|
|
|
2012-03-16 20:27:26 -07:00
|
|
|
FeedBurner
|
|
|
|
|
----------
|
|
|
|
|
|
2012-03-31 08:10:40 -07:00
|
|
|
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
|
2012-07-16 09:35:05 -07:00
|
|
|
purposes. In your Pelican settings, set the `FEED_ATOM` attribute to
|
2012-03-31 08:10:40 -07:00
|
|
|
"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).
|
|
|
|
|
|
|
|
|
|
There are two fields to configure in the `FeedBurner
|
|
|
|
|
<http://feedburner.google.com>`_ 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`.
|
2012-03-16 20:27:26 -07:00
|
|
|
|
2011-05-08 16:15:43 +01:00
|
|
|
Pagination
|
|
|
|
|
==========
|
2011-02-22 11:35:06 +01:00
|
|
|
|
2012-03-06 06:13:17 -08:00
|
|
|
The default behaviour of Pelican is to list all the article titles along
|
|
|
|
|
with a short description on the index page. While it works pretty well
|
|
|
|
|
for small-to-medium blogs, for sites with large quantity of articles it would
|
|
|
|
|
be convenient to have a way to paginate the list.
|
2011-02-22 11:35:06 +01:00
|
|
|
|
2011-05-08 16:15:43 +01:00
|
|
|
You can use the following settings to configure the pagination.
|
2011-02-22 11:35:06 +01:00
|
|
|
|
2011-05-08 16:15:43 +01:00
|
|
|
================================================ =====================================================
|
2012-03-06 06:13:17 -08:00
|
|
|
Setting name (default value) What does it do?
|
2011-05-08 16:15:43 +01:00
|
|
|
================================================ =====================================================
|
2012-10-01 17:54:20 +03:00
|
|
|
`DEFAULT_ORPHANS` (``0``) The minimum number of articles allowed on the
|
2011-05-08 16:15:43 +01:00
|
|
|
last page. Use this when you don't want to
|
|
|
|
|
have a last page with very few articles.
|
2012-10-01 17:54:20 +03:00
|
|
|
`DEFAULT_PAGINATION` (``False``) The maximum number of articles to include on a
|
2011-12-22 13:56:36 +00:00
|
|
|
page, not including orphans. False to disable
|
|
|
|
|
pagination.
|
2013-08-03 14:06:16 -07:00
|
|
|
`PAGINATION_PATTERNS` A set of patterns that are used to determine advanced
|
|
|
|
|
pagination output.
|
2011-05-08 16:15:43 +01:00
|
|
|
================================================ =====================================================
|
2011-02-22 11:35:06 +01:00
|
|
|
|
2013-08-03 14:06:16 -07:00
|
|
|
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::
|
|
|
|
|
|
|
|
|
|
PAGINATION_PATTERNS = (
|
|
|
|
|
(1, '{base_name}/', '{base_name}/index.html'),
|
|
|
|
|
(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.
|
|
|
|
|
|
2011-05-08 16:15:43 +01:00
|
|
|
Tag cloud
|
|
|
|
|
=========
|
2011-02-22 11:35:06 +01:00
|
|
|
|
2011-05-08 16:15:43 +01:00
|
|
|
If you want to generate a tag cloud with all your tags, you can do so using the
|
|
|
|
|
following settings.
|
2011-02-22 11:35:06 +01:00
|
|
|
|
2011-05-08 16:15:43 +01:00
|
|
|
================================================ =====================================================
|
2012-03-06 06:13:17 -08:00
|
|
|
Setting name (default value) What does it do?
|
2011-05-08 16:15:43 +01:00
|
|
|
================================================ =====================================================
|
2012-10-01 17:54:20 +03:00
|
|
|
`TAG_CLOUD_STEPS` (``4``) Count of different font sizes in the tag
|
2011-05-08 16:15:43 +01:00
|
|
|
cloud.
|
2012-10-01 17:54:20 +03:00
|
|
|
`TAG_CLOUD_MAX_ITEMS` (``100``) Maximum number of tags in the cloud.
|
2011-05-08 16:15:43 +01:00
|
|
|
================================================ =====================================================
|
2011-02-22 11:35:06 +01:00
|
|
|
|
2013-07-15 14:25:39 -07:00
|
|
|
The default theme does not include a tag cloud, but it is pretty easy to add::
|
2011-02-22 11:41:57 +01:00
|
|
|
|
2013-08-13 10:46:41 +01:00
|
|
|
<ul class="tagcloud">
|
2011-05-08 16:15:43 +01:00
|
|
|
{% for tag in tag_cloud %}
|
2013-07-15 14:25:39 -07:00
|
|
|
<li class="tag-{{ tag.1 }}"><a href="{{ SITEURL }}/{{ tag.0.url }}">{{ tag.0 }}</a></li>
|
2011-05-08 16:15:43 +01:00
|
|
|
{% endfor %}
|
|
|
|
|
</ul>
|
2011-02-22 11:35:06 +01:00
|
|
|
|
2013-08-13 10:46:41 +01:00
|
|
|
You should then also define CSS styles with appropriate classes (tag-0 to tag-N, where
|
|
|
|
|
N matches `TAG_CLOUD_STEPS` -1), tag-0 being the most frequent, and define a ul.tagcloud
|
|
|
|
|
class with appropriate list-style to create the cloud, for example::
|
|
|
|
|
|
|
|
|
|
ul.tagcloud {
|
|
|
|
|
list-style: none;
|
|
|
|
|
padding: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ul.tagcloud li {
|
|
|
|
|
display: inline-block;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
li.tag-0 {
|
|
|
|
|
font-size: 150%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
li.tag-1 {
|
|
|
|
|
font-size: 120%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
...
|
2011-02-22 11:35:06 +01:00
|
|
|
|
2011-05-08 16:15:43 +01:00
|
|
|
Translations
|
|
|
|
|
============
|
|
|
|
|
|
2012-12-03 16:31:55 -08:00
|
|
|
Pelican offers a way to translate articles. See the :doc:`Getting Started <getting_started>` section for
|
2012-03-06 06:13:17 -08:00
|
|
|
more information.
|
2011-05-08 16:15:43 +01:00
|
|
|
|
2012-10-22 16:34:55 +02:00
|
|
|
===================================================== =====================================================
|
|
|
|
|
Setting name (default value) What does it do?
|
|
|
|
|
===================================================== =====================================================
|
|
|
|
|
`DEFAULT_LANG` (``'en'``) The default language to use.
|
|
|
|
|
`TRANSLATION_FEED_ATOM` ('feeds/all-%s.atom.xml'[3]_) Where to put the Atom feed for translations.
|
|
|
|
|
`TRANSLATION_FEED_RSS` (``None``, i.e. no RSS) Where to put the RSS feed for translations.
|
|
|
|
|
===================================================== =====================================================
|
2011-05-08 16:15:43 +01:00
|
|
|
|
|
|
|
|
.. [3] %s is the language
|
|
|
|
|
|
2012-03-06 06:13:17 -08:00
|
|
|
Ordering content
|
2011-05-08 16:15:43 +01:00
|
|
|
=================
|
|
|
|
|
|
|
|
|
|
================================================ =====================================================
|
2012-03-06 06:13:17 -08:00
|
|
|
Setting name (default value) What does it do?
|
2011-05-08 16:15:43 +01:00
|
|
|
================================================ =====================================================
|
2012-08-25 23:16:50 +02:00
|
|
|
`NEWEST_FIRST_ARCHIVES` (``True``) Order archives by newest first by date. (False:
|
2012-07-18 11:18:48 -07:00
|
|
|
orders by date with older articles first.)
|
2012-04-28 18:02:10 +01:00
|
|
|
`REVERSE_CATEGORY_ORDER` (``False``) Reverse the category order. (True: lists by reverse
|
2012-03-06 06:13:17 -08:00
|
|
|
alphabetical order; default lists alphabetically.)
|
2011-05-08 16:15:43 +01:00
|
|
|
================================================ =====================================================
|
|
|
|
|
|
2012-09-11 07:29:34 -07:00
|
|
|
Themes
|
|
|
|
|
======
|
2011-05-08 16:15:43 +01:00
|
|
|
|
2012-09-11 07:29:34 -07:00
|
|
|
Creating Pelican themes is addressed in a dedicated section (see :ref:`theming-pelican`).
|
|
|
|
|
However, here are the settings that are related to themes.
|
2010-12-14 15:31:11 +00:00
|
|
|
|
2011-05-08 16:15:43 +01:00
|
|
|
================================================ =====================================================
|
2012-03-06 06:13:17 -08:00
|
|
|
Setting name (default value) What does it do?
|
2011-05-08 16:15:43 +01:00
|
|
|
================================================ =====================================================
|
2012-09-11 07:29:34 -07:00
|
|
|
`THEME` Theme to use to produce the output. Can be a relative
|
|
|
|
|
or absolute path to a theme folder, or the name of a
|
|
|
|
|
default theme or a theme installed via
|
|
|
|
|
``pelican-themes`` (see below).
|
2013-07-18 10:36:44 +08:00
|
|
|
`THEME_STATIC_DIR` (``'theme'``) Destination directory in the output path where
|
|
|
|
|
Pelican will place the files collected from
|
|
|
|
|
`THEME_STATIC_PATHS`. Default is `theme`.
|
2011-05-08 16:15:43 +01:00
|
|
|
`THEME_STATIC_PATHS` (``['static']``) Static theme paths you want to copy. Default
|
2012-03-06 06:13:17 -08:00
|
|
|
value is `static`, but if your theme has
|
2013-08-31 21:48:19 +01:00
|
|
|
other static paths, you can put them here. If files
|
|
|
|
|
or directories with the same names are included in
|
|
|
|
|
the paths defined in this settings, they will be
|
|
|
|
|
progressively overwritten.
|
2012-03-06 06:13:17 -08:00
|
|
|
`CSS_FILE` (``'main.css'``) Specify the CSS file you want to load.
|
2011-05-08 16:15:43 +01:00
|
|
|
================================================ =====================================================
|
2010-12-14 15:31:11 +00:00
|
|
|
|
2012-09-11 07:29:34 -07:00
|
|
|
|
|
|
|
|
By default, two themes are available. You can specify them using the `THEME` setting or by passing the
|
|
|
|
|
``-t`` option to the ``pelican`` command:
|
2010-12-14 15:31:11 +00:00
|
|
|
|
|
|
|
|
* notmyidea
|
2012-09-11 07:29:34 -07:00
|
|
|
* simple (a synonym for "plain text" :)
|
2010-12-14 15:31:11 +00:00
|
|
|
|
2012-09-11 07:29:34 -07:00
|
|
|
There are a number of other themes available at http://github.com/getpelican/pelican-themes.
|
|
|
|
|
Pelican comes with :doc:`pelican-themes`, a small script for managing themes.
|
2010-12-14 15:31:11 +00:00
|
|
|
|
2012-09-11 07:29:34 -07:00
|
|
|
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 <themes>`.
|
2010-12-14 15:31:11 +00:00
|
|
|
|
2012-09-11 07:29:34 -07:00
|
|
|
Following are example ways to specify your preferred theme::
|
2011-02-01 21:51:58 +00:00
|
|
|
|
2012-09-11 07:29:34 -07:00
|
|
|
# Specify name of a built-in theme
|
|
|
|
|
THEME = "notmyidea"
|
|
|
|
|
# Specify name of a theme installed via the pelican-themes tool
|
|
|
|
|
THEME = "chunk"
|
|
|
|
|
# Specify a customized theme, via path relative to the settings file
|
|
|
|
|
THEME = "themes/mycustomtheme"
|
|
|
|
|
# Specify a customized theme, via absolute path
|
|
|
|
|
THEME = "~/projects/mysite/themes/mycustomtheme"
|
2011-05-22 18:57:02 +02:00
|
|
|
|
2012-12-03 16:31:55 -08:00
|
|
|
The built-in ``notmyidea`` theme can make good use of the following settings. Feel
|
2012-09-11 07:29:34 -07:00
|
|
|
free to use them in your themes as well.
|
2010-12-14 15:31:11 +00:00
|
|
|
|
|
|
|
|
======================= =======================================================
|
2012-03-06 06:13:17 -08:00
|
|
|
Setting name What does it do ?
|
2010-12-14 15:31:11 +00:00
|
|
|
======================= =======================================================
|
2013-03-20 16:08:54 +01:00
|
|
|
`SITESUBTITLE` A subtitle to appear in the header.
|
2012-03-06 06:13:17 -08:00
|
|
|
`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` 'UA-XXXX-YYYY' to activate Google Analytics.
|
2012-06-14 23:04:23 +02:00
|
|
|
`GOSQUARED_SITENAME` 'XXX-YYYYYY-X' to activate GoSquared.
|
2012-03-06 06:13:17 -08:00
|
|
|
`MENUITEMS` A list of tuples (Title, URL) for additional menu
|
2012-02-20 13:18:18 +01:00
|
|
|
items to appear at the beginning of the main menu.
|
2011-06-13 07:30:33 +02:00
|
|
|
`PIWIK_URL` URL to your Piwik server - without 'http://' at the
|
|
|
|
|
beginning.
|
|
|
|
|
`PIWIK_SSL_URL` If the SSL-URL differs from the normal Piwik-URL
|
|
|
|
|
you have to include this setting too. (optional)
|
|
|
|
|
`PIWIK_SITE_ID` ID for the monitored website. You can find the ID
|
|
|
|
|
in the Piwik admin interface > settings > websites.
|
2012-03-06 06:13:17 -08:00
|
|
|
`LINKS` A list of tuples (Title, URL) for links to appear on
|
2010-12-14 15:31:11 +00:00
|
|
|
the header.
|
2012-03-06 06:13:17 -08:00
|
|
|
`SOCIAL` A list of tuples (Title, URL) to appear in the
|
2012-02-20 13:18:18 +01:00
|
|
|
"social" section.
|
2012-03-06 06:13:17 -08:00
|
|
|
`TWITTER_USERNAME` Allows for adding a button to articles to encourage
|
|
|
|
|
others to tweet about them. Add your Twitter username
|
|
|
|
|
if you want this button to appear.
|
2010-12-14 15:31:11 +00:00
|
|
|
======================= =======================================================
|
|
|
|
|
|
2012-12-03 16:31:55 -08:00
|
|
|
In addition, you can use the "wide" version of the ``notmyidea`` theme by
|
2012-03-06 06:13:17 -08:00
|
|
|
adding the following to your configuration::
|
2010-12-14 15:31:11 +00:00
|
|
|
|
|
|
|
|
CSS_FILE = "wide.css"
|
2011-05-08 16:15:43 +01:00
|
|
|
|
2011-07-22 02:11:18 +02:00
|
|
|
Example settings
|
|
|
|
|
================
|
|
|
|
|
|
|
|
|
|
.. literalinclude:: ../samples/pelican.conf.py
|
|
|
|
|
:language: python
|
2013-03-19 13:05:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
.. _Jinja custom filters documentation: http://jinja.pocoo.org/docs/api/#custom-filters
|