From e3f7fbe39d7b24d43e80a3c95aa3d940731ac535 Mon Sep 17 00:00:00 2001 From: Jan Steinke Date: Wed, 14 Jul 2021 15:29:08 +0200 Subject: [PATCH] enable hosting the website also on other domains (#355) --- layouts/index.html | 4 ++-- layouts/partials/func/GetFeaturedImage.html | 10 +++++----- layouts/partials/social-share.html | 2 +- layouts/partials/summary-with-image.html | 6 +++--- layouts/partials/summary.html | 2 +- layouts/post/summary-with-image.html | 2 +- layouts/post/summary.html | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/layouts/index.html b/layouts/index.html index cc06ad406..bb3c5a52d 100755 --- a/layouts/index.html +++ b/layouts/index.html @@ -38,7 +38,7 @@

{{ i18n "more" }}

{{/* Now, range through the next four after the initial $n_posts items. Nest the requirements, "after" then "first" on the outside */}} {{ range (first 4 (after $n_posts $section)) }}

- + {{ .Title }}

@@ -46,7 +46,7 @@

{{/* As above, Use $section_name to get the section title, and URL. Use "with" to only show it if it exists */}} {{ with .Site.GetPage "section" $section_name }} - {{ i18n "allTitle" . }} + {{ i18n "allTitle" . }} {{ end }} {{ end }} diff --git a/layouts/partials/func/GetFeaturedImage.html b/layouts/partials/func/GetFeaturedImage.html index c00b08688..a6219c784 100644 --- a/layouts/partials/func/GetFeaturedImage.html +++ b/layouts/partials/func/GetFeaturedImage.html @@ -1,8 +1,8 @@ {{/* GetFeaturedImage - This partial gets the url for featured image for a given page. - + This partial gets the url for featured image for a given page. + If a featured_image was set in the page's front matter, then that will be used. If not set, this will search page resources to find an image that contains the word @@ -11,7 +11,7 @@ If no featured_image was set, and there's no "cover" image in page resources, then this partial returns an empty string (which evaluates to false). - @return Permalink to featured image, or an empty string if not found. + @return RelPermalink to featured image, or an empty string if not found. */}} @@ -26,10 +26,10 @@ {{ else }} {{ $img := (.Resources.ByType "image").GetMatch "*cover*" }} {{ with $img }} - {{ $linkToCover = .Permalink }} + {{ $linkToCover = .RelPermalink }} {{ end }} {{ end }} {{/* return either a permalink, or an empty string. Note that partials can only have a single return statement, so this needs to be at the end of the partial (and not in the if block) */}} -{{ return $linkToCover }} \ No newline at end of file +{{ return $linkToCover }} diff --git a/layouts/partials/social-share.html b/layouts/partials/social-share.html index eb313c06c..4ce1893c0 100644 --- a/layouts/partials/social-share.html +++ b/layouts/partials/social-share.html @@ -1,5 +1,5 @@ {{ $title := .Title }} -{{ $url := printf "%s" .Permalink | absLangURL }} +{{ $url := printf "%s" .RelPermalink | absLangURL }} {{ $icon_size := "32px" }} {{ if not .Params.disable_share }} diff --git a/layouts/partials/summary-with-image.html b/layouts/partials/summary-with-image.html index 702a3056d..94666dbb3 100644 --- a/layouts/partials/summary-with-image.html +++ b/layouts/partials/summary-with-image.html @@ -6,21 +6,21 @@ {{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}} {{ $featured_image := (trim $featured_image "/") | absURL }} {{ end }} diff --git a/layouts/partials/summary.html b/layouts/partials/summary.html index 65b3eaad1..d9cd9c68f 100644 --- a/layouts/partials/summary.html +++ b/layouts/partials/summary.html @@ -2,7 +2,7 @@
{{ humanize .Section }}

- + {{ .Title }}

diff --git a/layouts/post/summary-with-image.html b/layouts/post/summary-with-image.html index 3afac67d4..fd02963a3 100644 --- a/layouts/post/summary-with-image.html +++ b/layouts/post/summary-with-image.html @@ -1,5 +1,5 @@