Skip to content

Commit 48a0e89

Browse files
committed
chore: hugo initialization
1 parent 190a16e commit 48a0e89

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+432
-19
lines changed

docs/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
public
2+
.hugo_build.lock
3+
resources

docs/config/_default/config.toml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
title = "NGINX Gateway Fabric"
2+
enableGitInfo = false
3+
baseURL = "/"
4+
publishDir = "public/nginx-gateway-fabric"
5+
staticDir = ["static"]
6+
languageCode = "en-us"
7+
description = "NGINX Gateway Fabric."
8+
refLinksErrorLevel = "ERROR"
9+
enableRobotsTXT = "true"
10+
#canonifyURLs = true
11+
pluralizeListTitles = false
12+
pygmentsCodeFences = true
13+
pygmentsUseClasses = true
14+
15+
[caches]
16+
[caches.modules]
17+
maxAge = -1
18+
19+
[module]
20+
[[module.imports]]
21+
path="github.com/nginxinc/nginx-hugo-theme"
22+
23+
[markup]
24+
[markup.highlight]
25+
codeFences = true
26+
guessSyntax = true
27+
hl_Lines = ""
28+
lineNoStart = 1
29+
lineNos = false
30+
lineNumbersInTable = true
31+
noClasses = true
32+
style = "monokai"
33+
tabWidth = 4
34+
[markup.goldmark]
35+
[markup.goldmark.extensions]
36+
definitionList = true
37+
footnote = true
38+
linkify = true
39+
strikethrough = true
40+
table = true
41+
taskList = true
42+
typographer = true
43+
[markup.goldmark.parser]
44+
attribute = true
45+
autoHeadingID = true
46+
autoHeadingIDType = "gitlab"
47+
[markup.goldmark.renderer]
48+
hardWraps = false
49+
unsafe = true
50+
xhtml = false
51+
52+
[params]
53+
useSectionPageLists = "false"
54+
buildtype = "webdocs"
55+
RSSLink = "/index.xml"
56+
author = "NGINX Inc." # add your company name
57+
github = "nginxinc" # add your github profile name
58+
twitter = "@nginx" # add your twitter profile
59+
#email = ""
60+
noindex_kinds = [
61+
"taxonomy",
62+
"taxonomyTerm"
63+
]
64+
logo = "NGINX-product-icon.svg"
65+
66+
sectionPagesMenu = "docs"
67+
68+
ignoreFiles = [ "\\.sh$", "\\.DS_Store$", "\\.git.*$", "\\.txt$", "\\/config\\/.*", "README\\.*"]

docs/config/development/config.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
baseURL = "https://docs-dev.nginx.com/nginx-gateway-fabric"
2+
title = "DEV -- NGINX Gateway Fabric"
3+
publishDir = "public/nginx-gateway-fabric"
4+
canonifyURLs = false

docs/config/production/config.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
baseURL = "https://docs.nginx.com/nginx-gateway-fabric"
2+
title = "NGINX Gateway Fabric"
3+
publishDir = "public/nginx-gateway-fabric"
4+
canonifyURLs = false

docs/config/staging/config.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
baseURL = "https://docs-staging.nginx.com/nginx-gateway-fabric"
2+
title = "STAGING -- NGINX Gateway Fabric"
3+
publishDir = "public/nginx-gateway-fabric"
4+
canonifyURLs = false

docs/content/_index.md

Lines changed: 6 additions & 0 deletions

docs/content/guides/_index.md

Lines changed: 8 additions & 0 deletions

docs/guides/advanced-routing.md renamed to docs/content/guides/advanced-routing.md

Lines changed: 17 additions & 19 deletions

docs/go.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module github.com/nginxinc/nalb-shared/docs
2+
3+
go 1.18
4+
5+
require github.com/nginxinc/nginx-hugo-theme v0.39.0 // indirect

docs/go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
github.com/nginxinc/nginx-hugo-theme v0.35.0 h1:7XB2GMy6qeJgKEJy9wOS3SYKYpfvLW3/H+UHRPLM4FU=
2+
github.com/nginxinc/nginx-hugo-theme v0.35.0/go.mod h1:DPNgSS5QYxkjH/BfH4uPDiTfODqWJ50NKZdorguom8M=
3+
github.com/nginxinc/nginx-hugo-theme v0.39.0 h1:P1hOPpityVUOM5OyIpQZa1UJyuUunGSmz0oZh/GYSJM=
4+
github.com/nginxinc/nginx-hugo-theme v0.39.0/go.mod h1:DPNgSS5QYxkjH/BfH4uPDiTfODqWJ50NKZdorguom8M=

docs/makefile

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
HUGO?=hugo
2+
# the officially recommended unofficial docker image
3+
HUGO_IMG?=klakegg/hugo:0.115.3
4+
# NGINX Hugo theme module location
5+
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+
9+
10+
# if there's no local hugo, fallback to docker
11+
ifeq (, $(shell ${HUGO} version 2> /dev/null))
12+
ifeq (, $(shell docker version 2> /dev/null))
13+
$(error Docker and Hugo are not installed. Hugo (<0.91) or Docker are required to build the local preview.)
14+
else
15+
HUGO=docker run --rm -it -v ${CURDIR}:/src -p 1313:1313 ${HUGO_IMG}
16+
endif
17+
endif
18+
19+
MARKDOWNLINT?=markdownlint
20+
MARKDOWNLINT_IMG?=ghcr.io/igorshubovych/markdownlint-cli:latest
21+
22+
# if there's no local markdownlint, fallback to docker
23+
ifeq (, $(shell ${MARKDOWNLINT} version 2> /dev/null))
24+
ifeq (, $(shell docker version 2> /dev/null))
25+
ifneq (, $(shell $(NETLIFY) "true"))
26+
$(error Docker and markdownlint are not installed. markdownlint or Docker are required to lint.)
27+
else
28+
MARKDOWNLINT=docker run --rm -i -v ${CURDIR}:/src --workdir /src ${MARKDOWNLINT_IMG}
29+
endif
30+
endif
31+
endif
32+
33+
MARKDOWNLINKCHECK?=markdown-link-check
34+
MARKDOWNLINKCHECK_IMG?=ghcr.io/tcort/markdown-link-check:stable
35+
# if there's no local markdown-link-check, fallback to docker
36+
ifeq (, $(shell ${MARKDOWNLINKCHECK} --version 2> /dev/null))
37+
ifeq (, $(shell docker version 2> /dev/null))
38+
ifneq (, $(shell $(NETLIFY) "true"))
39+
$(error Docker and markdown-link-check are not installed. markdown-link-check or Docker are required to check links.)
40+
else
41+
MARKDOWNLINKCHECK=docker run --rm -it -v ${CURDIR}:/docs --workdir /docs ${MARKDOWNLINKCHECK_IMG}
42+
endif
43+
endif
44+
endif
45+
46+
47+
.PHONY: docs clean hugo-mod docs-local docs-drafts netlify lint-grammar lint-markdown link-check all all-staging all-dev
48+
49+
## For use in Netlify CI only
50+
all: hugo-mod build-production
51+
52+
all-staging: hugo-mod build-staging
53+
54+
all-dev: hugo-mod build-dev
55+
## end for use in Netlify CI
56+
57+
docs:
58+
${HUGO} server --disableFastRender
59+
60+
clean:
61+
rm -rf ./public
62+
63+
docs-local: clean
64+
${HUGO}
65+
66+
docs-drafts:
67+
${HUGO} server -D --disableFastRender
68+
69+
lint-grammar:
70+
docker run --rm -it -v ${CURDIR}/content:/root/content --entrypoint "vale" --workdir /root/content artifactory.f5net.com/cylon-indigo-docker-dev/indigo/tools/docs/vale-lint:0.7.0 ./
71+
72+
lint-markdown:
73+
${MARKDOWNLINT} -c mdlint_conf.json -- content
74+
75+
link-check:
76+
${MARKDOWNLINKCHECK} $(shell find content -name '*.md')
77+
78+
## commands for use in Netlify CI
79+
hugo-mod:
80+
hugo mod get $(THEME_MODULE)@v$(THEME_VERSION)
81+
82+
build-production: hugo-mod
83+
hugo --gc -e production
84+
85+
build-staging: hugo-mod
86+
hugo --gc -e staging
87+
88+
build-dev: hugo-mod
89+
hugo --gc -e development
90+
91+
deploy-preview: hugo-mod
92+
hugo --gc -d public/nginx-gateway-fabric/ -b ${NETLIFY_DEPLOY_URL}/nginx-gateway-fabric/

docs/md-linkcheck-config.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"replacementPatterns": [
3+
{
4+
"pattern": "^\/",
5+
"replacement": "<abs-path>/"
6+
}
7+
],
8+
"ignorePatterns": [
9+
{
10+
"pattern": "^.+localhost.+$|\/.+yaml"
11+
}
12+
]
13+
}
14+

docs/mdlint_conf.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"MD009": false,
3+
"MD012": false,
4+
"MD010": false,
5+
"MD013": false,
6+
"MD004": {"style": "dash"},
7+
"MD022": false,
8+
"MD033": false,
9+
"MD041": false,
10+
"MD003": false,
11+
"MD002": false,
12+
"MD024": {"siblings_only": true},
13+
"MD046": false
14+
}
15+

docs/netlify.toml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[build]
2+
base = "docs/"
3+
publish = "public"
4+
5+
[context.production]
6+
command = "make all"
7+
8+
[context.docs-development]
9+
command = "make all-dev"
10+
11+
[context.docs-staging]
12+
command = "make all-staging"
13+
14+
[context.branch-deploy]
15+
command = "make deploy-preview"
16+
17+
[context.deploy-preview]
18+
command = "make deploy-preview"
19+
20+
[[headers]]
21+
for = "/*"
22+
[headers.values]
23+
Access-Control-Allow-Origin = "https://docs.nginx.com"
24+
25+
[[redirects]]
26+
from = "/"
27+
to = "/nginx-gateway-fabric/"
28+
status = 301
29+
force = true
30+
31+
[[redirects]]
32+
from = "/nginx-gateway-fabric/*"
33+
to = "/nginx-gateway-fabric/404.html"
34+
status = 404

0 commit comments

Comments
 (0)