From f6dceb62333890152610997ce8aa5008073553c5 Mon Sep 17 00:00:00 2001 From: James Panther <4462786+jpanther@users.noreply.github.com> Date: Thu, 26 Aug 2021 09:44:41 +1000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=97=EF=B8=8F=20Change=20URLs=20to=20be?= =?UTF-8?q?=20relative=20instead=20of=20absolute?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +++ exampleSite/config.toml | 1 - layouts/_default/taxonomy.html | 2 +- layouts/partials/article-link.html | 2 +- layouts/partials/article-pagination.html | 4 ++-- layouts/partials/author.html | 2 +- layouts/partials/breadcrumbs.html | 2 +- layouts/partials/head.html | 16 ++++++++-------- layouts/partials/header.html | 4 ++-- layouts/partials/home/profile.html | 2 +- layouts/partials/schema.html | 2 +- layouts/shortcodes/figure.html | 4 +--- package.json | 2 +- 13 files changed, 23 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c49a484..cd7e36ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Fathom Analytics script included twice when using custom domain - Recent heading on homepage profile layout misaligned +### Changed +- URLs are relative by default which allows the theme to be more flexible in different deployment scenarios + ## [1.2.0] - 2021-08-22 ### Added - Multiple colour schemes diff --git a/exampleSite/config.toml b/exampleSite/config.toml index a8c65ce3..aec2100e 100755 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -12,7 +12,6 @@ languageCode = "en-AU" defaultContentLanguage = "en" title = "Congo" enableEmoji = true -relativeURLs = true [author] name = "Congo" diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html index 10048652..c01dd486 100644 --- a/layouts/_default/taxonomy.html +++ b/layouts/_default/taxonomy.html @@ -6,7 +6,7 @@

{{ .Page.Title }} {{ if $.Site.Params.taxonomy.showTermCount | default true }} diff --git a/layouts/partials/article-link.html b/layouts/partials/article-link.html index 74678ae1..dd752aee 100644 --- a/layouts/partials/article-link.html +++ b/layouts/partials/article-link.html @@ -17,7 +17,7 @@ {{ else }} {{ .Title }} {{ end }} diff --git a/layouts/partials/article-pagination.html b/layouts/partials/article-pagination.html index 9102afbe..ffab5614 100644 --- a/layouts/partials/article-pagination.html +++ b/layouts/partials/article-pagination.html @@ -5,7 +5,7 @@
{{ if .NextInSection }} - + {{ .NextInSection.Title }} @@ -20,7 +20,7 @@ {{ if .PrevInSection }} - + {{ .PrevInSection.Title }} diff --git a/layouts/partials/author.html b/layouts/partials/author.html index 3b53309c..9dd7a56c 100644 --- a/layouts/partials/author.html +++ b/layouts/partials/author.html @@ -1,7 +1,7 @@ {{ if .Params.showAuthor | default (.Site.Params.article.showAuthor | default true) }}
{{ with .Site.Author.image }} - + {{ end }}
{{ with .Site.Author.name }} diff --git a/layouts/partials/breadcrumbs.html b/layouts/partials/breadcrumbs.html index 8a55af49..a844464a 100644 --- a/layouts/partials/breadcrumbs.html +++ b/layouts/partials/breadcrumbs.html @@ -10,7 +10,7 @@
  • {{ .p1.Title }}/
  • diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 64897f7b..70a3b025 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -24,7 +24,7 @@ {{- end }} {{ range .AlternativeOutputFormats -}} - {{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} + {{ printf `` .Rel .MediaType.Type .RelPermalink $.Site.Title | safeHTML }} {{ end -}} {{/* Styles */}} {{ $schemeCSS := resources.Get (printf "css/schemes/%s.css" (.Site.Params.colorScheme | default "congo")) }} @@ -35,7 +35,7 @@ {{ $mainCSS := resources.Get "css/compiled/main.css" }} @@ -43,7 +43,7 @@ {{ $customCSS := resources.Get "css/custom.css" }} @@ -52,7 +52,7 @@ {{ end }} @@ -60,10 +60,10 @@ {{ if templates.Exists "partials/favicons.html" }} {{ partialCached "favicons.html" .Site }} {{ else }} - - - - + + + + {{ end }} {{/* Site Verification */}} {{ with .Site.Params.verification.google }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 5f55d897..9b480e7f 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -3,7 +3,7 @@ {{ .Site.Title }}
    @@ -13,7 +13,7 @@
  • {{ .Name }} diff --git a/layouts/partials/home/profile.html b/layouts/partials/home/profile.html index b1e565be..2351880f 100644 --- a/layouts/partials/home/profile.html +++ b/layouts/partials/home/profile.html @@ -5,7 +5,7 @@ >
    {{ with .Site.Author.image }} - + {{ end }}

    {{ .Site.Author.name | default .Site.Title }} diff --git a/layouts/partials/schema.html b/layouts/partials/schema.html index 55fdf6cb..1cab618a 100644 --- a/layouts/partials/schema.html +++ b/layouts/partials/schema.html @@ -4,7 +4,7 @@ "@context": "https://schema.org", "@type": "WebSite", "name": "{{ .Site.Title | safeJS }}", - "url": "{{ .Site.BaseURL | safeURL }}", + "url": "{{ (site.GetPage "/").Permalink | safeURL }}", "description": "{{ .Site.Params.description | safeJS }}" } diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html index ac0f6ab2..b9476a83 100644 --- a/layouts/shortcodes/figure.html +++ b/layouts/shortcodes/figure.html @@ -4,7 +4,7 @@ {{- if .Get "link" -}} {{- end -}} - {{ with .Get {{ end }} - - diff --git a/package.json b/package.json index 460538e2..cd0dcb8d 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "dev": "NODE_ENV=development ./node_modules/tailwindcss/lib/cli.js -i ./assets/css/main.css -o ./assets/css/compiled/main.css --jit -w", "build": "NODE_ENV=production ./node_modules/tailwindcss/lib/cli.js -i ./assets/css/main.css -o ./assets/css/compiled/main.css --jit", - "example": "hugo server --source exampleSite --themesDir ../.. --buildDrafts -b http://localhost -p 8008" + "example": "hugo server --source exampleSite --themesDir ../.. --buildDrafts -b http://localhost/congo/ -p 8008" }, "repository": { "type": "git",