add support theme

This commit is contained in:
Adrien Beudin 2016-02-22 14:11:36 +01:00
parent 2f991cab75
commit 8c7dbc5a4a
102 changed files with 36 additions and 12 deletions

View File

@ -1,3 +1,4 @@
recursive-include templates * recursive-include templates *
recursive-include static * recursive-include static *
recursive-include themes *
include requirements.txt include requirements.txt

View File

@ -118,7 +118,16 @@ def main():
# XXX recursively merge directories # XXX recursively merge directories
if os.path.exists(os.path.join(os.getcwd(), "build", "static")): if os.path.exists(os.path.join(os.getcwd(), "build", "static")):
shutil.rmtree(os.path.join(os.getcwd(), "build", "static")) shutil.rmtree(os.path.join(os.getcwd(), "build", "static"))
if os.path.exists(os.path.join(os.getcwd(), "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")):
shutil.copytree(os.path.join(os.getcwd(), "static"), os.path.join(os.getcwd(), "build", "static")) shutil.copytree(os.path.join(os.getcwd(), "static"), os.path.join(os.getcwd(), "build", "static"))
else: 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], "static"), os.path.join(os.getcwd(), "build", "static"))

View File

@ -9,9 +9,10 @@ main {
} }
.parallax-container { .parallax-container {
height: 500px; height: 800px;
min-height: 250px; min-height: 250px;
margin-bottom: 20px; margin-bottom: 20px;
background-color: rgba(0, 0, 0, .4);
} }
.parallax-container h1 { .parallax-container h1 {

View File

Before

Width:  |  Height:  |  Size: 322 KiB

After

Width:  |  Height:  |  Size: 322 KiB

View File

Before

Width:  |  Height:  |  Size: 211 KiB

After

Width:  |  Height:  |  Size: 211 KiB

View File

Before

Width:  |  Height:  |  Size: 194 KiB

After

Width:  |  Height:  |  Size: 194 KiB

View File

Before

Width:  |  Height:  |  Size: 184 KiB

After

Width:  |  Height:  |  Size: 184 KiB

View File

Before

Width:  |  Height:  |  Size: 193 KiB

After

Width:  |  Height:  |  Size: 193 KiB

View File

Before

Width:  |  Height:  |  Size: 187 KiB

After

Width:  |  Height:  |  Size: 187 KiB

View File

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 69 KiB

View File

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 69 KiB

View File

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

View File

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

Before

Width:  |  Height:  |  Size: 168 KiB

After

Width:  |  Height:  |  Size: 168 KiB

View File

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 86 KiB

View File

@ -0,0 +1,14 @@
<div class="container baguette hide-on-med-and-down">
{% set image = Image(section.image) %}
{{ image.copy()}}
<a href="{{ image }}">
<img class="responsive-img" src="{{ image.generate_thumbnail("x2000") }}">
</a>
</div>
<div class="container baguette hide-on-large-only">
{% set image = Image(section.image) %}
{{ image.copy()}}
<a href="{{ image.generate_thumbnail("x1024") }}">
<img class="responsive-img" src="{{ image.generate_thumbnail("x600") }}">
</a>
</div>

View File

@ -1,7 +1,8 @@
{% set image = Image(section.image) %} {% set image = Image(section.image) %}
{{ image.copy() }} {{ image.copy() }}
<div class="parallax-container z-depth-1 valign-wrapper"> <div class="parallax-container z-depth-1 valign-wrapper">
<div class="parallax"><img src="{{ image }}"></div> <div class="parallax hide-on-med-and-down"><img src="{{ image }}"></div>
<div class="parallax hide-on-large-only"><img src="{{ image.generate_thumbnail("x1024") }}"></div>
{% if section.text %} {% if section.text %}
<div class="parallax-tittle white-text"> <div class="parallax-tittle white-text">
<h1>{{ section.text.title }}</h1> <h1>{{ section.text.title }}</h1>

View File

@ -7,11 +7,16 @@
{% set plop = 12 // loop.length %} {% set plop = 12 // loop.length %}
<div class="col m{{ plop }} l{{ plop }}"> <div class="col m{{ plop }} l{{ plop }}">
<div class="card"> <div class="card">
<div class="card-image"> <div class="card-image hide-on-med-and-down">
<a href="{{ image }}"> <a href="{{ image }}">
<img class="responsive-img" src="{{ image.generate_thumbnail("x600") }}"> <img class="responsive-img" src="{{ image.generate_thumbnail("x600") }}">
</a> </a>
</div> </div>
<div class="card-image hide-on-large-only">
<a href="{{ image.generate_thumbnail("x1024") }}">
<img class="responsive-img" src="{{ image.generate_thumbnail("x600") }}">
</a>
</div>
</div> </div>
</div> </div>
{% if not loop.last %} {% if not loop.last %}

Some files were not shown because too many files have changed in this diff Show More