diff --git a/dlibrary/dlibrary.py b/dlibrary/dlibrary.py index 82cf74f..3498072 100755 --- a/dlibrary/dlibrary.py +++ b/dlibrary/dlibrary.py @@ -865,16 +865,18 @@ def generate(args): 'authors': authors, 'tags': tags, 'thumbnail_path': thumbnail_path, + 'images': images, } works.append(work) - work_dir = site_dir / 'works' / work_id + for work in works: + work_dir = site_dir / 'works' / work['id'] viewer_dir = work_dir / 'view' viewer_dir.mkdir(parents=True, exist_ok=True) with open(work_dir / 'index.html', 'w') as f: - f.write(work_template.render(depth=2, work=work, title=title, images=images)) + f.write(work_template.render(depth=2, work=work, title=work['title'], suggested=works[:5])) with open(viewer_dir / 'index.html', 'w') as f: - f.write(viewer_template.render(depth=3, work=work, title=title, images=images)) + f.write(viewer_template.render(depth=3, work=work, title=work['title'])) def make_categorization(categorization, query, work_filter, work_style_cards=False): categorization_dir = site_dir / categorization diff --git a/dlibrary/static/dlibrary.css b/dlibrary/static/dlibrary.css index fc6aa0b..00c1846 100644 --- a/dlibrary/static/dlibrary.css +++ b/dlibrary/static/dlibrary.css @@ -78,7 +78,7 @@ body { margin-bottom: 25px; } -#card-listing { +.card-listing { display: flex; flex-wrap: wrap; justify-content: center; @@ -115,6 +115,7 @@ body { flex-wrap: wrap; justify-content: center; gap: 30px; + margin-bottom: 40px; } .work-preview { @@ -157,3 +158,7 @@ body { display: inline-block; margin-bottom: 5px; } + +#suggested-subheader { + text-align: center; +} diff --git a/dlibrary/static/index.js b/dlibrary/static/index.js index 2ea74f5..f818247 100644 --- a/dlibrary/static/index.js +++ b/dlibrary/static/index.js @@ -32,7 +32,7 @@ document.addEventListener('DOMContentLoaded', () => { const shuffleButton = document.getElementById('shuffle'); const sortButton = document.getElementById('sort'); const searchBox = document.getElementById('search'); - const listContainer = document.getElementById('card-listing'); + const listContainer = document.getElementById('main-listing'); let ordering = localStorage.getItem('indexOrdering') || 'dateDesc'; let shuffleSeed = parseInt(localStorage.getItem('shuffleSeed')) || newSeed(); diff --git a/dlibrary/templates/categorization.html b/dlibrary/templates/categorization.html index 40e6817..75a4c8b 100644 --- a/dlibrary/templates/categorization.html +++ b/dlibrary/templates/categorization.html @@ -4,7 +4,7 @@ {% from 'utils.html' import urlcat, index, root with context %}
{{ images | length }} |
{{ work['images'] | length }} |