Skip to content

Commit 4e9fa00

Browse files
authored
Update documentation Makefile and README (#2507)
This commit updates the documentation Makefile and README, removing references to Netlify and clarifying the usage of the Makefile. This is part of an effort to ensure they remain consistent across all NGINX repositories.
1 parent 454e5c1 commit 4e9fa00

File tree

2 files changed

+30
-54
lines changed

2 files changed

+30
-54
lines changed

site/Makefile

Lines changed: 15 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,22 @@
11
HUGO?=hugo
2-
# the officially recommended unofficial docker image
32
HUGO_IMG?=hugomods/hugo:0.115.3
43

54
THEME_MODULE = github.com/nginxinc/nginx-hugo-theme
6-
## Pulls the current theme version from the Netlify settings
7-
THEME_VERSION = $(NGINX_THEME_VERSION)
8-
NETLIFY_DEPLOY_URL = ${DEPLOY_PRIME_URL}
5+
THEME_VERSION = 0.41.14
96

10-
# if there's no local hugo, fallback to docker
117
ifeq (, $(shell ${HUGO} version 2> /dev/null))
128
ifeq (, $(shell docker version 2> /dev/null))
139
$(error Docker and Hugo are not installed. Hugo (<0.91) or Docker are required to build the local preview.)
1410
else
15-
HUGO=docker run --rm -it -v ${CURDIR}:/src -p 1313:1313 ${HUGO_IMG} hugo
11+
HUGO=docker run --rm -it -v ${CURDIR}:/src -p 1313:1313 ${HUGO_IMG} hugo --bind 0.0.0.0 -p 1313
1612
endif
1713
endif
1814

1915
MARKDOWNLINT?=markdownlint
2016
MARKDOWNLINT_IMG?=ghcr.io/igorshubovych/markdownlint-cli:latest
2117

22-
# if there's no local markdownlint, fallback to docker
2318
ifeq (, $(shell ${MARKDOWNLINT} version 2> /dev/null))
2419
ifeq (, $(shell docker version 2> /dev/null))
25-
ifneq (, $(shell $(NETLIFY) "true"))
2620
$(error Docker and markdownlint are not installed. markdownlint or Docker are required to lint.)
2721
endif
2822
else
@@ -32,57 +26,40 @@ endif
3226

3327
MARKDOWNLINKCHECK?=markdown-link-check
3428
MARKDOWNLINKCHECK_IMG?=ghcr.io/tcort/markdown-link-check:stable
35-
# if there's no local markdown-link-check, fallback to docker
29+
3630
ifeq (, $(shell ${MARKDOWNLINKCHECK} --version 2> /dev/null))
3731
ifeq (, $(shell docker version 2> /dev/null))
38-
ifneq (, $(shell $(NETLIFY) "true"))
3932
$(error Docker and markdown-link-check are not installed. markdown-link-check or Docker are required to check links.)
4033
endif
4134
else
4235
MARKDOWNLINKCHECK=docker run --rm -it -v ${CURDIR}:/site --workdir /site ${MARKDOWNLINKCHECK_IMG}
4336
endif
4437
endif
4538

46-
.PHONY: all all-staging all-dev all-local clean hugo-mod build-production build-staging build-dev docs-drafts docs deploy-preview
47-
48-
all: hugo-mod build-production
49-
50-
all-staging: hugo-mod build-staging
51-
52-
all-dev: hugo-mod build-dev
53-
54-
all-local: clean hugo-mod build-production
39+
.PHONY: docs watch drafts clean hugo-get hugo-tidy hugo-update lint-markdown link-check
5540

5641
docs:
5742
${HUGO}
5843

59-
clean:
60-
if [[ -d ${PWD}/public ]] ; then rm -rf ${PWD}/public && echo "Removed public directory" ; else echo "Did not find a public directory to remove" ; fi
61-
6244
watch:
6345
${HUGO} --bind 0.0.0.0 -p 1313 server --disableFastRender
6446

65-
watch-drafts:
47+
drafts:
6648
${HUGO} --bind 0.0.0.0 -p 1313 server -D --disableFastRender
6749

68-
link-check:
69-
${MARKDOWNLINKCHECK} $(shell find content -name '*.md')
70-
71-
lint-markdown:
72-
${MARKDOWNLINT} -c .markdownlint.json -- content
50+
clean:
51+
[ -d "public" ] && rm -rf "public"
7352

74-
# Commands used by Netlify CI
75-
hugo-mod:
53+
hugo-get:
7654
hugo mod get $(THEME_MODULE)@v$(THEME_VERSION)
7755

78-
build-production:
79-
hugo --gc -e production
56+
hugo-tidy:
57+
hugo mod tidy
8058

81-
build-staging:
82-
hugo --gc -e staging
59+
hugo-update: hugo-get hugo-tidy
8360

84-
build-dev:
85-
hugo --gc -e development
61+
lint-markdown:
62+
${MARKDOWNLINT} -c .markdownlint.yaml -- content
8663

87-
deploy-preview: hugo-mod
88-
hugo --gc -b ${NETLIFY_DEPLOY_URL}/nginx-gateway-fabric/
64+
link-check:
65+
${MARKDOWNLINKCHECK} $(shell find content -name '*.md')

site/README.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,36 +38,35 @@ The documentation is published from the latest public release branch. If your ch
3838

3939
## Developing documentation locally
4040

41-
To build the documentation locally, run the `make` command inside this `/site/` directory:
41+
To build the documentation locally, use the `make` command in the documentation folder with these targets:
4242

4343
```text
44-
make docs - Builds the documentation set with the output as the '/public' directory
45-
make clean - Removes the local '/public/' directory
46-
make watch - Starts a local Hugo server for live previews
47-
make watch-drafts - Starts a local Hugo server for live previews, including documentation marked with 'draft: true'
48-
make link-check - Check for any broken links in the documentation
49-
make lint-markdown - Runs markdownlint to identify possible markdown formatting issues
44+
make docs - Builds the documentation
45+
make watch - Runs a local Hugo server to automatically preview changes
46+
make drafts - Runs a local Hugo server, and displays documentation marked as drafts
47+
make clean - Removes the output 'public' directory created by Hugo
48+
make hugo-get - Updates the go module file with the latest version of the theme
49+
make hugo-tidy - Removes unnecessary dependencies from the go module file
50+
make hugo-update - Runs the hugo-get and hugo-tidy targets in sequence
51+
make lint-markdown - Runs markdownlint on the content folder
52+
make link-check - Runs markdown-link-check on all Markdown files
5053
```
5154

52-
The `watch` options automatically reload the Hugo server, allowing you to view updates as you work.
53-
54-
> **Note**: The documentation uses build environments to control the baseURL used for things like internal references and static resources. The configuration for each environment can be found in the `config` directory. When running Hugo you can specify the environment and baseURL, but it's unnecessary.
55-
5655
## Adding new documentation
5756

58-
### Using Hugo to generate a new documentation file
57+
### Generate a new documentation file using Hugo
5958

60-
To create a new documentation file with the pre-configured Hugo front-matter for the task template, run the following command inside this `/site` directory:
59+
To create a new documentation file containing the pre-configured Hugo front-matter with the task template, **run the following command in the documentation directory**:
6160

62-
`hugo new <SECTIONNAME>/<FILENAME>.md`
61+
`hugo new <SECTIONNAME>/<FILENAME>.<FORMAT>`
6362

6463
For example:
6564

6665
```shell
6766
hugo new getting-started/install.md
6867
```
6968

70-
The default template (task) should be used for most pages. For other content templates, you can use the `--kind` flag:
69+
The default template -- task -- should be used for most documentation. To create documentation using the other content templates, you can use the `--kind` flag:
7170

7271
```shell
7372
hugo new tutorials/deploy.md --kind tutorial
@@ -125,7 +124,7 @@ Use the `img` [shortcode](#using-hugo-shortcodes) to add images into your docume
125124
126125
### Using Hugo shortcodes
127126

128-
[Hugo shortcodes](/docs/themes/f5-hugo/layouts/shortcodes/) are used to format callouts, add images, and reuse content across different pages.
127+
[Hugo shortcodes](https://github.com/nginxinc/nginx-hugo-theme/tree/main/layouts/shortcodes) are used to format callouts, add images, and reuse content across different pages.
129128

130129
For example, to use the `note` callout:
131130

0 commit comments

Comments
 (0)