move default theme in themes folder
@ -1,4 +1,2 @@
|
||||
recursive-include templates *
|
||||
recursive-include static *
|
||||
recursive-include themes *
|
||||
include requirements.txt
|
||||
|
@ -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")]))
|
||||
|
||||
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], "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")
|
||||
elif 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"))
|
||||
|
||||
for gallery in dirs:
|
||||
gallery_settings = yaml.safe_load(open(os.path.join(os.getcwd(), gallery, "settings.yaml"), "r"))
|
||||
|
Before Width: | Height: | Size: 211 KiB After Width: | Height: | Size: 211 KiB |
Before Width: | Height: | Size: 194 KiB After Width: | Height: | Size: 194 KiB |
Before Width: | Height: | Size: 184 KiB After Width: | Height: | Size: 184 KiB |
Before Width: | Height: | Size: 193 KiB After Width: | Height: | Size: 193 KiB |
Before Width: | Height: | Size: 187 KiB After Width: | Height: | Size: 187 KiB |
Before Width: | Height: | Size: 184 KiB After Width: | Height: | Size: 184 KiB |
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 69 KiB |
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 69 KiB |
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 KiB |
Before Width: | Height: | Size: 1.4 MiB After Width: | Height: | Size: 1.4 MiB |
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
Before Width: | Height: | Size: 168 KiB After Width: | Height: | Size: 168 KiB |
Before Width: | Height: | Size: 86 KiB After Width: | Height: | Size: 86 KiB |
@ -28,6 +28,7 @@
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="../static/js/jquery-2.1.4.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="../static/js/materialize.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="../static/js/baguetteBox.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="../static/js/jquery.panorama_viewer.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
@ -41,6 +42,11 @@
|
||||
overlay: true
|
||||
});
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
$('.scrollspy').scrollSpy();
|
||||
});
|
||||
|
||||
</script>
|
||||
<footer>
|
||||
<p>Generated using <a href="https://github.com/psycojoker/prosopopee">Prosopopée</a> · content under <a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a> · atom logo by <a href="https://thenounproject.com/jjjon/">Jonathan Li</a> under <a href="https://creativecommons.org/licenses/by/3.0/">CC-BY</a></p>
|
@ -1,8 +1,10 @@
|
||||
<section class="paragraph">
|
||||
{% if section.title %}
|
||||
<div id="{{ section.title }}" class="scrollspy">
|
||||
<h2>{{ section.title }}</h2>
|
||||
{% else %}
|
||||
<div class="separator"><div>
|
||||
{% endif %}
|
||||
<p>{{ section.text }}</p>
|
||||
</div>
|
||||
</section>
|
2
setup.py
@ -30,6 +30,6 @@ setup(name='prosopopee',
|
||||
keywords='',
|
||||
include_package_data=True,
|
||||
package_data={
|
||||
'prosopopee': ["themes/*/*/*/*"] + ["static/%s/*" % x for x in os.listdir("./prosopopee/static/")] + ['templates/*.html', 'templates/sections/*'],
|
||||
'prosopopee': ['themes/*/*/*/*'] + ['themes/*/templates/*.html'] + ['themes/*/templates/section/*.html']
|
||||
},
|
||||
)
|
||||
|