From 57dc749fa227ed973f154c6333f9727ff3d234ce Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 17 Dec 2023 12:45:25 -0800 Subject: [PATCH] Photography site generator. --- voussoir.net/photography/generate_site.py | 32 +++++++++++++++-------- voussoir.net/photography/upload.bat | 1 + voussoir.net/photography/upload.winscp | 4 +++ 3 files changed, 26 insertions(+), 11 deletions(-) create mode 100644 voussoir.net/photography/upload.bat create mode 100644 voussoir.net/photography/upload.winscp diff --git a/voussoir.net/photography/generate_site.py b/voussoir.net/photography/generate_site.py index e94839f..7070b49 100644 --- a/voussoir.net/photography/generate_site.py +++ b/voussoir.net/photography/generate_site.py @@ -3,6 +3,7 @@ import io import jinja2 import PIL.Image import sys +import textwrap import urllib.parse import etiquette @@ -68,6 +69,7 @@ class Photo: self.tiny_url = f'{S3_WEBROOT}/{self.tiny_key}' self.anchor_url = f'{DOMAIN_WEBROOT}/{parent_key}#{self.article_id}' self.published = imagetools.get_exif_datetime(self.etq_photo.real_path) + self.exposure_time = imagetools.exifread(self.etq_photo.real_path)['EXIF ExposureTime'].values[0].decimal() def prepare(self): if not self.s3_exists: @@ -129,6 +131,7 @@ class Album: # self.link = webpath(path) self.web_url = f'{PHOTOGRAPHY_WEBROOT}/{self.article_id}' self.published = self.photos[0].published + self.exposure_time = sum(p.exposure_time for p in self.photos) def prepare(self): for photo in self.photos: @@ -141,15 +144,15 @@ class Album:

{{article_id}}

- {% for photo in headliners %} - {{photo.render_web()}} - {% endfor %} + {% for photo in headliners %} + {{photo.render_web()}} + {% endfor %} -
- {% for photo in photos %} - - {% endfor %} -
+
+ {% for photo in photos %} + + {% endfor %} +
''').render( @@ -259,6 +262,12 @@ def make_webpage(items, is_root, doctitle): grid-auto-flow: row; grid-row-gap: 12vh; } + footer + { + display: grid; + grid-auto-flow: row; + grid-row-gap: 8px; + } body.noscrollbar::-webkit-scrollbar { display: none; @@ -449,14 +458,13 @@ def make_webpage(items, is_root, doctitle): {{item.render_web(index=loop.index, totalcount=none if is_root else (items|length))}} {% endfor %} - -

-