From d840904cedac7a9bd296e32b912c13e8ba076f8b Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 13 May 2011 14:43:12 +0200 Subject: [PATCH] fix path to themes directory --- sigal/theme.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sigal/theme.py b/sigal/theme.py index fc0d306..728d8d7 100644 --- a/sigal/theme.py +++ b/sigal/theme.py @@ -18,7 +18,8 @@ IGNORED_DIR = ['css', 'js', 'img'] DESCRIPTION_FILE = "album_description" SIGAL_LINK = "https://github.com/saimn/sigal" PATH_SEP = u" ยป " - +THEMES_PATH = os.path.normpath(os.path.join(os.path.abspath(os.path.dirname(__file__)), + '..', 'themes')) def do_link(link, title): "return html link" @@ -40,9 +41,9 @@ class Theme(): if params.has_option('sigal', 'theme'): theme = params.get('sigal', 'theme') - self.theme_dir = os.path.join('themes', theme) - env = Environment(loader=PackageLoader('sigal', - os.path.join('..', self.theme_dir))) + self.theme_path = os.path.join(THEMES_PATH, theme) + self.theme_rel_path = os.path.relpath(self.theme_path, os.path.dirname(__file__)) + env = Environment(loader=PackageLoader('sigal', self.theme_rel_path)) self.template = env.get_template(tpl) def directory_list(self): @@ -121,7 +122,7 @@ class Theme(): """ # copy static files in the output dir - copy_tree(os.path.abspath(self.theme_dir), os.path.abspath(self.path)) + copy_tree(self.theme_path, os.path.abspath(self.path)) sigal_link = do_link(SIGAL_LINK, "sigal")