From 092df1044443acfa282fa2b306bcabb98f8b0b59 Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 28 Apr 2023 00:53:55 +0800 Subject: [PATCH] Switch absolute links to relative links This is to make testing and deploying between different versions easier such as Netlify deployments. --- CHANGELOG.adoc | 3 +++ layouts/_default/list.html | 2 +- layouts/_default/single.html | 2 +- layouts/_default/terms.html | 2 +- layouts/partials/components.html | 4 ++-- layouts/partials/footer.html | 2 +- layouts/partials/head.html | 6 +++--- layouts/partials/header.html | 4 ++-- 8 files changed, 14 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 6b66912..1810c0d 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -22,6 +22,9 @@ and this project adheres to https://semver.org/spec/v2.0.0.html[Semantic Version === Updated +* Switch from absolute links to relative links. +This is to make testing between different versions easier such as Netlify builds. + * Update class names of several components. ** `.icon` has been updated to `.site__icon`. diff --git a/layouts/_default/list.html b/layouts/_default/list.html index ee8a78b..5a33ed5 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -11,7 +11,7 @@ Otherwise, we take the pages of a section. */ -}} {{- range (.Paginate $pages).Pages }}
-

{{ .Title }}

+

{{ .Title }}

{{ partial "partials/components/post-meta.html" . }}
{{- end }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 60e9669..a415558 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -50,7 +50,7 @@ {{- $langs := slice }} {{- range .Translations }} {{- $lang := cond (ne .Language.LanguageName nil) .Language.LanguageName .Lang }} - {{ $lang_links = $lang_links | append (printf "%s" .Permalink $lang) }} + {{ $lang_links = $lang_links | append (printf "%s" .RelPermalink $lang) }} {{ $langs = $langs | append $lang }} {{- end }}

{{ i18n "available_translations" }}: {{ delimit $lang_links "," (printf " %s " (i18n "and")) }}

diff --git a/layouts/_default/terms.html b/layouts/_default/terms.html index 149ec12..1853210 100644 --- a/layouts/_default/terms.html +++ b/layouts/_default/terms.html @@ -15,7 +15,7 @@ {{- range $pages }}
  • {{ .PublishDate.Format "2006-01-02" }} - {{ .LinkTitle }} + {{ .LinkTitle }}
  • {{- end }} diff --git a/layouts/partials/components.html b/layouts/partials/components.html index ebecc65..10392bd 100644 --- a/layouts/partials/components.html +++ b/layouts/partials/components.html @@ -13,7 +13,7 @@ "name" $name) (resources.Get "templates/heroicon.svg") }} - + {{ end }} @@ -27,6 +27,6 @@ "name" $name) (resources.Get "templates/simple-icon.svg") }} - + {{- end }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index a3d1dc2..2122382 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -22,7 +22,7 @@ {{ $links := sort .links "id" "asc" }} {{ $links = sort $links "weight" "asc" }} {{- range $links -}} - + {{- if $useImage }} {{- partial "components/simple-icon.html" (dict "id" .id) }} {{- else }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 298a41f..806fbc5 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -17,7 +17,7 @@ {{- if hugo.IsProduction }} {{- $style = $style | resources.Minify | resources.Fingerprint -}} {{- end }} - + {{- /* Persistent theme. It's a very small script so there's little effect on perceived performance. */ -}} - + {{- /* Some sane tags default */ -}} {{ hugo.Generator }} @@ -49,7 +49,7 @@ It's a very small script so there's little effect on perceived performance. */ - {{- /* Linking all of the output formats for discovery. */ -}} {{- range .OutputFormats }} - {{- printf "" .Rel .MediaType.Type .Permalink | safeHTML }} + {{- printf "" .Rel .MediaType.Type .RelPermalink | safeHTML }} {{- end }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 57bff14..472a169 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,11 +1,11 @@