diff --git a/bin/download_galleries.py b/bin/download_galleries.py index 3789dfe..16b3178 100755 --- a/bin/download_galleries.py +++ b/bin/download_galleries.py @@ -85,18 +85,20 @@ def download_gallery(path): md = MarkdownConverter() content = '\n\n'.join(md.convert_soup(p) for p in soup.select('.field-type-text-with-summary > .field-items > .field-item > p')) + picture = soup.find(class_='picture') + preview = search('https?://kontakt-bamberg.de[-./\w]+', picture.get('style')) + index = target / 'index.md' index.write_text(f'''--- slug: "{slug}" title: {dump(title, Dumper=CDumper).rstrip()} date: {date} +preview: "{unquote(preview[0].rsplit('/', 1)[-1])}" --- {content} ''') - picture = soup.find(class_='picture') - preview = search('https?://kontakt-bamberg.de[-./\w]+', picture.get('style')) download_image(preview[0], target) for a in soup.select('.field-name-field-pictures > .field-items > .field-item > a'): diff --git a/layouts/galerie/section.html b/layouts/galerie/section.html index 3ec62f3..32292d3 100644 --- a/layouts/galerie/section.html +++ b/layouts/galerie/section.html @@ -1,14 +1,5 @@ {{ define "main" }}
{{ .Title }}
- -{{ end }} -{{ .Title }}
- -{{ end }} -{{ .Title }}
+ +{{ end }} +