From 7c47107342bc4689cf04b2e582e1a3c5ae4fe2f5 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 9 Nov 2012 14:53:25 +0100 Subject: [PATCH] change theme structure to avoid copying html templates in the output dir --- sigal/themes/default/{ => static}/css/base.css | 0 sigal/themes/default/{ => static}/css/layout.css | 0 sigal/themes/default/{ => static}/css/skeleton.css | 0 sigal/themes/default/{ => static}/css/style.css | 0 sigal/themes/default/{ => templates}/index.html | 0 sigal/themes/galleria/{ => static}/css/style.css | 0 .../galleria/{ => static}/js/classic-loader.gif | Bin .../themes/galleria/{ => static}/js/classic-map.png | Bin .../galleria/{ => static}/js/galleria-1.2.3.js | 0 .../galleria/{ => static}/js/galleria-1.2.3.min.js | 0 .../galleria/{ => static}/js/galleria.classic.css | 0 .../galleria/{ => static}/js/galleria.classic.js | 0 .../{ => static}/js/galleria.classic.min.js | 0 .../{ => static}/js/galleria.classic.orig.css | 0 sigal/themes/galleria/{ => static}/js/jquery.min.js | 0 sigal/themes/galleria/{ => templates}/index.html | 0 sigal/writer.py | 7 ++++--- 17 files changed, 4 insertions(+), 3 deletions(-) rename sigal/themes/default/{ => static}/css/base.css (100%) rename sigal/themes/default/{ => static}/css/layout.css (100%) rename sigal/themes/default/{ => static}/css/skeleton.css (100%) rename sigal/themes/default/{ => static}/css/style.css (100%) rename sigal/themes/default/{ => templates}/index.html (100%) rename sigal/themes/galleria/{ => static}/css/style.css (100%) rename sigal/themes/galleria/{ => static}/js/classic-loader.gif (100%) rename sigal/themes/galleria/{ => static}/js/classic-map.png (100%) rename sigal/themes/galleria/{ => static}/js/galleria-1.2.3.js (100%) rename sigal/themes/galleria/{ => static}/js/galleria-1.2.3.min.js (100%) rename sigal/themes/galleria/{ => static}/js/galleria.classic.css (100%) rename sigal/themes/galleria/{ => static}/js/galleria.classic.js (100%) rename sigal/themes/galleria/{ => static}/js/galleria.classic.min.js (100%) rename sigal/themes/galleria/{ => static}/js/galleria.classic.orig.css (100%) rename sigal/themes/galleria/{ => static}/js/jquery.min.js (100%) rename sigal/themes/galleria/{ => templates}/index.html (100%) diff --git a/sigal/themes/default/css/base.css b/sigal/themes/default/static/css/base.css similarity index 100% rename from sigal/themes/default/css/base.css rename to sigal/themes/default/static/css/base.css diff --git a/sigal/themes/default/css/layout.css b/sigal/themes/default/static/css/layout.css similarity index 100% rename from sigal/themes/default/css/layout.css rename to sigal/themes/default/static/css/layout.css diff --git a/sigal/themes/default/css/skeleton.css b/sigal/themes/default/static/css/skeleton.css similarity index 100% rename from sigal/themes/default/css/skeleton.css rename to sigal/themes/default/static/css/skeleton.css diff --git a/sigal/themes/default/css/style.css b/sigal/themes/default/static/css/style.css similarity index 100% rename from sigal/themes/default/css/style.css rename to sigal/themes/default/static/css/style.css diff --git a/sigal/themes/default/index.html b/sigal/themes/default/templates/index.html similarity index 100% rename from sigal/themes/default/index.html rename to sigal/themes/default/templates/index.html diff --git a/sigal/themes/galleria/css/style.css b/sigal/themes/galleria/static/css/style.css similarity index 100% rename from sigal/themes/galleria/css/style.css rename to sigal/themes/galleria/static/css/style.css diff --git a/sigal/themes/galleria/js/classic-loader.gif b/sigal/themes/galleria/static/js/classic-loader.gif similarity index 100% rename from sigal/themes/galleria/js/classic-loader.gif rename to sigal/themes/galleria/static/js/classic-loader.gif diff --git a/sigal/themes/galleria/js/classic-map.png b/sigal/themes/galleria/static/js/classic-map.png similarity index 100% rename from sigal/themes/galleria/js/classic-map.png rename to sigal/themes/galleria/static/js/classic-map.png diff --git a/sigal/themes/galleria/js/galleria-1.2.3.js b/sigal/themes/galleria/static/js/galleria-1.2.3.js similarity index 100% rename from sigal/themes/galleria/js/galleria-1.2.3.js rename to sigal/themes/galleria/static/js/galleria-1.2.3.js diff --git a/sigal/themes/galleria/js/galleria-1.2.3.min.js b/sigal/themes/galleria/static/js/galleria-1.2.3.min.js similarity index 100% rename from sigal/themes/galleria/js/galleria-1.2.3.min.js rename to sigal/themes/galleria/static/js/galleria-1.2.3.min.js diff --git a/sigal/themes/galleria/js/galleria.classic.css b/sigal/themes/galleria/static/js/galleria.classic.css similarity index 100% rename from sigal/themes/galleria/js/galleria.classic.css rename to sigal/themes/galleria/static/js/galleria.classic.css diff --git a/sigal/themes/galleria/js/galleria.classic.js b/sigal/themes/galleria/static/js/galleria.classic.js similarity index 100% rename from sigal/themes/galleria/js/galleria.classic.js rename to sigal/themes/galleria/static/js/galleria.classic.js diff --git a/sigal/themes/galleria/js/galleria.classic.min.js b/sigal/themes/galleria/static/js/galleria.classic.min.js similarity index 100% rename from sigal/themes/galleria/js/galleria.classic.min.js rename to sigal/themes/galleria/static/js/galleria.classic.min.js diff --git a/sigal/themes/galleria/js/galleria.classic.orig.css b/sigal/themes/galleria/static/js/galleria.classic.orig.css similarity index 100% rename from sigal/themes/galleria/js/galleria.classic.orig.css rename to sigal/themes/galleria/static/js/galleria.classic.orig.css diff --git a/sigal/themes/galleria/js/jquery.min.js b/sigal/themes/galleria/static/js/jquery.min.js similarity index 100% rename from sigal/themes/galleria/js/jquery.min.js rename to sigal/themes/galleria/static/js/jquery.min.js diff --git a/sigal/themes/galleria/index.html b/sigal/themes/galleria/templates/index.html similarity index 100% rename from sigal/themes/galleria/index.html rename to sigal/themes/galleria/templates/index.html diff --git a/sigal/writer.py b/sigal/writer.py index 928a22e..666f026 100644 --- a/sigal/writer.py +++ b/sigal/writer.py @@ -64,7 +64,8 @@ class Writer(): if not os.path.exists(theme_path): raise Exception("Impossible to find the theme %s" % self.theme) - theme_relpath = os.path.relpath(self.theme, os.path.dirname(__file__)) + theme_relpath = os.path.relpath(os.path.join(self.theme, 'templates'), + os.path.dirname(__file__)) env = Environment(loader=PackageLoader('sigal', theme_relpath)) self.template = env.get_template(INDEX_PAGE) @@ -80,8 +81,8 @@ class Writer(): def copy_assets(self): "Copy the theme files in the output dir" - self.theme_path = os.path.join(self.output_dir, 'theme') - copy_tree(self.theme, self.theme_path) + self.theme_path = os.path.join(self.output_dir, 'static') + copy_tree(os.path.join(self.theme, 'static'), self.theme_path) def write(self, paths, relpath): """