mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
integrate webassets
This commit is contained in:
parent
d97fc8f666
commit
a6788f83c2
3 changed files with 30 additions and 5 deletions
|
|
@ -68,6 +68,7 @@ _DEFAULT_CONFIG = {'PATH': '.',
|
|||
'ARTICLE_PERMALINK_STRUCTURE': '',
|
||||
'TYPOGRIFY': False,
|
||||
'LESS_GENERATOR': False,
|
||||
'WEBASSETS': False,
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -150,4 +151,12 @@ def configure_settings(settings, default_settings=None, filename=None):
|
|||
"http://docs.notmyidea.org/alexis/pelican/settings.html#timezone "
|
||||
"for more information")
|
||||
|
||||
if settings['WEBASSETS']:
|
||||
try:
|
||||
from webassets.ext.jinja2 import AssetsExtension
|
||||
settings['JINJA_EXTENSIONS'].append(AssetsExtension)
|
||||
except ImportError:
|
||||
logger.warn("You must install the webassets module to use WEBASSETS.")
|
||||
settings['WEBASSETS'] = False
|
||||
|
||||
return settings
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue