diff --git a/MANIFEST.in b/MANIFEST.in index 3adf836..5a926f8 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,2 @@ -recursive-include templates * -recursive-include static * recursive-include themes * include requirements.txt diff --git a/prosopopee/prosopopee.py b/prosopopee/prosopopee.py index 4021661..6d849ca 100644 --- a/prosopopee/prosopopee.py +++ b/prosopopee/prosopopee.py @@ -10,11 +10,6 @@ from jinja2 import Environment, FileSystemLoader from .cache import CACHE from .utils import error -templates = Environment(loader=FileSystemLoader([os.path.realpath(os.path.join(os.getcwd(), "templates")), os.path.join(os.path.split(os.path.realpath(__file__))[0], "templates")])) -index_template = templates.get_template("index.html") -gallery_index_template = templates.get_template("gallery-index.html") -page_template = templates.get_template("page.html") - SETTINGS = { "show_date": True, "gm": { @@ -118,19 +113,21 @@ def main(): # XXX recursively merge directories if os.path.exists(os.path.join(os.getcwd(), "build", "static")): shutil.rmtree(os.path.join(os.getcwd(), "build", "static")) - if settings.get("theme"): - if os.path.exists(os.path.join(os.getcwd(), "templates")): - shutil.rmtree(os.path.join(os.getcwd(), "templates")) - shutil.copytree(os.path.join(os.path.split(os.path.realpath(__file__))[0], "themes", settings.get("theme"), "static"), os.path.join(os.getcwd(), "build", "static")) - shutil.copytree(os.path.join(os.path.split(os.path.realpath(__file__))[0], "themes", settings.get("theme"), "templates"), os.path.join(os.getcwd(), "templates")) - templates = Environment(loader=FileSystemLoader([os.path.realpath(os.path.join(os.getcwd(), "templates")), os.path.join(os.path.split(os.path.realpath(__file__))[0], "templates")])) - index_template = templates.get_template("index.html") - gallery_index_template = templates.get_template("gallery-index.html") - page_template = templates.get_template("page.html") - elif os.path.exists(os.path.join(os.getcwd(), "static")): + + if settings.get("theme") is None: + gallery_theme = "exposure" + else: + gallery_theme = settings.get("theme") + + if os.path.exists(os.path.join(os.getcwd(), "static")): shutil.copytree(os.path.join(os.getcwd(), "static"), os.path.join(os.getcwd(), "build", "static")) else: - shutil.copytree(os.path.join(os.path.split(os.path.realpath(__file__))[0], "static"), os.path.join(os.getcwd(), "build", "static")) + shutil.copytree(os.path.join(os.path.split(os.path.realpath(__file__))[0], "themes", gallery_theme, "static"), os.path.join(os.getcwd(), "build", "static")) + + templates = Environment(loader=FileSystemLoader([os.path.realpath(os.path.join(os.getcwd(), "templates")), os.path.join(os.path.split(os.path.realpath(__file__))[0], "themes", gallery_theme, "templates")])) + index_template = templates.get_template("index.html") + gallery_index_template = templates.get_template("gallery-index.html") + page_template = templates.get_template("page.html") for gallery in dirs: gallery_settings = yaml.safe_load(open(os.path.join(os.getcwd(), gallery, "settings.yaml"), "r")) diff --git a/prosopopee/static/css/baguetteBox.min.css b/prosopopee/themes/exposure/static/css/baguetteBox.min.css similarity index 100% rename from prosopopee/static/css/baguetteBox.min.css rename to prosopopee/themes/exposure/static/css/baguetteBox.min.css diff --git a/prosopopee/static/css/fonts.css b/prosopopee/themes/exposure/static/css/fonts.css similarity index 100% rename from prosopopee/static/css/fonts.css rename to prosopopee/themes/exposure/static/css/fonts.css diff --git a/prosopopee/static/css/panorama_viewer.css b/prosopopee/themes/exposure/static/css/panorama_viewer.css similarity index 100% rename from prosopopee/static/css/panorama_viewer.css rename to prosopopee/themes/exposure/static/css/panorama_viewer.css diff --git a/prosopopee/static/css/style-page.css b/prosopopee/themes/exposure/static/css/style-page.css similarity index 100% rename from prosopopee/static/css/style-page.css rename to prosopopee/themes/exposure/static/css/style-page.css diff --git a/prosopopee/static/css/style.css b/prosopopee/themes/exposure/static/css/style.css similarity index 100% rename from prosopopee/static/css/style.css rename to prosopopee/themes/exposure/static/css/style.css diff --git a/prosopopee/static/fonts/crimsontext-bold-webfont.eot b/prosopopee/themes/exposure/static/fonts/crimsontext-bold-webfont.eot similarity index 100% rename from prosopopee/static/fonts/crimsontext-bold-webfont.eot rename to prosopopee/themes/exposure/static/fonts/crimsontext-bold-webfont.eot diff --git a/prosopopee/static/fonts/crimsontext-bold-webfont.svg b/prosopopee/themes/exposure/static/fonts/crimsontext-bold-webfont.svg similarity index 100% rename from prosopopee/static/fonts/crimsontext-bold-webfont.svg rename to prosopopee/themes/exposure/static/fonts/crimsontext-bold-webfont.svg diff --git a/prosopopee/static/fonts/crimsontext-bold-webfont.ttf b/prosopopee/themes/exposure/static/fonts/crimsontext-bold-webfont.ttf similarity index 100% rename from prosopopee/static/fonts/crimsontext-bold-webfont.ttf rename to prosopopee/themes/exposure/static/fonts/crimsontext-bold-webfont.ttf diff --git a/prosopopee/static/fonts/crimsontext-bold-webfont.woff b/prosopopee/themes/exposure/static/fonts/crimsontext-bold-webfont.woff similarity index 100% rename from prosopopee/static/fonts/crimsontext-bold-webfont.woff rename to prosopopee/themes/exposure/static/fonts/crimsontext-bold-webfont.woff diff --git a/prosopopee/static/fonts/crimsontext-bold-webfont.woff2 b/prosopopee/themes/exposure/static/fonts/crimsontext-bold-webfont.woff2 similarity index 100% rename from prosopopee/static/fonts/crimsontext-bold-webfont.woff2 rename to prosopopee/themes/exposure/static/fonts/crimsontext-bold-webfont.woff2 diff --git a/prosopopee/static/fonts/crimsontext-bolditalic-webfont.eot b/prosopopee/themes/exposure/static/fonts/crimsontext-bolditalic-webfont.eot similarity index 100% rename from prosopopee/static/fonts/crimsontext-bolditalic-webfont.eot rename to prosopopee/themes/exposure/static/fonts/crimsontext-bolditalic-webfont.eot diff --git a/prosopopee/static/fonts/crimsontext-bolditalic-webfont.svg b/prosopopee/themes/exposure/static/fonts/crimsontext-bolditalic-webfont.svg similarity index 100% rename from prosopopee/static/fonts/crimsontext-bolditalic-webfont.svg rename to prosopopee/themes/exposure/static/fonts/crimsontext-bolditalic-webfont.svg diff --git a/prosopopee/static/fonts/crimsontext-bolditalic-webfont.ttf b/prosopopee/themes/exposure/static/fonts/crimsontext-bolditalic-webfont.ttf similarity index 100% rename from prosopopee/static/fonts/crimsontext-bolditalic-webfont.ttf rename to prosopopee/themes/exposure/static/fonts/crimsontext-bolditalic-webfont.ttf diff --git a/prosopopee/static/fonts/crimsontext-bolditalic-webfont.woff b/prosopopee/themes/exposure/static/fonts/crimsontext-bolditalic-webfont.woff similarity index 100% rename from prosopopee/static/fonts/crimsontext-bolditalic-webfont.woff rename to prosopopee/themes/exposure/static/fonts/crimsontext-bolditalic-webfont.woff diff --git a/prosopopee/static/fonts/crimsontext-bolditalic-webfont.woff2 b/prosopopee/themes/exposure/static/fonts/crimsontext-bolditalic-webfont.woff2 similarity index 100% rename from prosopopee/static/fonts/crimsontext-bolditalic-webfont.woff2 rename to prosopopee/themes/exposure/static/fonts/crimsontext-bolditalic-webfont.woff2 diff --git a/prosopopee/static/fonts/crimsontext-italic-webfont.eot b/prosopopee/themes/exposure/static/fonts/crimsontext-italic-webfont.eot similarity index 100% rename from prosopopee/static/fonts/crimsontext-italic-webfont.eot rename to prosopopee/themes/exposure/static/fonts/crimsontext-italic-webfont.eot diff --git a/prosopopee/static/fonts/crimsontext-italic-webfont.svg b/prosopopee/themes/exposure/static/fonts/crimsontext-italic-webfont.svg similarity index 100% rename from prosopopee/static/fonts/crimsontext-italic-webfont.svg rename to prosopopee/themes/exposure/static/fonts/crimsontext-italic-webfont.svg diff --git a/prosopopee/static/fonts/crimsontext-italic-webfont.ttf b/prosopopee/themes/exposure/static/fonts/crimsontext-italic-webfont.ttf similarity index 100% rename from prosopopee/static/fonts/crimsontext-italic-webfont.ttf rename to prosopopee/themes/exposure/static/fonts/crimsontext-italic-webfont.ttf diff --git a/prosopopee/static/fonts/crimsontext-italic-webfont.woff b/prosopopee/themes/exposure/static/fonts/crimsontext-italic-webfont.woff similarity index 100% rename from prosopopee/static/fonts/crimsontext-italic-webfont.woff rename to prosopopee/themes/exposure/static/fonts/crimsontext-italic-webfont.woff diff --git a/prosopopee/static/fonts/crimsontext-italic-webfont.woff2 b/prosopopee/themes/exposure/static/fonts/crimsontext-italic-webfont.woff2 similarity index 100% rename from prosopopee/static/fonts/crimsontext-italic-webfont.woff2 rename to prosopopee/themes/exposure/static/fonts/crimsontext-italic-webfont.woff2 diff --git a/prosopopee/static/fonts/crimsontext-regular-webfont.eot b/prosopopee/themes/exposure/static/fonts/crimsontext-regular-webfont.eot similarity index 100% rename from prosopopee/static/fonts/crimsontext-regular-webfont.eot rename to prosopopee/themes/exposure/static/fonts/crimsontext-regular-webfont.eot diff --git a/prosopopee/static/fonts/crimsontext-regular-webfont.svg b/prosopopee/themes/exposure/static/fonts/crimsontext-regular-webfont.svg similarity index 100% rename from prosopopee/static/fonts/crimsontext-regular-webfont.svg rename to prosopopee/themes/exposure/static/fonts/crimsontext-regular-webfont.svg diff --git a/prosopopee/static/fonts/crimsontext-regular-webfont.ttf b/prosopopee/themes/exposure/static/fonts/crimsontext-regular-webfont.ttf similarity index 100% rename from prosopopee/static/fonts/crimsontext-regular-webfont.ttf rename to prosopopee/themes/exposure/static/fonts/crimsontext-regular-webfont.ttf diff --git a/prosopopee/static/fonts/crimsontext-regular-webfont.woff b/prosopopee/themes/exposure/static/fonts/crimsontext-regular-webfont.woff similarity index 100% rename from prosopopee/static/fonts/crimsontext-regular-webfont.woff rename to prosopopee/themes/exposure/static/fonts/crimsontext-regular-webfont.woff diff --git a/prosopopee/static/fonts/crimsontext-regular-webfont.woff2 b/prosopopee/themes/exposure/static/fonts/crimsontext-regular-webfont.woff2 similarity index 100% rename from prosopopee/static/fonts/crimsontext-regular-webfont.woff2 rename to prosopopee/themes/exposure/static/fonts/crimsontext-regular-webfont.woff2 diff --git a/prosopopee/static/fonts/crimsontext-semibold-webfont.eot b/prosopopee/themes/exposure/static/fonts/crimsontext-semibold-webfont.eot similarity index 100% rename from prosopopee/static/fonts/crimsontext-semibold-webfont.eot rename to prosopopee/themes/exposure/static/fonts/crimsontext-semibold-webfont.eot diff --git a/prosopopee/static/fonts/crimsontext-semibold-webfont.svg b/prosopopee/themes/exposure/static/fonts/crimsontext-semibold-webfont.svg similarity index 100% rename from prosopopee/static/fonts/crimsontext-semibold-webfont.svg rename to prosopopee/themes/exposure/static/fonts/crimsontext-semibold-webfont.svg diff --git a/prosopopee/static/fonts/crimsontext-semibold-webfont.ttf b/prosopopee/themes/exposure/static/fonts/crimsontext-semibold-webfont.ttf similarity index 100% rename from prosopopee/static/fonts/crimsontext-semibold-webfont.ttf rename to prosopopee/themes/exposure/static/fonts/crimsontext-semibold-webfont.ttf diff --git a/prosopopee/static/fonts/crimsontext-semibold-webfont.woff b/prosopopee/themes/exposure/static/fonts/crimsontext-semibold-webfont.woff similarity index 100% rename from prosopopee/static/fonts/crimsontext-semibold-webfont.woff rename to prosopopee/themes/exposure/static/fonts/crimsontext-semibold-webfont.woff diff --git a/prosopopee/static/fonts/crimsontext-semibold-webfont.woff2 b/prosopopee/themes/exposure/static/fonts/crimsontext-semibold-webfont.woff2 similarity index 100% rename from prosopopee/static/fonts/crimsontext-semibold-webfont.woff2 rename to prosopopee/themes/exposure/static/fonts/crimsontext-semibold-webfont.woff2 diff --git a/prosopopee/static/fonts/crimsontext-semibolditalic-webfont.eot b/prosopopee/themes/exposure/static/fonts/crimsontext-semibolditalic-webfont.eot similarity index 100% rename from prosopopee/static/fonts/crimsontext-semibolditalic-webfont.eot rename to prosopopee/themes/exposure/static/fonts/crimsontext-semibolditalic-webfont.eot diff --git a/prosopopee/static/fonts/crimsontext-semibolditalic-webfont.svg b/prosopopee/themes/exposure/static/fonts/crimsontext-semibolditalic-webfont.svg similarity index 100% rename from prosopopee/static/fonts/crimsontext-semibolditalic-webfont.svg rename to prosopopee/themes/exposure/static/fonts/crimsontext-semibolditalic-webfont.svg diff --git a/prosopopee/static/fonts/crimsontext-semibolditalic-webfont.ttf b/prosopopee/themes/exposure/static/fonts/crimsontext-semibolditalic-webfont.ttf similarity index 100% rename from prosopopee/static/fonts/crimsontext-semibolditalic-webfont.ttf rename to prosopopee/themes/exposure/static/fonts/crimsontext-semibolditalic-webfont.ttf diff --git a/prosopopee/static/fonts/crimsontext-semibolditalic-webfont.woff b/prosopopee/themes/exposure/static/fonts/crimsontext-semibolditalic-webfont.woff similarity index 100% rename from prosopopee/static/fonts/crimsontext-semibolditalic-webfont.woff rename to prosopopee/themes/exposure/static/fonts/crimsontext-semibolditalic-webfont.woff diff --git a/prosopopee/static/fonts/crimsontext-semibolditalic-webfont.woff2 b/prosopopee/themes/exposure/static/fonts/crimsontext-semibolditalic-webfont.woff2 similarity index 100% rename from prosopopee/static/fonts/crimsontext-semibolditalic-webfont.woff2 rename to prosopopee/themes/exposure/static/fonts/crimsontext-semibolditalic-webfont.woff2 diff --git a/prosopopee/static/fonts/montserrat-regular-webfont.eot b/prosopopee/themes/exposure/static/fonts/montserrat-regular-webfont.eot similarity index 100% rename from prosopopee/static/fonts/montserrat-regular-webfont.eot rename to prosopopee/themes/exposure/static/fonts/montserrat-regular-webfont.eot diff --git a/prosopopee/static/fonts/montserrat-regular-webfont.svg b/prosopopee/themes/exposure/static/fonts/montserrat-regular-webfont.svg similarity index 100% rename from prosopopee/static/fonts/montserrat-regular-webfont.svg rename to prosopopee/themes/exposure/static/fonts/montserrat-regular-webfont.svg diff --git a/prosopopee/static/fonts/montserrat-regular-webfont.ttf b/prosopopee/themes/exposure/static/fonts/montserrat-regular-webfont.ttf similarity index 100% rename from prosopopee/static/fonts/montserrat-regular-webfont.ttf rename to prosopopee/themes/exposure/static/fonts/montserrat-regular-webfont.ttf diff --git a/prosopopee/static/fonts/montserrat-regular-webfont.woff b/prosopopee/themes/exposure/static/fonts/montserrat-regular-webfont.woff similarity index 100% rename from prosopopee/static/fonts/montserrat-regular-webfont.woff rename to prosopopee/themes/exposure/static/fonts/montserrat-regular-webfont.woff diff --git a/prosopopee/static/fonts/montserrat-regular-webfont.woff2 b/prosopopee/themes/exposure/static/fonts/montserrat-regular-webfont.woff2 similarity index 100% rename from prosopopee/static/fonts/montserrat-regular-webfont.woff2 rename to prosopopee/themes/exposure/static/fonts/montserrat-regular-webfont.woff2 diff --git a/prosopopee/static/fonts/montserrat-semibold-webfont.eot b/prosopopee/themes/exposure/static/fonts/montserrat-semibold-webfont.eot similarity index 100% rename from prosopopee/static/fonts/montserrat-semibold-webfont.eot rename to prosopopee/themes/exposure/static/fonts/montserrat-semibold-webfont.eot diff --git a/prosopopee/static/fonts/montserrat-semibold-webfont.svg b/prosopopee/themes/exposure/static/fonts/montserrat-semibold-webfont.svg similarity index 100% rename from prosopopee/static/fonts/montserrat-semibold-webfont.svg rename to prosopopee/themes/exposure/static/fonts/montserrat-semibold-webfont.svg diff --git a/prosopopee/static/fonts/montserrat-semibold-webfont.ttf b/prosopopee/themes/exposure/static/fonts/montserrat-semibold-webfont.ttf similarity index 100% rename from prosopopee/static/fonts/montserrat-semibold-webfont.ttf rename to prosopopee/themes/exposure/static/fonts/montserrat-semibold-webfont.ttf diff --git a/prosopopee/static/fonts/montserrat-semibold-webfont.woff b/prosopopee/themes/exposure/static/fonts/montserrat-semibold-webfont.woff similarity index 100% rename from prosopopee/static/fonts/montserrat-semibold-webfont.woff rename to prosopopee/themes/exposure/static/fonts/montserrat-semibold-webfont.woff diff --git a/prosopopee/static/fonts/montserrat-semibold-webfont.woff2 b/prosopopee/themes/exposure/static/fonts/montserrat-semibold-webfont.woff2 similarity index 100% rename from prosopopee/static/fonts/montserrat-semibold-webfont.woff2 rename to prosopopee/themes/exposure/static/fonts/montserrat-semibold-webfont.woff2 diff --git a/prosopopee/static/img/logo.svg b/prosopopee/themes/exposure/static/img/logo.svg similarity index 100% rename from prosopopee/static/img/logo.svg rename to prosopopee/themes/exposure/static/img/logo.svg diff --git a/prosopopee/static/js/baguetteBox.min.js b/prosopopee/themes/exposure/static/js/baguetteBox.min.js similarity index 100% rename from prosopopee/static/js/baguetteBox.min.js rename to prosopopee/themes/exposure/static/js/baguetteBox.min.js diff --git a/prosopopee/static/js/jquery-2.1.4.min.js b/prosopopee/themes/exposure/static/js/jquery-2.1.4.min.js similarity index 100% rename from prosopopee/static/js/jquery-2.1.4.min.js rename to prosopopee/themes/exposure/static/js/jquery-2.1.4.min.js diff --git a/prosopopee/static/js/jquery.panorama_viewer.min.js b/prosopopee/themes/exposure/static/js/jquery.panorama_viewer.min.js similarity index 100% rename from prosopopee/static/js/jquery.panorama_viewer.min.js rename to prosopopee/themes/exposure/static/js/jquery.panorama_viewer.min.js diff --git a/prosopopee/templates/1-small.png b/prosopopee/themes/exposure/templates/1-small.png similarity index 100% rename from prosopopee/templates/1-small.png rename to prosopopee/themes/exposure/templates/1-small.png diff --git a/prosopopee/templates/1.png b/prosopopee/themes/exposure/templates/1.png similarity index 100% rename from prosopopee/templates/1.png rename to prosopopee/themes/exposure/templates/1.png diff --git a/prosopopee/templates/2-small.png b/prosopopee/themes/exposure/templates/2-small.png similarity index 100% rename from prosopopee/templates/2-small.png rename to prosopopee/themes/exposure/templates/2-small.png diff --git a/prosopopee/templates/2.png b/prosopopee/themes/exposure/templates/2.png similarity index 100% rename from prosopopee/templates/2.png rename to prosopopee/themes/exposure/templates/2.png diff --git a/prosopopee/templates/base.html b/prosopopee/themes/exposure/templates/base.html similarity index 100% rename from prosopopee/templates/base.html rename to prosopopee/themes/exposure/templates/base.html diff --git a/prosopopee/templates/example.html b/prosopopee/themes/exposure/templates/example.html similarity index 100% rename from prosopopee/templates/example.html rename to prosopopee/themes/exposure/templates/example.html diff --git a/prosopopee/templates/gallery-index.html b/prosopopee/themes/exposure/templates/gallery-index.html similarity index 92% rename from prosopopee/templates/gallery-index.html rename to prosopopee/themes/exposure/templates/gallery-index.html index 1902c60..39a7e4f 100644 --- a/prosopopee/templates/gallery-index.html +++ b/prosopopee/themes/exposure/templates/gallery-index.html @@ -28,6 +28,7 @@ +