-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #883 from nginx/cherry-pick-v3-documentation-7087d…
…e1f30b3910b2991f8c8b6b51588752aeb46 Add hugo version check and theme update to Makefile
- Loading branch information
Showing
4 changed files
with
72 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module github.com/nginx/agent/site | ||
|
||
go 1.18 | ||
go 1.22.0 | ||
|
||
require github.com/nginxinc/nginx-hugo-theme v0.41.14 // indirect | ||
require github.com/nginxinc/nginx-hugo-theme v0.41.19 // indirect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
github.com/nginxinc/nginx-hugo-theme v0.41.14 h1:OraNB01CdMJXufPddvIVt6qn6Mj38Z/XCVIWBgVtuY0= | ||
github.com/nginxinc/nginx-hugo-theme v0.41.14/go.mod h1:DPNgSS5QYxkjH/BfH4uPDiTfODqWJ50NKZdorguom8M= | ||
github.com/nginxinc/nginx-hugo-theme v0.41.19 h1:CyZOhU8q0p3nQ+ZTFRx7c/Dq9rxV1mShADIHz0vDoHo= | ||
github.com/nginxinc/nginx-hugo-theme v0.41.19/go.mod h1:DPNgSS5QYxkjH/BfH4uPDiTfODqWJ50NKZdorguom8M= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
|
||
hugo mod get -u github.com/nginxinc/nginx-hugo-theme | ||
hugo $* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
HUGO?=hugo | ||
HUGO_VERSION?=$(shell hugo version 2>/dev/null | awk '{print $$2}' | cut -d '.' -f 2) | ||
HUGO_IMG?=hugomods/hugo:std-go-git-0.134.3 | ||
|
||
THEME_MODULE = github.com/nginxinc/nginx-hugo-theme | ||
|
||
ifeq ($(shell [ $(HUGO_VERSION) -gt 133 2>/dev/null ] && echo true || echo false), true) | ||
$(info Hugo is available and has a version greater than 133. Proceeding with build.) | ||
else | ||
$(warning Hugo is not available or using a version less than 134. Attempting to use docker. HUGO_VERSION=$(HUGO_VERSION)) | ||
HUGO=docker run --rm -it -v ${CURDIR}:/src -p 1313:1313 ${HUGO_IMG} /src/hugo-entrypoint.sh | ||
ifeq (, $(shell docker version 2> /dev/null)) | ||
$(error Hugo (>0.134) or Docker are required to build the local previews.) | ||
endif | ||
endif | ||
|
||
MARKDOWNLINT?=markdownlint | ||
MARKDOWNLINT_IMG?=ghcr.io/igorshubovych/markdownlint-cli:latest | ||
|
||
ifeq (, $(shell ${MARKDOWNLINT} version 2> /dev/null)) | ||
ifeq (, $(shell docker version 2> /dev/null)) | ||
else | ||
MARKDOWNLINT=docker run --rm -i -v ${CURDIR}:/src --workdir /src ${MARKDOWNLINT_IMG} | ||
endif | ||
endif | ||
|
||
MARKDOWNLINKCHECK?=markdown-link-check | ||
MARKDOWNLINKCHECK_IMG?=ghcr.io/tcort/markdown-link-check:stable | ||
|
||
ifeq (, $(shell ${MARKDOWNLINKCHECK} --version 2> /dev/null)) | ||
ifeq (, $(shell docker version 2> /dev/null)) | ||
else | ||
MARKDOWNLINKCHECK=docker run --rm -it -v ${CURDIR}:/docs --workdir /docs ${MARKDOWNLINKCHECK_IMG} | ||
endif | ||
endif | ||
|
||
|
||
.PHONY: docs docs-draft docs-local clean hugo-get hugo-tidy lint-markdown link-check | ||
|
||
docs: | ||
${HUGO} | ||
|
||
watch: | ||
${HUGO} --bind 0.0.0.0 -p 1313 server --disableFastRender | ||
|
||
drafts: | ||
${HUGO} --bind 0.0.0.0 -p 1313 server -D --disableFastRender | ||
|
||
clean: | ||
[ -d "public" ] && rm -rf "public" | ||
|
||
hugo-get: | ||
hugo mod get -u github.com/nginxinc/nginx-hugo-theme | ||
|
||
hugo-tidy: | ||
hugo mod tidy | ||
|
||
hugo-update: hugo-get hugo-tidy | ||
|
||
lint-markdown: | ||
${MARKDOWNLINT} -c .markdownlint.yaml -- content | ||
|
||
link-check: | ||
${MARKDOWNLINKCHECK} $(shell find content -name '*.md') |