From 89034f8b3f099fd00240548bb6f5a515ea298ecc Mon Sep 17 00:00:00 2001 From: Russ Webber Date: Thu, 18 Jul 2013 10:36:44 +0800 Subject: [PATCH] added THEME_STATIC_DIR setting The theme static output directory path is now customisable via settings. i.e. you can now use 'assets' instead of 'theme'. --- docs/settings.rst | 3 +++ pelican/generators.py | 3 ++- pelican/settings.py | 1 + pelican/themes/notmyidea/templates/base.html | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 9a38d499..a4299be6 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -547,6 +547,9 @@ Setting name (default value) What does it do? or absolute path to a theme folder, or the name of a default theme or a theme installed via ``pelican-themes`` (see below). +`THEME_STATIC_DIR` (``'theme'``) Destination directory in the output path where + Pelican will place the files collected from + `THEME_STATIC_PATHS`. Default is `theme`. `THEME_STATIC_PATHS` (``['static']``) Static theme paths you want to copy. Default value is `static`, but if your theme has other static paths, you can put them here. diff --git a/pelican/generators.py b/pelican/generators.py index 0dc3667f..166ff616 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -564,7 +564,8 @@ class StaticGenerator(Generator): def generate_output(self, writer): self._copy_paths(self.settings['THEME_STATIC_PATHS'], self.theme, - 'theme', self.output_path, os.curdir) + self.settings['THEME_STATIC_DIR'], self.output_path, + os.curdir) # copy all Static files for sc in self.staticfiles: source_path = os.path.join(self.path, sc.source_path) diff --git a/pelican/settings.py b/pelican/settings.py index 01203504..e631fab3 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -35,6 +35,7 @@ DEFAULT_CONFIG = { 'OUTPUT_PATH': 'output', 'MARKUP': ('rst', 'md'), 'STATIC_PATHS': ['images', ], + 'THEME_STATIC_DIR': 'theme', 'THEME_STATIC_PATHS': ['static', ], 'FEED_ALL_ATOM': os.path.join('feeds', 'all.atom.xml'), 'CATEGORY_FEED_ATOM': os.path.join('feeds', '%s.atom.xml'), diff --git a/pelican/themes/notmyidea/templates/base.html b/pelican/themes/notmyidea/templates/base.html index 9bf4b12b..a9edad6d 100644 --- a/pelican/themes/notmyidea/templates/base.html +++ b/pelican/themes/notmyidea/templates/base.html @@ -3,7 +3,7 @@ {% block title %}{{ SITENAME }}{%endblock%} - + {% if FEED_ALL_ATOM %} {% endif %}