Skip to content
Permalink
Browse files

Added support for very simple photo galleries

Also added six photos to Stonehenge: https://www.niche-museums.com/browse/museums/76
  • Loading branch information
simonw committed Dec 26, 2019
1 parent 14518f3 commit be1ed749feb8e2e3e9d8c32eddda4ab226f2c296
Showing with 43 additions and 2 deletions.
  1. +7 −0 museums.yaml
  2. +27 −2 static/museums.css
  3. +9 −0 templates/row-browse-museums.html
@@ -1473,3 +1473,10 @@
publication: The Telegraph
author: Phoebe Southworth
date: 2019-05-08
photos:
- url: https://niche-museums.imgix.net/stonehenge-1.jpeg
- url: https://niche-museums.imgix.net/stonehenge-2.jpeg
- url: https://niche-museums.imgix.net/stonehenge-3.jpeg
- url: https://niche-museums.imgix.net/stonehenge-4.jpeg
- url: https://niche-museums.imgix.net/stonehenge-5.jpeg
- url: https://niche-museums.imgix.net/stonehenge-6.jpeg
@@ -1439,7 +1439,6 @@ body {
max-width: 800px;
margin: 0 auto;
}

.distance-away {
font-size: 0.8em;
font-weight: bold;
@@ -1597,4 +1596,30 @@ span.permanently-closed {
text-align: right;
font-size: 0.8em;
opacity: 0.8;
}
}

.photos {
padding-top: 0;
padding-bottom: 1.5rem;
}
.masonry {
column-gap: 10px;
}
.masonry a {
display: inline-block;
/* display: block here caused Safari to sometimes split the margin
across two columns, resulting in misalingment of the top item in
a column */
width: 100%;
padding-bottom: 6px;
}
@media (min-width: 400px) {
.masonry {
column-count: 2;
}
}
@media (min-width: 600px) {
.masonry {
column-count: 3;
}
}
@@ -51,6 +51,15 @@
<section class="section" id="cards">
{% include "_museum_card.html" %}
</section>
{% if museum.photos %}
<section class="section photos">
<div class="masonry">
{% for photo in json.loads(museum.photos) %}
<a href="{{ photo.url }}?w=1200&auto=compress"><img src="{{ photo.url }}?w=400&auto=compress"{% if photo.alt %} alt="{{ photo.alt }}"{% endif %}></a>
{% endfor %}
</div>
</section>
{% endif %}
{% if museum.press %}
<section class="section articles">
<div class="box content">

0 comments on commit be1ed74

Please sign in to comment.
You can’t perform that action at this time.