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 2 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
7 changes: 2 additions & 5 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
techknowlogick marked this conversation as resolved.
Show resolved Hide resolved

- name: publish-docs
image: techknowlogick/drone-netlify:latest
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/hugo@v0.70.0
lunny marked this conversation as resolved.
Show resolved Hide resolved

.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