Skip to content

Commit e9713b1

Browse files
authored
Build client docs (knative#4623)
* build kn docs * navigation tweaks * link to github version of kn docs * removing unneeded envvar * removing go * style
1 parent ca872c1 commit e9713b1

File tree

5 files changed

+19
-4
lines changed

5 files changed

+19
-4
lines changed

config/nav.yml

+1
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ nav:
223223
- API:
224224
- Serving: reference/api/serving-api.md
225225
- Eventing: reference/api/eventing-api.md
226+
- Client: reference/client/README.md
226227
- Concepts:
227228
- Duck types: reference/concepts/duck-typing.md
228229
- "Community":

docs/reference/client/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Knative Client Reference
2+
3+
See the [`kn` documentation]({{ clientdocs() }}){target=_blank} in Github.

hack/build.sh

+1-3
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,7 @@ fi
7070
# TODO copy templates, stylesheets, etc. into blog directory
7171
cp -r overrides blog/
7272
cp -r docs/images docs/stylesheets blog/docs/
73-
cd blog/
74-
mkdocs build -f mkdocs.yml -d ../site/blog
75-
cd -
73+
pushd blog; mkdocs build -f mkdocs.yml -d "$SITE/blog"; popd
7674

7775
# Handle Cookie consent
7876
cp -r cookie-consent/js site/

hack/macros.py

+14
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,17 @@ def artifact(repo, file, org="knative"):
4343
file=file,
4444
version=version,
4545
org=org)
46+
47+
@env.macro
48+
def clientdocs():
49+
"""Generates a link to the client docs for the current release version.
50+
51+
When the version in the KNATIVE_VERSION environment variable is
52+
empty this links to the main branch, otherwise it links to the
53+
matching release in Github.
54+
"""
55+
version = os.environ.get("KNATIVE_VERSION")
56+
if version is None:
57+
return 'https://github.com/knative/client/blob/main/docs/cmd/kn.md'
58+
59+
return 'https://github.com/knative/client/blob/release-{version}/docs/cmd/kn.md'.format(version=version)

netlify.toml

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
publish = "site"
66

77
[build.environment]
8-
HUGO_VERSION = "0.83.1"
98
NODE_VERSION= "14"
109
PYTHON_VERSION = "3.8"
1110

0 commit comments

Comments
 (0)