Skip to content

Commit

Permalink
Set photo's <title> to {album} - {index} / {total}
Browse files Browse the repository at this point in the history
It's zero-indexed

Refs #33
  • Loading branch information
maartenberg committed Apr 24, 2019
1 parent 83fd6bb commit 7b60ec2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion design/photo.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{% if img_next %}
<link rel="prefetch" href="{{ img_baseurl }}/{{ img_next.get_name("display_w_1600") }}.jpg">
{% endif %}
<title>pxl</title>
<title>{{ title }}</title>
</head>
<body>
{% if img_prev %}
Expand Down
3 changes: 3 additions & 0 deletions pxl/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def build(
image_dir = album_dir / str(image.remote_uuid)
image_dir.mkdir()

title = f"{album.name_display} - {i} / {len(album.images) - 1}"

with (image_dir / "index.html").open("w+") as f:
img_prev = album.images[i - 1] if i - 1 >= 0 else None
img_next = album.images[i + 1] if i + 1 < len(album.images) else None
Expand All @@ -46,6 +48,7 @@ def build(
img_next=img_next,
img_baseurl=bucket_puburl,
album_name=album.name_nav,
title=title,
).dump(f)


Expand Down

0 comments on commit 7b60ec2

Please sign in to comment.