From d1ef4ff541cac38e5ad548d1dd7c89a040a70ca5 Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 5 May 2011 00:32:37 +0200 Subject: [PATCH] add theme vars: gallery name & path to home --- sigal/theme.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sigal/theme.py b/sigal/theme.py index 2454883..2276750 100644 --- a/sigal/theme.py +++ b/sigal/theme.py @@ -70,6 +70,11 @@ class Theme(): for dirpath, dirnames, imglist in self.filelist(): theme = { 'path': os.path.relpath(self.path, dirpath) } + home_path = os.path.join(os.path.relpath(self.path, dirpath), INDEX_PAGE) + + gallery_name = "" + if dirpath != self.path: + gallery_name = os.path.basename(dirpath).replace('_',' ').replace('-',' ').capitalize() images = [] for i in imglist: @@ -91,8 +96,8 @@ class Theme(): albums.append(album) # print album - page = self.template.render(self.meta, - images=images, + page = self.template.render(self.meta, gallery_name=gallery_name, + home_path=home_path, images=images, albums=albums, theme=theme) # save