Skip to content

Commit 3affb02

Browse files
silverwindlunnyJohn Olheisertechknowlogick
authored
Run hugo via go run and lock its version (#22206)
- Don't rely on obscure docker images like `plugins/hugo` - Lock down `hugo` to same version the image had used - Remove unnecessary verbosity in `trans-copy` - Rename `trans-copy` to `trans-copy.sh` Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: John Olheiser <john+github@jolheiser.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
1 parent 8e17fb5 commit 3affb02

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

.drone.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -928,11 +928,8 @@ trigger:
928928

929929
steps:
930930
- name: build-docs
931-
image: plugins/hugo:latest
932-
pull: always
931+
image: golang:1.19
933932
commands:
934-
# https://github.com/drone-plugins/drone-hugo/issues/36
935-
- apk upgrade --no-cache libcurl && apk add --no-cache make bash curl
936933
- cd docs
937934
- make trans-copy clean build
938935

docs/Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ THEME := themes/gitea
22
PUBLIC := public
33
ARCHIVE := https://dl.gitea.io/theme/master.tar.gz
44

5+
HUGO_PACKAGE := github.com/gohugoio/hugo@v0.81.0
6+
57
.PHONY: all
68
all: build
79

@@ -11,19 +13,19 @@ clean:
1113

1214
.PHONY: trans-copy
1315
trans-copy:
14-
@bash scripts/trans-copy
16+
bash scripts/trans-copy.sh
1517

1618
.PHONY: server
1719
server: $(THEME)
18-
hugo server
20+
go run $(HUGO_PACKAGE) server
1921

2022
.PHONY: build
2123
build: $(THEME)
22-
hugo --cleanDestinationDir
24+
go run $(HUGO_PACKAGE) --cleanDestinationDir
2325

2426
.PHONY: build-offline
2527
build-offline: $(THEME)
26-
hugo --baseURL="/" --cleanDestinationDir
28+
go run $(HUGO_PACKAGE) --baseURL="/" --cleanDestinationDir
2729

2830
.PHONY: update
2931
update: $(THEME)

docs/scripts/trans-copy renamed to docs/scripts/trans-copy.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ for SOURCE in $(find ${ROOT}/content -type f -iname *.en-us.md); do
2626
DEST="${SOURCE%.en-us.md}.${LOCALE}.md"
2727

2828
if [[ ! -f ${DEST} ]]; then
29-
echo "Creating fallback for ${DEST#${ROOT}/content/}"
3029
cp ${SOURCE} ${DEST}
3130
sed -i.bak "s/en\-us/${LOCALE}/g" ${DEST}
3231
rm ${DEST}.bak

0 commit comments

Comments
 (0)