diff options
Diffstat (limited to 'themes/default/layouts/partials')
6 files changed, 16 insertions, 10 deletions
diff --git a/themes/default/layouts/partials/author-header.html b/themes/default/layouts/partials/author-header.html index 9c969c9..a1e43d2 100644 --- a/themes/default/layouts/partials/author-header.html +++ b/themes/default/layouts/partials/author-header.html @@ -8,6 +8,7 @@ {{- $image := partial "function-caches-images.html" (dict + "Context" . "Source" $header "Resize" "x600" "Target" (print (partial "function-paths.html" "media") "/" $author.user "/") diff --git a/themes/default/layouts/partials/author-section-picture.html b/themes/default/layouts/partials/author-section-picture.html index 5b718d4..a3ff1f7 100644 --- a/themes/default/layouts/partials/author-section-picture.html +++ b/themes/default/layouts/partials/author-section-picture.html @@ -8,6 +8,7 @@ {{- $image := partial "function-caches-images.html" (dict + "Context" . "Source" $profile "Fit" "160x160" "Target" (print (partial "function-paths.html" "media") "/" $author.user "/") diff --git a/themes/default/layouts/partials/function-caches-images.html b/themes/default/layouts/partials/function-caches-images.html index 2102bef..c99103b 100644 --- a/themes/default/layouts/partials/function-caches-images.html +++ b/themes/default/layouts/partials/function-caches-images.html @@ -1,3 +1,4 @@ +{{- $pageContext := .Context -}} {{- $data := dict -}} {{- $source := or .Source "nil" -}} {{- $fit := .Fit -}} @@ -47,7 +48,7 @@ -}} {{- end -}} {{- else -}} - {{- with $image := resources.GetRemote $source -}} + {{- with $image := cond (default true $pageContext.Site.Params.site.offline) false (resources.GetRemote $source) -}} {{- with .Err -}} {{- if $localized -}} {{- $directory := path.Dir $local -}} diff --git a/themes/default/layouts/partials/function-fetch-favicons.html b/themes/default/layouts/partials/function-fetch-favicons.html index 1d52c7e..7f92a94 100644 --- a/themes/default/layouts/partials/function-fetch-favicons.html +++ b/themes/default/layouts/partials/function-fetch-favicons.html @@ -1,12 +1,14 @@ -{{- $source := .Source -}} -{{- $infix := .Infix -}} +{{- $source := .Source -}} +{{- $infix := .Infix -}} +{{- $pageContext := .Context -}} {{- $output := partial "function-caches-images.html" (dict - "Source" $source - "Fit" "160x160" - "Target" (print (partial "function-paths.html" "media") "/") - "Copy" (print (partial "function-paths.html" "media") "/favicon." $infix ".png") + "Context" $pageContext + "Source" $source + "Fit" "160x160" + "Target" (print (partial "function-paths.html" "media") "/") + "Copy" (print (partial "function-paths.html" "media") "/favicon." $infix ".png") ) -}} diff --git a/themes/default/layouts/partials/function-generate-feeds.html b/themes/default/layouts/partials/function-generate-feeds.html index 0bbaf46..42ffd8b 100644 --- a/themes/default/layouts/partials/function-generate-feeds.html +++ b/themes/default/layouts/partials/function-generate-feeds.html @@ -10,7 +10,7 @@ {{- $url := delimit (first 1 $data) "" -}} {{- $retitle := trim (delimit (after 1 $data) " ") " " -}} - {{- with $fetch := resources.GetRemote $url -}} + {{- with $fetch := cond (default true $.Site.Params.site.offline) false (resources.GetRemote $url) -}} {{- with $error := .Err -}} {{- warnf "Feed fetch %s" $error -}} @@ -197,6 +197,7 @@ {{- $imageSource := partial "function-fetch-favicons.html" (dict + "Context" $.Page "Source" $favicon "Infix" (.FeedSourceLink | anchorize) ) diff --git a/themes/default/layouts/partials/video-container.html b/themes/default/layouts/partials/video-container.html index 7d934e6..af1a50d 100644 --- a/themes/default/layouts/partials/video-container.html +++ b/themes/default/layouts/partials/video-container.html @@ -22,7 +22,7 @@ {{- end -}} {{- if $notCached -}} - {{- with $remote := resources.GetRemote .Source -}} + {{- with $remote := cond (default true $.Context.Site.Params.site.offline) false (resources.GetRemote .Source) -}} {{- with .Err -}} {{- warnf "Video fetch %s" . -}} {{- if not (fileExists $public) -}} @@ -33,7 +33,7 @@ {{- $cache = $cache.Permalink -}} {{- end -}} {{- else -}} - {{- $caption = "No remote video data found for source" -}} + {{- $caption = "Unable to load remote source data" -}} {{- end -}} {{- else -}} {{- with $cache = resources.Get (path.Join "public/" $fileCache) -}} |