diff --git a/dlibrary/dlibrary.py b/dlibrary/dlibrary.py index 8959eb5..a24638d 100755 --- a/dlibrary/dlibrary.py +++ b/dlibrary/dlibrary.py @@ -309,6 +309,7 @@ def publish(args): viewer_template = jenv.get_template("viewer.html") list_template = jenv.get_template("list.html") categorization_template = jenv.get_template("categorization.html") + work_template = jenv.get_template("work.html") con = sqlite3.connect(args.destdir / 'meta.db') cur = con.cursor() @@ -339,9 +340,12 @@ def publish(args): images.sort() work_dir = args.destdir / 'site' / 'works' / work_id - work_dir.mkdir(parents=True, exist_ok=True) + viewer_dir = work_dir / 'view' + viewer_dir.mkdir(parents=True, exist_ok=True) with open(work_dir / 'index.html', 'w') as f: - f.write(viewer_template.render(depth=2, work=work, title=title, images=images)) + f.write(work_template.render(depth=2, work=work, title=title, images=images)) + with open(viewer_dir / 'index.html', 'w') as f: + f.write(viewer_template.render(depth=3, work=work, title=title, images=images)) def make_categorization(categorization, query, work_filter): categorization_dir = args.destdir / 'site' / categorization diff --git a/dlibrary/static/dlibrary.css b/dlibrary/static/dlibrary.css index c2a8275..d02110d 100644 --- a/dlibrary/static/dlibrary.css +++ b/dlibrary/static/dlibrary.css @@ -2,11 +2,12 @@ body { background: #111; color: #eee; font-family: sans-serif; + font-size: 18px; } /* listing stuff */ -#list-title, nav { +#title, nav { text-align: center; } @@ -46,6 +47,40 @@ body { max-width: 240px; } +/* work stuff */ + +.work-container { + display: flex; + justify-content: center; + gap: 30px; +} + +.work-info { + max-width: min(50%, 500px); +} + +.work-info td, .work-info th { + vertical-align: top; +} + +.work-info td { + padding-top: 5px; +} + +.work-info th { + text-align: right; + padding-right: 10px; + padding-top: 10px; +} + +.work-info-link { + background: #333; + padding: 5px; + border-radius: 5px; + display: inline-block; + margin-bottom: 5px; +} + /* viewer stuff */ #viewer-images { diff --git a/dlibrary/static/viewer.js b/dlibrary/static/viewer.js index 89760d2..f2dd772 100644 --- a/dlibrary/static/viewer.js +++ b/dlibrary/static/viewer.js @@ -113,7 +113,7 @@ document.addEventListener('DOMContentLoaded', () => { case 13: //enter changeDuration(duration, true); localStorage.setItem(`${WORK_ID}-currentPage`, 0); - window.location.href = ROOT; + window.location.href = "../"; break; } }; diff --git a/dlibrary/templates/categorization.html b/dlibrary/templates/categorization.html index 0aaf4c7..3a5a3ac 100644 --- a/dlibrary/templates/categorization.html +++ b/dlibrary/templates/categorization.html @@ -1,12 +1,13 @@ {% extends "base.html" %} {% block title %}{{ categorization.capitalize() }} - DLibrary{% endblock %} {% block body %} -{% from 'utils.html' import root with context %} -
Circle | +{{ work['circle'] }} | +
---|---|
Authors | +{% for author in work['authors'] %}{{ author }} {% endfor %} | +
Tags | +{% for tag in work['tags'] %}{{ tag }} {% endfor %} | +
Series | +{{ work['series'] }} | +