Add cover images to albums. If a cover.jpg doesn't exist, use the first image
This commit is contained in:
parent
2875805444
commit
217950eeaf
3 changed files with 62 additions and 16 deletions
|
|
@ -9,19 +9,30 @@
|
|||
</p>
|
||||
{% endif %}
|
||||
|
||||
{% if not album_dir.is_root %}
|
||||
<h1>{{album_dir.path.name}}</h1>
|
||||
{% endif %}
|
||||
{% if album_dir.children %}
|
||||
<ul id="album-children">
|
||||
<div id="album-children">
|
||||
{% for child in album_dir.children %}
|
||||
<li class="album">
|
||||
<div class="album">
|
||||
<a href="{{child.path.name}}/">
|
||||
<div>
|
||||
{% if child.cover_path %}
|
||||
<img src="{{child.path.name}}/slides/{{child.cover_path.thumbnail_filename()}}" />
|
||||
{% endif %}
|
||||
</div>
|
||||
<div>
|
||||
{{child.path.name}}
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if album_dir.images %}
|
||||
<h2>Photos</h2>
|
||||
<div id="album-photos">
|
||||
{% for image in album_dir.images %}
|
||||
<div class="thumbnail">
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ body {
|
|||
|
||||
#content > * {
|
||||
width: fit-content;
|
||||
margin-top: 1em;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
|
@ -33,6 +34,18 @@ ul {
|
|||
padding-left: 1.5em;
|
||||
}
|
||||
|
||||
#album-children {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
#album-children > * {
|
||||
margin: 1em;
|
||||
padding: 0.75em;
|
||||
background-color: lightgrey;
|
||||
}
|
||||
|
||||
#album-photos {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue