diff --git a/pelican/tools/templates/tasks.py.jinja2 b/pelican/tools/templates/tasks.py.jinja2 index 45c8768d..a800b79b 100644 --- a/pelican/tools/templates/tasks.py.jinja2 +++ b/pelican/tools/templates/tasks.py.jinja2 @@ -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'])