Browse Source

Add author to the templates

master
Marien Fressinaud 6 years ago
parent
commit
b5a61cf93e
5 changed files with 36 additions and 4 deletions
  1. 2
    0
      Herisson/gallery.html.j2
  2. 2
    0
      Herisson/index.html.j2
  3. 17
    1
      Herisson/style/main.css
  4. 13
    3
      boop.py
  5. 2
    0
      configuration.py

+ 2
- 0
Herisson/gallery.html.j2 View File

<h1 class="app-page-header-title"> <h1 class="app-page-header-title">
<a href="index.html">{{ site_title }}</a> <a href="index.html">{{ site_title }}</a>
</h1> </h1>
<div class="separator"></div>
<a href="{{ site_author_website }}">par {{ site_author }}</a>
</div> </div>
</header> </header>



+ 2
- 0
Herisson/index.html.j2 View File

<h1 class="app-page-header-title"> <h1 class="app-page-header-title">
<a href="index.html">{{ site_title }}</a> <a href="index.html">{{ site_title }}</a>
</h1> </h1>
<div class="separator"></div>
<a href="{{ site_author_website }}">par {{ site_author }}</a>
</div> </div>
</header> </header>



+ 17
- 1
Herisson/style/main.css View File



box-shadow: 0 0 1px #313131; box-shadow: 0 0 1px #313131;
} }
.app-page-header a {
.app-page-header .container {
display: flex;
align-items: center;
}
.app-page-header .container > * {
flex-grow: 0;
}
.app-page-header .container > .separator {
flex-grow: 1;
}
@media(max-width: 70rem) {
.app-page-header .container {
flex-direction: column;
}
}

.app-page-header h1 a {
color: #313131; color: #313131;
text-decoration: none; text-decoration: none;
} }

+ 13
- 3
boop.py View File

from jinja2 import Environment, PackageLoader, select_autoescape from jinja2 import Environment, PackageLoader, select_autoescape
from PIL import Image, ExifTags from PIL import Image, ExifTags


from configuration import SITE_TITLE, THEME
from configuration import SITE_TITLE, SITE_AUTHOR, SITE_AUTHOR_WEBSITE, THEME




PICTURES_DIR_NAME = "photos" PICTURES_DIR_NAME = "photos"


with open(index_path, "w") as index_file: with open(index_path, "w") as index_file:
index_file.write( index_file.write(
index_template.render(galleries=galleries, site_title=SITE_TITLE)
index_template.render(
galleries=galleries,
site_title=SITE_TITLE,
site_author=SITE_AUTHOR,
site_author_website=SITE_AUTHOR_WEBSITE,
)
) )






with open(gallery_index_path, "w") as gallery_file: with open(gallery_index_path, "w") as gallery_file:
gallery_file.write( gallery_file.write(
gallery_template.render(gallery=gallery, site_title=SITE_TITLE)
gallery_template.render(
gallery=gallery,
site_title=SITE_TITLE,
site_author=SITE_AUTHOR,
site_author_website=SITE_AUTHOR_WEBSITE,
)
) )





+ 2
- 0
configuration.py View File

SITE_TITLE = "Balades européennes" SITE_TITLE = "Balades européennes"
SITE_AUTHOR = "@marien"
SITE_AUTHOR_WEBSITE = "https://marienfressinaud.fr"
THEME = "Herisson" THEME = "Herisson"

Loading…
Cancel
Save