1
Fork 0
theorangeone.net-legacy/layouts/shortcodes/flickr.html

25 lines
1 KiB
HTML
Raw Normal View History

2017-07-09 17:49:45 +01:00
{{ $id := .Get 0 }}
{{ $query := querify "format" "json" "nojsoncallback" "1" "api_key" .Site.Data.flickr.api_key }}
2017-08-05 20:41:29 +01:00
{{ $method := querify "method" "flickr.photosets.getPhotos" "user_id" .Site.Data.flickr.user_id "photoset_id" $id "extras" "url_l" }}
2017-07-09 17:49:45 +01:00
{{ $photoset_orig:= (getJSON "https://api.flickr.com/services/rest/?" $query "&" $method).photoset }}
{{ $method := querify "method" "flickr.photosets.getPhotos" "user_id" .Site.Data.flickr.user_id "photoset_id" $id "extras" "url_sq" }}
{{ $photoset_thumb := (getJSON "https://api.flickr.com/services/rest/?" $query "&" $method).photoset }}
<div id="light-gallery" class="row">
{{ range $index, $element := $photoset_orig.photo }}
2017-07-24 09:19:35 +01:00
{{ $thumb := (index $photoset_thumb.photo $index).url_sq }}
2017-08-07 14:00:22 +01:00
<a href="{{ $element.url_l }}" title="{{ $element.title }}" class="col-2">
2017-07-24 09:19:35 +01:00
<img src="{{ $thumb }}" alt="{{ $element.title }}"/>
</a>
2017-07-09 17:49:45 +01:00
{{ end }}
</div>
2017-07-09 21:31:07 +01:00
<h4>
<a href="{{ .Site.Data.social.accounts.flickr.link }}sets/{{ $id }}/">
View entire <i>{{ $photoset_orig.title }}</i> album on Flickr
</a>
</h4>
2017-07-09 17:49:45 +01:00