Merge pull request #45 from titoko/master

Use exposure templates files if current theme don't override it
This commit is contained in:
Laurent Peuch 2016-05-02 01:05:37 +02:00
commit 9c142143a8

View File

@ -137,13 +137,15 @@ def main():
error(theme_path, "'%s' is not an existing theme, available themes are '%s'" % (available_themes)) error(theme_path, "'%s' is not an existing theme, available themes are '%s'" % (available_themes))
prosopopee_templates_dir = os.path.realpath(os.path.join(os.getcwd(), "templates")) templates_dir = [
project_templates_dir = os.path.join(os.path.split(os.path.realpath(__file__))[0], "themes", theme, "templates") os.path.realpath(os.path.join(os.getcwd(), "templates")),
os.path.join(os.path.split(os.path.realpath(__file__))[0], "themes", theme, "templates")
]
templates = Environment(loader=FileSystemLoader([ if theme != "exposure":
prosopopee_templates_dir, templates_dir.append(os.path.join(os.path.split(os.path.realpath(__file__))[0], "themes", "exposure", "templates"))
project_templates_dir
])) templates = Environment(loader=FileSystemLoader(templates_dir))
index_template = templates.get_template("index.html") index_template = templates.get_template("index.html")
gallery_index_template = templates.get_template("gallery-index.html") gallery_index_template = templates.get_template("gallery-index.html")