Browse Source

Fix some mistakes in generation of galleries

master
Marien Fressinaud 5 years ago
parent
commit
69a9fa4e38
2 changed files with 5 additions and 4 deletions
  1. 1
    1
      Herisson/index.html.j2
  2. 4
    3
      boop.py

+ 1
- 1
Herisson/index.html.j2 View File

@@ -23,7 +23,7 @@
<div class="galleries">
{% for gallery in galleries -%}
<div class="gallery-cover">
<a href="{{ gallery.url }}.html">
<a href="{{ gallery.url }}">
<img src="{{ gallery.cover_photo.thumb_url }}" alt="" />
<span class="gallery-cover-name">
{{ gallery.name }}

+ 4
- 3
boop.py View File

@@ -28,7 +28,8 @@ def list_galleries_in(path):
gallery = {
"name": gallery_dir.name,
"path": gallery_dir.path,
"url": gallery_dir.name,
"output_path": gallery_dir.name,
"url": f"{gallery_dir.name}.html",
"num_photos": len(photos),
"photos": photos,
"cover_photo": photos[cover_index],
@@ -93,7 +94,7 @@ def generate_gallery(output_path, gallery):


def generate_gallery_index(output_path, gallery):
gallery_index_path = os.path.join(output_path, f"{gallery['name']}.html")
gallery_index_path = os.path.join(output_path, f"{gallery['url']}")

theme_path = os.path.join(os.curdir, THEME)
jinja_env = Environment(
@@ -113,7 +114,7 @@ def generate_gallery_index(output_path, gallery):


def generate_gallery_dir(output_path, gallery):
gallery_output_path = os.path.join(output_path, gallery["name"])
gallery_output_path = os.path.join(output_path, gallery["output_path"])
if not os.path.isdir(gallery_output_path):
os.mkdir(gallery_output_path)


Loading…
Cancel
Save