From f7c32714671050d56e90d184ccc15436c14ecddf Mon Sep 17 00:00:00 2001 From: paoloredis Date: Tue, 18 Feb 2025 10:32:43 +0100 Subject: [PATCH 1/3] Use relURL for relative links --- layouts/commands/list.html | 12 +----- layouts/commands/single.html | 4 +- layouts/develop/single.html | 2 +- layouts/home.html | 31 ++++++--------- layouts/integrate/list.html | 12 +----- layouts/integrate/single.html | 11 +----- layouts/integration/list.html | 11 +----- layouts/integration/single.html | 11 +----- layouts/operate/single.html | 2 +- layouts/partials/docs-nav-collapsed.html | 8 ++-- layouts/partials/docs-nav.html | 17 ++------- layouts/partials/favicons.html | 48 ++++++++++-------------- layouts/partials/fonts.html | 34 ++++++----------- layouts/shortcodes/image.html | 12 +----- 14 files changed, 61 insertions(+), 154 deletions(-) diff --git a/layouts/commands/list.html b/layouts/commands/list.html index 00ea315b15..e3e79d406a 100644 --- a/layouts/commands/list.html +++ b/layouts/commands/list.html @@ -1,19 +1,9 @@ {{ define "head" }} - {{ $base := .Site.BaseURL }} - {{ $parsed := urls.Parse $base }} - {{ $path := $parsed.Path }} - {{ if (eq $path "/") }} - {{ .Scratch.Set "path" ""}} - {{ else }} - {{ .Scratch.Set "path" $path}} - {{ end }} - {{ $basePath := .Scratch.Get "path" }} - + {{ end }} {{ define "main" }} {{ partial "path-scratch.html" }} - {{ $basePath := .Scratch.Get "path" }}
{{ partial "docs-nav-collapsed.html" . }}
diff --git a/layouts/commands/single.html b/layouts/commands/single.html index 1306fdb077..2963800351 100644 --- a/layouts/commands/single.html +++ b/layouts/commands/single.html @@ -1,6 +1,6 @@ {{ define "head" }} - - + + {{ end }} {{ define "main" }} diff --git a/layouts/develop/single.html b/layouts/develop/single.html index 7d765a6bc3..a157d84ad3 100644 --- a/layouts/develop/single.html +++ b/layouts/develop/single.html @@ -1,5 +1,5 @@ {{ define "head" }} - + {{ end }} {{ define "main" }} diff --git a/layouts/home.html b/layouts/home.html index 4633210ba0..5bbb69c566 100644 --- a/layouts/home.html +++ b/layouts/home.html @@ -1,15 +1,6 @@ {{ define "head" }} -{{ $base := .Site.BaseURL }} -{{ $parsed := urls.Parse $base }} -{{ $path := $parsed.Path }} -{{ if (eq $path "/") }} - {{ .Scratch.Set "path" ""}} -{{ else }} - {{ .Scratch.Set "path" $path}} -{{ end }} - - + {{ end }} {{ define "main" }} @@ -48,11 +39,11 @@

{{ .Title }}

@@ -60,13 +51,13 @@

{{ .Title }}

diff --git a/layouts/integrate/list.html b/layouts/integrate/list.html index 1a90bb275c..793e67a8cb 100644 --- a/layouts/integrate/list.html +++ b/layouts/integrate/list.html @@ -1,19 +1,9 @@ {{ define "head" }} - {{ $base := .Site.BaseURL }} - {{ $parsed := urls.Parse $base }} - {{ $path := $parsed.Path }} - {{ if (eq $path "/") }} - {{ .Scratch.Set "path" ""}} - {{ else }} - {{ .Scratch.Set "path" $path}} - {{ end }} - {{ $basePath := .Scratch.Get "path" }} - + {{ end }} {{ define "main" }} {{ partial "path-scratch.html" }} - {{ $basePath := .Scratch.Get "path" }}
{{ partial "docs-nav-collapsed.html" . }}
diff --git a/layouts/integrate/single.html b/layouts/integrate/single.html index cbd173de9f..786f266dfb 100644 --- a/layouts/integrate/single.html +++ b/layouts/integrate/single.html @@ -1,14 +1,5 @@ {{ define "head" }} -{{ $base := .Site.BaseURL }} -{{ $parsed := urls.Parse $base }} -{{ $path := $parsed.Path }} -{{ if (eq $path "/") }} - {{ .Scratch.Set "path" ""}} -{{ else }} - {{ .Scratch.Set "path" $path}} -{{ end }} -{{ $basePath := .Scratch.Get "path" }} - + {{ end }} {{ define "main" }} diff --git a/layouts/integration/list.html b/layouts/integration/list.html index 4e7ec20fff..1147bc0478 100644 --- a/layouts/integration/list.html +++ b/layouts/integration/list.html @@ -1,14 +1,5 @@ {{ define "head" }} -{{ $base := .Site.BaseURL }} -{{ $parsed := urls.Parse $base }} -{{ $path := $parsed.Path }} -{{ if (eq $path "/") }} - {{ .Scratch.Set "path" ""}} -{{ else }} - {{ .Scratch.Set "path" $path}} -{{ end }} -{{ $basePath := .Scratch.Get "path" }} - + {{ end }} {{ define "main" }} diff --git a/layouts/integration/single.html b/layouts/integration/single.html index e81fd37bed..a561346c87 100644 --- a/layouts/integration/single.html +++ b/layouts/integration/single.html @@ -1,14 +1,5 @@ {{ define "head" }} -{{ $base := .Site.BaseURL }} -{{ $parsed := urls.Parse $base }} -{{ $path := $parsed.Path }} -{{ if (eq $path "/") }} - {{ .Scratch.Set "path" ""}} -{{ else }} - {{ .Scratch.Set "path" $path}} -{{ end }} -{{ $basePath := .Scratch.Get "path" }} - + {{ end }} {{ define "main" }} diff --git a/layouts/operate/single.html b/layouts/operate/single.html index 2453cd5740..a3cc707839 100644 --- a/layouts/operate/single.html +++ b/layouts/operate/single.html @@ -1,5 +1,5 @@ {{ define "head" }} - + {{ end }} {{ define "main" }} diff --git a/layouts/partials/docs-nav-collapsed.html b/layouts/partials/docs-nav-collapsed.html index b247fd4a8b..a7d4ad5e73 100644 --- a/layouts/partials/docs-nav-collapsed.html +++ b/layouts/partials/docs-nav-collapsed.html @@ -3,9 +3,9 @@ {{ $navRoot := cond (eq .Site.Home.Type "docs") .Site.Home .FirstSection -}} {{ if in (slice "Commands" "Integrate") $navRoot.LinkTitle }} {{ end }} diff --git a/layouts/partials/docs-nav.html b/layouts/partials/docs-nav.html index 9144473034..be37752ae8 100644 --- a/layouts/partials/docs-nav.html +++ b/layouts/partials/docs-nav.html @@ -53,34 +53,25 @@ {{- end }} -{{ $base := .Site.BaseURL }} -{{ $parsed := urls.Parse $base }} -{{ $path := $parsed.Path }} -{{ if (eq $path "/") }} - {{ .Scratch.Set "path" ""}} -{{ else }} - {{ .Scratch.Set "path" $path}} -{{ end }} -