Skip to content

Commit 92cb570

Browse files
committed
Refactor production languages URL construction and update module imports in configuration
1 parent ca0887e commit 92cb570

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

module/layouts/_partials/components/translations/community-translations2.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ <h2 class="mb-3">{{ i18n "download_community_translations" . }}</h2>
2121
{{- $productionLanguagesData = $productionLanguagesFile.Content | transform.Unmarshal }}
2222
{{- end }}
2323
{{- else }}
24-
{{- $productionLanguagesUrl := printf "%slanguages.json?v=%d" .Site.Params.productionSiteUrl now.Unix }}
24+
{{- $baseUrl := strings.TrimSuffix "/" .Site.Params.productionSiteUrl }}
25+
{{- $productionLanguagesUrl := printf "%s/languages.json?v=%d" $baseUrl now.Unix }}
2526
{{- with try (resources.GetRemote $productionLanguagesUrl) }}
2627
{{ with .Err }}
2728
{{ warnf "Error fetching production languages: %s" . }}

module/layouts/_partials/components/translations/preview-translations.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@
1515
{{- if eq hugo.Environment "production" }}
1616
{{- $productionLanguagesUrl = "/languages.json" }}
1717
{{- else }}
18-
{{- $productionLanguagesUrl = printf "%slanguages.json?v=%d" .Site.Params.productionSiteUrl now.Unix }}
18+
{{- $baseUrl := strings.TrimSuffix "/" .Site.Params.productionSiteUrl }}
19+
{{- $productionLanguagesUrl = printf "%s/languages.json?v=%d" $baseUrl now.Unix }}
1920
{{- end }}
2021

2122
{{- if eq hugo.Environment "preview" }}
2223
{{- $previewLanguagesUrl = "/languages.json" }}
2324
{{- else }}
24-
{{- $previewLanguagesUrl = printf "%slanguages.json?v=%d" .Site.Params.previewSiteUrl now.Unix }}
25+
{{- $baseUrl := strings.TrimSuffix "/" .Site.Params.previewSiteUrl }}
26+
{{- $previewLanguagesUrl = printf "%s/languages.json?v=%d" $baseUrl now.Unix }}
2527
{{- end }}
2628

2729
{{/* Load production languages */}}

site/go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ go 1.24.5
44

55
require (
66
github.com/KanbanGuides/KanbanGuides/site v0.0.0-20250807073058-1fb088304516 // indirect
7+
github.com/ScrumGuides/ScrumGuide-ExpansionPack/site v0.0.0-20250801110201-076bbcf543d8 // indirect
78
github.com/nkdAgility/HugoGuides/module v0.7.2 // indirect
89
)

site/hugo.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,14 @@ outputFormats:
8787

8888
module:
8989
imports:
90-
#- path: github.com/ScrumGuides/ScrumGuide-ExpansionPack/site
90+
- path: github.com/ScrumGuides/ScrumGuide-ExpansionPack/site
91+
mounts:
92+
- source: content
93+
target: content
9194
- path: github.com/KanbanGuides/KanbanGuides/site
95+
mounts:
96+
- source: content
97+
target: content
9298
- path: github.com/nkdAgility/HugoGuides/module
9399
replacements:
94100
- github.com/nkdAgility/HugoGuides/module -> ../../module

0 commit comments

Comments
 (0)