change theme structure to avoid copying html templates in the output dir

This commit is contained in:
Simon
2012-11-09 14:53:25 +01:00
parent 357c93f14e
commit 7c47107342
17 changed files with 4 additions and 3 deletions

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -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):
"""