mirror of https://github.com/onweru/compose.git

weru
26.49.2020 31211ae6797f5be399d4b72c6b8325a8f309380d
add gallery support
1 files added
1 files modified
21 ■■■■■ changed files
assets/sass/_components.sass 12 ●●●●● patch | view | raw | blame | history
layouts/shortcodes/gallery.html 9 ●●●●● patch | view | raw | blame | history
assets/sass/_components.sass
@@ -124,3 +124,15 @@
        transform-origin: 50% 50%
        transform: rotate(145deg)
        right: 0.45rem
.gallery
  width: 100%
  column-count: 3
  column-gap: 1rem
  @media screen and (max-width: 667px)
    column-count: 2
  &_item
    background-color: transparent
    margin: 0 0 1rem
  &_image
    margin: 0 auto
layouts/shortcodes/gallery.html
New file
@@ -0,0 +1,9 @@
{{- $images := split (replace (.Get 0) ", " ",") "," }}
{{- $descriptions := split (replace (.Get 1) ":: " "::") "::" }}
<div class="gallery">
  {{ range $index, $image := $images }}
  <figure class="gallery_item">
    <img src="{{ absURL $image }} " class="gallery_image"{{ with $descriptions }}{{ with (index . $index) }} alt="{{ . }}"{{ end }}{{ end }}/>
  </figure>
  {{ end }}
</div>