From 52c25570d6f488f33414b18d011c7cad450a631d Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 21 Dec 2022 21:35:40 +0100 Subject: [PATCH 1/4] Run hugo via `go run` and lock its version --- .drone.yml | 7 ++----- docs/Makefile | 10 ++++++---- docs/scripts/{trans-copy => trans-copy.sh} | 1 - 3 files changed, 8 insertions(+), 10 deletions(-) rename docs/scripts/{trans-copy => trans-copy.sh} (93%) diff --git a/.drone.yml b/.drone.yml index 48ba3e8f97426..8b95b578ac025 100644 --- a/.drone.yml +++ b/.drone.yml @@ -928,13 +928,10 @@ trigger: steps: - name: build-docs - image: plugins/hugo:latest - pull: always + image: golang:1.19 commands: - # https://github.com/drone-plugins/drone-hugo/issues/36 - - apk upgrade --no-cache libcurl && apk add --no-cache make bash curl - cd docs - - make trans-copy clean build + - cd docs && make trans-copy clean build - name: publish-docs image: techknowlogick/drone-netlify:latest diff --git a/docs/Makefile b/docs/Makefile index 68afe03e75fe0..8bed8d2a6b48b 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -2,6 +2,8 @@ THEME := themes/gitea PUBLIC := public ARCHIVE := https://dl.gitea.io/theme/master.tar.gz +HUGO_PACKAGE := github.com/gohugoio/hugo@v0.108.0 + .PHONY: all all: build @@ -11,19 +13,19 @@ clean: .PHONY: trans-copy trans-copy: - @bash scripts/trans-copy + bash scripts/trans-copy.sh .PHONY: server server: $(THEME) - hugo server + go run $(HUGO_PACKAGE) server .PHONY: build build: $(THEME) - hugo --cleanDestinationDir + go run $(HUGO_PACKAGE) --cleanDestinationDir .PHONY: build-offline build-offline: $(THEME) - hugo --baseURL="/" --cleanDestinationDir + go run $(HUGO_PACKAGE) --baseURL="/" --cleanDestinationDir .PHONY: update update: $(THEME) diff --git a/docs/scripts/trans-copy b/docs/scripts/trans-copy.sh similarity index 93% rename from docs/scripts/trans-copy rename to docs/scripts/trans-copy.sh index 7732192885534..7374ab9e73110 100755 --- a/docs/scripts/trans-copy +++ b/docs/scripts/trans-copy.sh @@ -26,7 +26,6 @@ for SOURCE in $(find ${ROOT}/content -type f -iname *.en-us.md); do DEST="${SOURCE%.en-us.md}.${LOCALE}.md" if [[ ! -f ${DEST} ]]; then - echo "Creating fallback for ${DEST#${ROOT}/content/}" cp ${SOURCE} ${DEST} sed -i.bak "s/en\-us/${LOCALE}/g" ${DEST} rm ${DEST}.bak From 13de0152472f5570879c3ffcdc59a48ef5bdf8a9 Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 21 Dec 2022 22:05:00 +0100 Subject: [PATCH 2/4] lock to hugo@v0.70.0 --- docs/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Makefile b/docs/Makefile index 8bed8d2a6b48b..5c7ac93fef25d 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -2,7 +2,7 @@ THEME := themes/gitea PUBLIC := public ARCHIVE := https://dl.gitea.io/theme/master.tar.gz -HUGO_PACKAGE := github.com/gohugoio/hugo@v0.108.0 +HUGO_PACKAGE := github.com/gohugoio/hugo@v0.70.0 .PHONY: all all: build From c61b365c433efdccad9ab2aee462b1ca48917bb5 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Wed, 21 Dec 2022 16:59:44 -0500 Subject: [PATCH 3/4] Update .drone.yml --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 8b95b578ac025..2b5d21ddf9672 100644 --- a/.drone.yml +++ b/.drone.yml @@ -931,7 +931,7 @@ steps: image: golang:1.19 commands: - cd docs - - cd docs && make trans-copy clean build + - make trans-copy clean build - name: publish-docs image: techknowlogick/drone-netlify:latest From 2eb5a5aeae6b76530ec5d919f4bba1e8ca367f0b Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Thu, 22 Dec 2022 09:36:28 +0800 Subject: [PATCH 4/4] Update docs/Makefile Co-authored-by: John Olheiser --- docs/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Makefile b/docs/Makefile index 5c7ac93fef25d..fcc932c07dca9 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -2,7 +2,7 @@ THEME := themes/gitea PUBLIC := public ARCHIVE := https://dl.gitea.io/theme/master.tar.gz -HUGO_PACKAGE := github.com/gohugoio/hugo@v0.70.0 +HUGO_PACKAGE := github.com/gohugoio/hugo@v0.81.0 .PHONY: all all: build