diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 11a1b70..f08cf03 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -3,6 +3,13 @@
{{ partial "content.html" . }}
+ + {{ with .Scratch.Get "unsplash_data" }} +
+ Header photo by {{ .user.name }} on Unsplash. +
+ {{ end }} + {{ partial "share.html" . }} {{ partial "related-content.html" . }} diff --git a/layouts/partials/content.html b/layouts/partials/content.html index c327a48..7b2da9c 100644 --- a/layouts/partials/content.html +++ b/layouts/partials/content.html @@ -8,9 +8,10 @@ {{ $query := querify "client_id" (getenv "UNSPLASH_ACCESS_KEY") }} {{ $unsplash_data := (getJSON "https://api.unsplash.com/photos/" $unsplash_id "?" $query )}} {{ .Scratch.Set "image" $unsplash_data.urls.regular }} + {{ .Scratch.Set "unsplash_data" $unsplash_data }} {{ end }} - + {{ end }} {{ partial "breadcrumbs/index.html" . }} diff --git a/layouts/partials/share.html b/layouts/partials/share.html index 3688a0d..8b50d2b 100644 --- a/layouts/partials/share.html +++ b/layouts/partials/share.html @@ -1,5 +1,5 @@ {{ if .Section }} -
+
Share this page