Skip to content

Commit ffbb56e

Browse files
committed
Upgrade Hugo to v0.152.2 and migrate to Docsy Go module
Signed-off-by: Kay Yan <[email protected]>
1 parent c3713bd commit ffbb56e

File tree

7 files changed

+37
-17
lines changed

7 files changed

+37
-17
lines changed

Makefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,10 @@ code-generator:
326326
cp -f $(CODEGEN_ROOT)/generate-internal-groups.sh $(PROJECT_DIR)/bin/
327327
cp -f $(CODEGEN_ROOT)/kube_codegen.sh $(PROJECT_DIR)/bin/
328328

329+
.PHONY: site-server
330+
site-server: hugo
331+
(cd site; $(HUGO) server)
332+
329333
##@ Release
330334
.PHONY: artifacts
331335
artifacts: kustomize helm yq
@@ -345,7 +349,7 @@ artifacts: kustomize helm yq
345349

346350
.PHONY: prepare-release-branch
347351
prepare-release-branch: yq kustomize ## Prepare the release branch with the release version.
348-
$(SED) -r 's/v[0-9]+\.[0-9]+\.[0-9]+/$(RELEASE_VERSION)/g' -i README.md -i site/config.toml
352+
$(SED) -r 's/v[0-9]+\.[0-9]+\.[0-9]+/$(RELEASE_VERSION)/g' -i README.md -i site/hugo.toml
349353
$(SED) -r 's/--version="v?[0-9]+\.[0-9]+\.[0-9]+/--version="$(CHART_VERSION)/g' -i charts/lws/README.md
350354
$(SED) -r 's/\bVERSION=(\s*)v?[0-9]+\.[0-9]+\.[0-9]+\b/VERSION=\1$(RELEASE_VERSION)/g' -i site/content/en/docs/installation/_index.md
351355
$(SED) -r 's/\bCHART_VERSION=(\s*)v?[0-9]+\.[0-9]+\.[0-9]+\b/CHART_VERSION=\1$(CHART_VERSION)/g' -i site/content/en/docs/installation/_index.md
@@ -378,6 +382,12 @@ YQ = $(PROJECT_DIR)/bin/yq
378382
yq: ## Download yq locally if necessary.
379383
GOBIN=$(PROJECT_DIR)/bin GO111MODULE=on $(GO_CMD) install github.com/mikefarah/yq/[email protected]
380384

385+
386+
HUGO = $(PROJECT_DIR)/bin/hugo
387+
.PHONY: hugo
388+
hugo:
389+
@GOBIN=$(PROJECT_DIR)/bin CGO_ENABLED=1 $(GO_CMD) install -tags extended github.com/gohugoio/[email protected]
390+
381391
.PHONY: crds
382392
crds: kustomize yq # update helm CRD files
383393
$(KUSTOMIZE) build config/default \

netlify.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
command = "npm install && hugo --gc --minify"
55

66
[context.deploy-preview.environment]
7-
HUGO_VERSION = "0.92.0"
7+
HUGO_VERSION = "0.152.2"
88

99
[context.production.environment]
10-
HUGO_VERSION = "0.92.0"
10+
HUGO_VERSION = "0.152.2"
1111
HUGO_ENV = "production"
1212

1313
[context.branch-deploy.environment]
14-
HUGO_VERSION = "0.92.0"
14+
HUGO_VERSION = "0.152.2"

site/go.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module sigs.k8s.io/lws/site
2+
3+
go 1.25
4+
5+
require github.com/google/docsy v0.13.0 // indirect

site/go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
github.com/FortAwesome/Font-Awesome v0.0.0-20241216213156-af620534bfc3/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo=
2+
github.com/google/docsy v0.13.0 h1:Y1oy5SmQ0ikJJsvkuefEVZMj0MTXLmVfpXbt7Ytc7rc=
3+
github.com/google/docsy v0.13.0/go.mod h1:1Fj1W1O3esZh7IBQ8XAYtxtg10udBXuGI89+LUQc1AU=
4+
github.com/twbs/bootstrap v5.3.8+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0=

site/config.toml renamed to site/hugo.toml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ title = "LWS"
33

44
enableRobotsTXT = true
55

6-
theme = "docsy"
7-
themesDir = "node_modules"
8-
96
###############################################################################
107
# Docsy
118
###############################################################################
@@ -19,7 +16,7 @@ defaultContentLanguageInSubdir = false
1916
# useful when translating
2017
enableMissingTranslationPlaceholders = true
2118
# disable taxonomies
22-
disableKinds = ["taxonomy", "taxonomyTerm"]
19+
disableKinds = ["taxonomy"]
2320
# deprecated directories
2421
ignoreFiles = []
2522
###############################################################################
@@ -158,4 +155,12 @@ ignoreFiles = []
158155
name = "Slack"
159156
url = "https://kubernetes.slack.com/"
160157
icon = "fab fa-slack"
161-
desc = "Chat with other project developers"
158+
desc = "Chat with other project developers"
159+
160+
[module]
161+
proxy = "direct"
162+
[module.hugoVersion]
163+
extended = true
164+
[[module.imports]]
165+
path = "github.com/google/docsy"
166+
disable = false

site/layouts/partials/feedback.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ <h3 class="card-title">Feedback</h3>
2020
<button class="btn btn-primary feedback--answer feedback--answer-yes" style="width: 5rem;">Yes</button>
2121
<button class="btn btn-primary feedback--answer feedback--answer-no" style="width: 5rem;">No</button>
2222
<p class="feedback--response feedback--response-yes">
23-
{{ .yes | safeHTML }}
23+
{{ .Site.Params.ui.feedback.yes | safeHTML }}
2424
</p>
2525
<p class="feedback--response feedback--response-no">
26-
{{ .no | safeHTML }}
26+
{{ .Site.Params.ui.feedback.no | safeHTML }}
2727
</p>
2828
</div>
2929
</div>

site/layouts/partials/head.html

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,5 @@
4848

4949
{{/* To comply with GDPR, cookie consent scripts places in head-end must execute before Google Analytics is enabled */ -}}
5050
{{ if hugo.IsProduction -}}
51-
{{ if hasPrefix .Site.GoogleAnalytics "G-" -}}
52-
{{ template "_internal/google_analytics.html" . -}}
53-
{{ else -}}
54-
{{ template "_internal/google_analytics_async.html" . -}}
55-
{{ end -}}
56-
{{ end -}}
51+
{{ template "_internal/google_analytics.html" . -}}
52+
{{ end -}}

0 commit comments

Comments
 (0)