diff options
author | Chip Senkbeil <chip.senkbeil@gmail.com> | 2015-09-25 19:55:08 +0300 |
---|---|---|
committer | Chip Senkbeil <chip.senkbeil@gmail.com> | 2015-09-25 19:55:08 +0300 |
commit | 8144d4dc253c43ac085e3b75390d697dc29a690c (patch) | |
tree | c89fb1676439b38c2dd7b2db8460d92f482cf3f2 | |
parent | aded25437755eafed8e8e3107a35a6625c4e5892 (diff) |
Refactored gallery into section with partials
-rw-r--r-- | layouts/gallery/single.html | 15 | ||||
-rw-r--r-- | layouts/partials/gallery/collection.html | 7 | ||||
-rw-r--r-- | layouts/partials/gallery/item.html | 20 | ||||
-rw-r--r-- | layouts/section/gallery.html | 16 | ||||
-rw-r--r-- | layouts/shortcodes/gallery.html | 24 |
5 files changed, 58 insertions, 24 deletions
diff --git a/layouts/gallery/single.html b/layouts/gallery/single.html new file mode 100644 index 0000000..7ba3cd7 --- /dev/null +++ b/layouts/gallery/single.html @@ -0,0 +1,15 @@ +{{ partial "html-start.html" . }} +{{ partial "head.html" . }} + +<body class="page-colors minimum-viewport-height"> + {{ partial "main-menu.html" . }} + + <section class="main-content"> + {{ partial "gallery/item" . }} + </section> + + {{ partial "js.html" . }} +</body> + +{{ partial "html-end.html" . }} + diff --git a/layouts/partials/gallery/collection.html b/layouts/partials/gallery/collection.html new file mode 100644 index 0000000..d759768 --- /dev/null +++ b/layouts/partials/gallery/collection.html @@ -0,0 +1,7 @@ + +<div class="masonry-flex-container"> + {{ range .Paginator.Pages }} + {{ partial "gallery/item.html" . }} + {{ end }} +</div> + diff --git a/layouts/partials/gallery/item.html b/layouts/partials/gallery/item.html new file mode 100644 index 0000000..e5c6f31 --- /dev/null +++ b/layouts/partials/gallery/item.html @@ -0,0 +1,20 @@ + +{{ $url := $.Site.BaseURL }} +{{ $image := .Params.image | urlize }} +{{ $date := dateFormat "Mon Jan 06, 2006" .Date }} +{{ $title := .Title }} +<!-- TODO: Figure out why line height causes issues here --> +<div class="flex-item flex-item-spacing no-line-height"> + <div class="relative rounded-corners z-depth-1 lazyload" data-noscript=""> + <noscript> + <a href="{{ $url }}{{ $image }}" data-lightbox="gallery" data-title="{{ $title }}"> + <img src="{{ $url }}{{ $image }}" + class="fill-container-width rounded-corners z-depth-1" /> + <div class="highlight-block rounded-corners"> + <h3 class="white-text">{{ $date }}</h3> + </div> + </a> + </noscript> + </div> +</div> + diff --git a/layouts/section/gallery.html b/layouts/section/gallery.html new file mode 100644 index 0000000..e99c978 --- /dev/null +++ b/layouts/section/gallery.html @@ -0,0 +1,16 @@ +{{ partial "html-start.html" . }} +{{ partial "head.html" . }} + +<body class="page-colors minimum-viewport-height"> + {{ partial "main-menu.html" . }} + + <section class="main-content"> + {{ partial "gallery/collection.html" . }} + {{ partial "pagination.html" . }} + </section> + + {{ partial "js.html" . }} +</body> + +{{ partial "html-end.html" . }} + diff --git a/layouts/shortcodes/gallery.html b/layouts/shortcodes/gallery.html deleted file mode 100644 index 3a8aa70..0000000 --- a/layouts/shortcodes/gallery.html +++ /dev/null @@ -1,24 +0,0 @@ -{{ $dir := .Get "dir" }} -{{ $url := .Get "baseurl" }} -{{ $files := readDir $dir }} - -<div class="masonry-flex-container"> - {{ range $files }} - {{ $date := dateFormat "Mon Jan 06, 2006" .ModTime }} - <!-- TODO: Figure out why line height causes issues here --> - <div class="flex-item flex-item-spacing no-line-height"> - <div class="relative rounded-corners z-depth-1 lazyload" data-noscript=""> - <noscript> - <a href="{{ $url }}{{ .Name | urlize }}" data-lightbox="{{ $dir }}" data-title="{{ $date }}"> - <img src="{{ $url }}{{ .Name | urlize }}" - class="fill-container-width rounded-corners z-depth-1" /> - <div class="highlight-block rounded-corners"> - <h3 class="white-text">{{ $date }}</h3> - </div> - </a> - </noscript> - </div> - </div> - {{ end }} -</div> - |