mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge pull request #1593 from iKevinY/clarify-setting-types
Change the documented type of various settings
This commit is contained in:
commit
ca0477c62f
6 changed files with 20 additions and 21 deletions
|
|
@ -91,7 +91,7 @@ via the ``keywords`` metadata, as is standard in HTML. The two can be used
|
||||||
interchangeably.
|
interchangeably.
|
||||||
|
|
||||||
Note that, aside from the title, none of this article metadata is mandatory:
|
Note that, aside from the title, none of this article metadata is mandatory:
|
||||||
if the date is not specified and ``DEFAULT_DATE`` is set to ``fs``, Pelican
|
if the date is not specified and ``DEFAULT_DATE`` is set to ``'fs'``, Pelican
|
||||||
will rely on the file's "mtime" timestamp, and the category can be determined
|
will rely on the file's "mtime" timestamp, and the category can be determined
|
||||||
by the directory in which the file resides. For example, a file located at
|
by the directory in which the file resides. For example, a file located at
|
||||||
``python/foobar/myfoobar.rst`` will have a category of ``foobar``. If you would
|
``python/foobar/myfoobar.rst`` will have a category of ``foobar``. If you would
|
||||||
|
|
|
||||||
|
|
@ -58,14 +58,13 @@ Setting name (followed by default value, if any)
|
||||||
template. Templates may or not honor this
|
template. Templates may or not honor this
|
||||||
setting.
|
setting.
|
||||||
``DEFAULT_DATE = None`` The default date you want to use.
|
``DEFAULT_DATE = None`` The default date you want to use.
|
||||||
If ``fs``, Pelican will use the file system
|
If ``'fs'``, Pelican will use the file system
|
||||||
timestamp information (mtime) if it can't get
|
timestamp information (mtime) if it can't get
|
||||||
date information from the metadata.
|
date information from the metadata.
|
||||||
If set to a tuple object, the default datetime object will instead
|
If set to a tuple object, the default datetime object will instead
|
||||||
be generated by passing the tuple to the
|
be generated by passing the tuple to the
|
||||||
``datetime.datetime`` constructor.
|
``datetime.datetime`` constructor.
|
||||||
``DEFAULT_METADATA = ()`` The default metadata you want to use for all articles
|
``DEFAULT_METADATA = {}`` The default metadata you want to use for all articles and pages.
|
||||||
and pages.
|
|
||||||
``DOCUTILS_SETTINGS = {}`` Extra configuration settings for the docutils publisher
|
``DOCUTILS_SETTINGS = {}`` Extra configuration settings for the docutils publisher
|
||||||
(applicable only to reStructuredText). See `Docutils
|
(applicable only to reStructuredText). See `Docutils
|
||||||
Configuration`_ settings for more details.
|
Configuration`_ settings for more details.
|
||||||
|
|
@ -90,11 +89,11 @@ Setting name (followed by default value, if any)
|
||||||
generating new files. This can be useful in preventing older,
|
generating new files. This can be useful in preventing older,
|
||||||
unnecessary files from persisting in your output. However, **this is
|
unnecessary files from persisting in your output. However, **this is
|
||||||
a destructive setting and should be handled with extreme care.**
|
a destructive setting and should be handled with extreme care.**
|
||||||
``OUTPUT_RETENTION = ()`` A tuple of filenames that should be retained and not deleted from the
|
``OUTPUT_RETENTION = []`` A list of filenames that should be retained and not deleted from the
|
||||||
output directory. One use case would be the preservation of version
|
output directory. One use case would be the preservation of version
|
||||||
control data. For example: ``(".hg", ".git", ".bzr")``
|
control data. For example: ``[".hg", ".git", ".bzr"]``
|
||||||
``JINJA_EXTENSIONS = []`` A list of any Jinja2 extensions you want to use.
|
``JINJA_EXTENSIONS = []`` A list of any Jinja2 extensions you want to use.
|
||||||
``JINJA_FILTERS = {}`` A list of custom Jinja2 filters you want to use.
|
``JINJA_FILTERS = {}`` A dictionary of custom Jinja2 filters you want to use.
|
||||||
The dictionary should map the filtername to the filter function.
|
The dictionary should map the filtername to the filter function.
|
||||||
For example: ``{'urlencode': urlencode_filter}``
|
For example: ``{'urlencode': urlencode_filter}``
|
||||||
See `Jinja custom filters documentation`_.
|
See `Jinja custom filters documentation`_.
|
||||||
|
|
@ -171,12 +170,12 @@ Setting name (followed by default value, if any)
|
||||||
``TYPOGRIFY_IGNORE_TAGS = []`` A list of tags for Typogrify to ignore. By default
|
``TYPOGRIFY_IGNORE_TAGS = []`` A list of tags for Typogrify to ignore. By default
|
||||||
Typogrify will ignore ``pre`` and ``code`` tags. This
|
Typogrify will ignore ``pre`` and ``code`` tags. This
|
||||||
requires that Typogrify version 2.0.4 or later is installed
|
requires that Typogrify version 2.0.4 or later is installed
|
||||||
``DIRECT_TEMPLATES =`` ``('index', 'categories', 'authors', 'archives')`` List of templates that are used directly to render
|
``DIRECT_TEMPLATES =`` ``['index', 'categories', 'authors', 'archives']`` List of templates that are used directly to render
|
||||||
content. Typically direct templates are used to generate
|
content. Typically direct templates are used to generate
|
||||||
index pages for collections of content (e.g., tags and
|
index pages for collections of content (e.g., tags and
|
||||||
category index pages). If the tag and category collections
|
category index pages). If the tag and category collections
|
||||||
are not needed, set ``DIRECT_TEMPLATES = ('index', 'archives')``
|
are not needed, set ``DIRECT_TEMPLATES = ['index', 'archives']``
|
||||||
``PAGINATED_DIRECT_TEMPLATES = ('index',)`` Provides the direct templates that should be paginated.
|
``PAGINATED_DIRECT_TEMPLATES = ['index']`` Provides the direct templates that should be paginated.
|
||||||
``SUMMARY_MAX_LENGTH = 50`` When creating a short summary of an article, this will
|
``SUMMARY_MAX_LENGTH = 50`` When creating a short summary of an article, this will
|
||||||
be the default length (measured in words) of the text created.
|
be the default length (measured in words) of the text created.
|
||||||
This only applies if your content does not otherwise
|
This only applies if your content does not otherwise
|
||||||
|
|
@ -352,7 +351,7 @@ posts for the month at ``posts/2011/Aug/index.html``.
|
||||||
arrive at an appropriate archive of posts, without having to specify
|
arrive at an appropriate archive of posts, without having to specify
|
||||||
a page name.
|
a page name.
|
||||||
|
|
||||||
``DIRECT_TEMPLATES``, which are ``('index', 'tags', 'categories', 'archives')``
|
``DIRECT_TEMPLATES``, which are ``['index', 'tags', 'categories', 'archives']``
|
||||||
by default, work a bit differently than noted above. Only the ``_SAVE_AS``
|
by default, work a bit differently than noted above. Only the ``_SAVE_AS``
|
||||||
settings are available, but it is available for any direct template.
|
settings are available, but it is available for any direct template.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ DEFAULT_CONFIG = {
|
||||||
'NEWEST_FIRST_ARCHIVES': True,
|
'NEWEST_FIRST_ARCHIVES': True,
|
||||||
'REVERSE_CATEGORY_ORDER': False,
|
'REVERSE_CATEGORY_ORDER': False,
|
||||||
'DELETE_OUTPUT_DIRECTORY': False,
|
'DELETE_OUTPUT_DIRECTORY': False,
|
||||||
'OUTPUT_RETENTION': (),
|
'OUTPUT_RETENTION': [],
|
||||||
'ARTICLE_URL': '{slug}.html',
|
'ARTICLE_URL': '{slug}.html',
|
||||||
'ARTICLE_SAVE_AS': '{slug}.html',
|
'ARTICLE_SAVE_AS': '{slug}.html',
|
||||||
'ARTICLE_ORDER_BY': 'slug',
|
'ARTICLE_ORDER_BY': 'slug',
|
||||||
|
|
@ -94,9 +94,9 @@ DEFAULT_CONFIG = {
|
||||||
'DEFAULT_LANG': 'en',
|
'DEFAULT_LANG': 'en',
|
||||||
'TAG_CLOUD_STEPS': 4,
|
'TAG_CLOUD_STEPS': 4,
|
||||||
'TAG_CLOUD_MAX_ITEMS': 100,
|
'TAG_CLOUD_MAX_ITEMS': 100,
|
||||||
'DIRECT_TEMPLATES': ('index', 'tags', 'categories', 'authors', 'archives'),
|
'DIRECT_TEMPLATES': ['index', 'tags', 'categories', 'authors', 'archives'],
|
||||||
'EXTRA_TEMPLATES_PATHS': [],
|
'EXTRA_TEMPLATES_PATHS': [],
|
||||||
'PAGINATED_DIRECT_TEMPLATES': ('index', ),
|
'PAGINATED_DIRECT_TEMPLATES': ['index'],
|
||||||
'PELICAN_CLASS': 'pelican.Pelican',
|
'PELICAN_CLASS': 'pelican.Pelican',
|
||||||
'DEFAULT_DATE_FORMAT': '%a %d %B %Y',
|
'DEFAULT_DATE_FORMAT': '%a %d %B %Y',
|
||||||
'DATE_FORMATS': {},
|
'DATE_FORMATS': {},
|
||||||
|
|
@ -107,7 +107,7 @@ DEFAULT_CONFIG = {
|
||||||
'LOCALE': [''], # defaults to user locale
|
'LOCALE': [''], # defaults to user locale
|
||||||
'DEFAULT_PAGINATION': False,
|
'DEFAULT_PAGINATION': False,
|
||||||
'DEFAULT_ORPHANS': 0,
|
'DEFAULT_ORPHANS': 0,
|
||||||
'DEFAULT_METADATA': (),
|
'DEFAULT_METADATA': {},
|
||||||
'FILENAME_METADATA': '(?P<date>\d{4}-\d{2}-\d{2}).*',
|
'FILENAME_METADATA': '(?P<date>\d{4}-\d{2}-\d{2}).*',
|
||||||
'PATH_METADATA': '',
|
'PATH_METADATA': '',
|
||||||
'EXTRA_PATH_METADATA': {},
|
'EXTRA_PATH_METADATA': {},
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ SOCIAL = (('twitter', 'http://twitter.com/ametaireau'),
|
||||||
('github', 'http://github.com/ametaireau'),)
|
('github', 'http://github.com/ametaireau'),)
|
||||||
|
|
||||||
# global metadata to all the contents
|
# global metadata to all the contents
|
||||||
DEFAULT_METADATA = (('yeah', 'it is'),)
|
DEFAULT_METADATA = {'yeah': 'it is'}
|
||||||
|
|
||||||
# path-specific metadata
|
# path-specific metadata
|
||||||
EXTRA_PATH_METADATA = {
|
EXTRA_PATH_METADATA = {
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ SOCIAL = (('twitter', 'http://twitter.com/ametaireau'),
|
||||||
('github', 'http://github.com/ametaireau'),)
|
('github', 'http://github.com/ametaireau'),)
|
||||||
|
|
||||||
# global metadata to all the contents
|
# global metadata to all the contents
|
||||||
DEFAULT_METADATA = (('yeah', 'it is'),)
|
DEFAULT_METADATA = {'yeah': 'it is'}
|
||||||
|
|
||||||
# path-specific metadata
|
# path-specific metadata
|
||||||
EXTRA_PATH_METADATA = {
|
EXTRA_PATH_METADATA = {
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ SOCIAL = (('twitter', 'http://twitter.com/ametaireau'),
|
||||||
('github', 'http://github.com/ametaireau'),)
|
('github', 'http://github.com/ametaireau'),)
|
||||||
|
|
||||||
# global metadata to all the contents
|
# global metadata to all the contents
|
||||||
DEFAULT_METADATA = (('yeah', 'it is'),)
|
DEFAULT_METADATA = {'yeah': 'it is'}
|
||||||
|
|
||||||
# path-specific metadata
|
# path-specific metadata
|
||||||
EXTRA_PATH_METADATA = {
|
EXTRA_PATH_METADATA = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue