Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run hugo via go run and lock its version #22206

Merged
merged 5 commits into from
Dec 22, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -928,11 +928,8 @@ 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

Expand Down
10 changes: 6 additions & 4 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ THEME := themes/gitea
PUBLIC := public
ARCHIVE := https://dl.gitea.io/theme/master.tar.gz

HUGO_PACKAGE := github.com/gohugoio/[email protected]

.PHONY: all
all: build

Expand All @@ -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)
Expand Down
1 change: 0 additions & 1 deletion docs/scripts/trans-copy → docs/scripts/trans-copy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down