add client docs to website (#4632)

This commit is contained in:
Paul Schweigert 2022-01-13 14:20:12 -05:00 committed by GitHub
parent 73fd6a18fb
commit 4ce29a6979
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 4 deletions

View File

@ -223,6 +223,7 @@ nav:
- API:
- Serving: reference/api/serving-api.md
- Eventing: reference/api/eventing-api.md
- Client: reference/client/README.md
- Concepts:
- Duck types: reference/concepts/duck-typing.md
- "Community":

View File

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

View File

@ -72,9 +72,7 @@ fi
# TODO copy templates, stylesheets, etc. into blog directory
cp -r overrides blog/
cp -r docs/images docs/stylesheets blog/docs/
cd blog/
mkdocs build -f mkdocs.yml -d ../site/blog
cd -
pushd blog; mkdocs build -f mkdocs.yml -d "$SITE/blog"; popd
# Handle Cookie consent
cp -r cookie-consent/js site/

View File

@ -36,3 +36,16 @@ def define_env(env):
file=file,
version=version,
org=org)
@env.macro
def clientdocs():
"""Generates a link to the client docs for the current release version.
When the version in the KNATIVE_VERSION environment variable is
empty this links to the main branch, otherwise it links to the
matching release in Github.
"""
version = os.environ.get("KNATIVE_VERSION")
if version is None:
return 'https://github.com/knative/client/blob/main/docs/cmd/kn.md'
return 'https://github.com/knative/client/blob/release-{version}/docs/cmd/kn.md'.format(version=version)

View File

@ -5,7 +5,6 @@
publish = "site"
[build.environment]
HUGO_VERSION = "0.83.1"
NODE_VERSION= "14"
PYTHON_VERSION = "3.8"