1
0
Fork 0
forked from github/pelican

Add theme templates, CSS, JS to Invoke livereload task

This commit is contained in:
Justin Mayer 2019-06-20 08:30:04 +02:00
commit a4cecd2d0c

View file

@ -102,6 +102,13 @@ def livereload(c):
for extension in content_file_extensions:
content_blob = '{0}/**/*{1}'.format(SETTINGS['PATH'], extension)
server.watch(content_blob, lambda: build(c))
# Watch the theme's templates and static assets
theme_path = SETTINGS['THEME']
server.watch('{}/templates/*.html'.format(theme_path), lambda: build(c))
static_file_extensions = ['.css', '.js']
for extension in static_file_extensions:
static_file = '{0}/static/**/*{1}'.format(theme_path, extension)
server.watch(static_file, lambda: build(c))
# Serve output path on configured port
server.serve(port=CONFIG['port'], root=CONFIG['deploy_path'])