mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge 9be6c151a3 into d23c68361a
This commit is contained in:
commit
a65769519a
3 changed files with 10 additions and 3 deletions
|
|
@ -138,6 +138,10 @@ Setting name (default value)
|
|||
incorporated into the generated HTML via the `Typogrify
|
||||
<https://pypi.python.org/pypi/typogrify>`_ library,
|
||||
which can be installed via: ``pip install typogrify``
|
||||
`TYPOGRIFY_FILTERS` (``['typogrify']``) List of Typogrify filterst to apply if ``TYPOGRIFY`` is set to ``True``.
|
||||
Default is ``['typogrify']`` which applies all the filters. For example,
|
||||
to disable the ``caps`` filter, you can set ``TYPOGRIFY_FILTERS = ['amp',
|
||||
'initial_quotes', 'smartypants', 'titlecase', 'widont']``.
|
||||
`DIRECT_TEMPLATES` (``('index', 'tags', 'categories', 'authors', 'archives')``) List of templates that are used directly to render
|
||||
content. Typically direct templates are used to generate
|
||||
index pages for collections of content (e.g., tags and
|
||||
|
|
|
|||
|
|
@ -463,9 +463,11 @@ class Readers(object):
|
|||
|
||||
# eventually filter the content with typogrify if asked so
|
||||
if content and self.settings['TYPOGRIFY']:
|
||||
from typogrify.filters import typogrify
|
||||
content = typogrify(content)
|
||||
metadata['title'] = typogrify(metadata['title'])
|
||||
import typogrify.filters
|
||||
for filter_name in self.settings['TYPOGRIFY_FILTERS']:
|
||||
filter = getattr(typogrify.filters, filter_name)
|
||||
content = filter(content)
|
||||
metadata['title'] = filter(metadata['title'])
|
||||
|
||||
if context_signal:
|
||||
logger.debug('signal {}.send({}, <metadata>)'.format(
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ DEFAULT_CONFIG = {
|
|||
'DEFAULT_STATUS': 'published',
|
||||
'ARTICLE_PERMALINK_STRUCTURE': '',
|
||||
'TYPOGRIFY': False,
|
||||
'TYPOGRIFY_FILTERS': ['typogrify'],
|
||||
'SUMMARY_MAX_LENGTH': 50,
|
||||
'PLUGIN_PATH': '',
|
||||
'PLUGINS': [],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue