From 83749c6d327981816f267d842a99fd18c8f63f7e Mon Sep 17 00:00:00 2001 From: Martin Hinshelwood Date: Mon, 28 Jul 2025 16:48:38 +0100 Subject: [PATCH 1/5] Refactor canonical URL handling for guide versions --- .../_partials/functions/get-canonical-url.html | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/module/layouts/_partials/functions/get-canonical-url.html b/module/layouts/_partials/functions/get-canonical-url.html index 7577df0..e72895e 100644 --- a/module/layouts/_partials/functions/get-canonical-url.html +++ b/module/layouts/_partials/functions/get-canonical-url.html @@ -10,15 +10,12 @@ {{- if eq .Type "guide" -}} {{- $currentVersion := partial "functions/get-guide-version.html" . -}} {{- if $currentVersion -}} - {{- $latestVersion := partial "functions/get-latest-version" . -}} - {{- if eq $currentVersion $latestVersion -}} - {{- /* For latest version, canonical should be the section root */ -}} - {{- $sectionPage := .Site.GetPage .Section -}} - {{- if $sectionPage -}} - {{- $canonicalUrl = $sectionPage.RelPermalink -}} - {{- else -}} - {{- $canonicalUrl = printf "/%s/" .Section -}} - {{- end -}} + {{- /* For ALL guide versions, canonical should be the section root */ -}} + {{- $sectionPage := .Site.GetPage .Section -}} + {{- if $sectionPage -}} + {{- $canonicalUrl = $sectionPage.RelPermalink -}} + {{- else -}} + {{- $canonicalUrl = printf "/%s/" .Section -}} {{- end -}} {{- end -}} {{- end -}} From 1d60ec50b71bfe3a4603ac3d4b6de64a7101ab75 Mon Sep 17 00:00:00 2001 From: Martin Hinshelwood Date: Mon, 28 Jul 2025 16:57:00 +0100 Subject: [PATCH 2/5] Add hreflang links for all available languages in guide version links --- .../components/seo/guide-version-links.html | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/module/layouts/_partials/components/seo/guide-version-links.html b/module/layouts/_partials/components/seo/guide-version-links.html index 07f4cea..b75076f 100644 --- a/module/layouts/_partials/components/seo/guide-version-links.html +++ b/module/layouts/_partials/components/seo/guide-version-links.html @@ -21,6 +21,26 @@ {{- end -}} {{- end -}} + {{- /* Add hreflang links for all available languages of this version */ -}} + {{- range .Site.Sites -}} + {{- $langCode := .Language.Lang -}} + {{- $siteVersion := "" -}} + + {{- /* Try to find the equivalent page in this language site */ -}} + {{- $versionPath := printf "%s/%s" $.Section $currentVersion -}} + {{- $langVersionPage := .GetPage $versionPath -}} + + {{- /* If specific version not found and this is latest, try section root */ -}} + {{- if and (not $langVersionPage) (eq $currentVersion $latestVersion) -}} + {{- $langVersionPage = .GetPage $.Section -}} + {{- end -}} + + {{- /* Add hreflang link if page exists in this language */ -}} + {{- if $langVersionPage -}} + + {{- end -}} + {{- end -}} + {{- /* Add "latest" rel link if this is not the latest version */ -}} {{- if ne $currentVersion $latestVersion -}} {{- $sectionPage := $.Site.GetPage $.Section -}} From 836091c0763e277abeccda7f8b959e5ab5f7319e Mon Sep 17 00:00:00 2001 From: Martin Hinshelwood Date: Mon, 28 Jul 2025 16:59:23 +0100 Subject: [PATCH 3/5] Update robots meta tag for non-latest guide versions to allow indexing --- module/layouts/_partials/components/seo/guide-version-meta.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/layouts/_partials/components/seo/guide-version-meta.html b/module/layouts/_partials/components/seo/guide-version-meta.html index 97b5f2f..a5f00da 100644 --- a/module/layouts/_partials/components/seo/guide-version-meta.html +++ b/module/layouts/_partials/components/seo/guide-version-meta.html @@ -19,7 +19,7 @@ {{- /* Robots meta tag for non-latest versions */ -}} {{- if and $isGuide $currentVersion (not $isLatestVersion) -}} - + {{- end -}} From 61243c0990eeff9534f9c4e3cc3eec2233e98695 Mon Sep 17 00:00:00 2001 From: Martin Hinshelwood Date: Mon, 28 Jul 2025 17:01:30 +0100 Subject: [PATCH 4/5] Update repository description to reflect Hugo Guides engine functionality --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 75de084..59316e4 100644 --- a/readme.md +++ b/readme.md @@ -1,3 +1,3 @@ -# Scrum Guides Expansion Pack +# Hugo Guides - Open Extension -This repository contains an expansion pack for the Scrum Guide, providing additional resources, examples, and explanations to enhance understanding of Scrum practices. +This repository provides an engine for guides in Hugo. From 5217b64228282e7b0b5a19dd6245b31ac2970ee6 Mon Sep 17 00:00:00 2001 From: Martin Hinshelwood Date: Mon, 28 Jul 2025 17:02:53 +0100 Subject: [PATCH 5/5] Disable site publishing step in workflow --- .github/workflows/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c41b86b..78aa67f 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -233,7 +233,7 @@ jobs: name: "Publish Site" runs-on: ubuntu-latest needs: [Setup, BuildSite] - if: ${{ success() }} + if: ${{ false }} outputs: static_web_app_url: ${{ steps.azureDeploy.outputs.static_web_app_url }} steps: