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

35 lines
1.2 KiB
HTML

{{ define "main" }}
<div id="main">
<div class="container">
{{ partial "content.html" . }}
{{ $id := .Params.photoset }}
{{ $query := querify "format" "json" "nojsoncallback" "1" "api_key" (getenv "FLICKR_API_KEY") }}
{{ $method := querify "method" "flickr.photosets.getPhotos" "user_id" (getenv "FLICKR_USER_ID") "photoset_id" $id "extras" "url_k,url_q" }}
{{ $photoset := (getJSON "https://api.flickr.com/services/rest/?" $query "&" $method).photoset }}
<div id="light-gallery" class="row">
{{ range $element := $photoset.photo }}
<a href="{{ $element.url_k }}" title="{{ $element.title }}" class="col-md-2 col-xs-12">
<img src="{{ $element.url_q }}" alt="{{ $element.title }}" referrerpolicy="no-referrer" decoding="async" loading="lazy"/>
</a>
{{ end }}
</div>
<h4>
<a href="{{ .Site.Data.social.accounts.flickr.link }}sets/{{ $id }}/">
View entire <i>{{ $photoset.title }}</i> album on Flickr
</a>
</h4>
</div>
</div>
{{ end }}
{{ define "style_extra" }}
{{ partial "style.html" "css/lightgallery.css" }}
{{ end }}
{{ define "scripts_extra" }}
{{ partial "script_async.html" "js/lightgallery.min.js" }}
{{ end }}