Skip to content

Commit 3ba9093

Browse files
committed
Fix strict verify, hide versions on unversioned pages
1 parent 57ef99a commit 3ba9093

File tree

11 files changed

+36
-190
lines changed

11 files changed

+36
-190
lines changed

.github/workflows/mkdocs-strict-verify.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,8 @@ jobs:
2525

2626
verify:
2727
name: Verify mkdocs strict
28-
strategy:
29-
matrix:
30-
go-version: [1.16.x]
31-
platform: [ubuntu-latest]
3228

33-
runs-on: ${{ matrix.platform }}
29+
runs-on: ubuntu-latest
3430

3531
env:
3632
GOPATH: ${{ github.workspace }}
@@ -47,4 +43,4 @@ jobs:
4743
run: python3 -m pip install -r requirements.txt
4844

4945
- name: Verify MkDocs
50-
run: mkdocs build --strict
46+
run: ./hack/build.sh strict

config/redirects.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ plugins:
8282
docs/community/contributing/steering-committee.md: https://github.com/knative/community/blob/main/STEERING-COMMITTEE.md
8383
docs/community/contributing/tech-oversight-committee.md: https://github.com/knative/community/blob/main/TECH-OVERSIGHT-COMMITTEE.md
8484
docs/community/contributing/trademark-committee.md: https://github.com/knative/community/blob/main/TRADEMARK-COMMITTEE.md
85-
docs/community/contributing/values.md: docs/https://github.com/knative/community/blob/main/VALUES.md
85+
docs/community/contributing/values.md: https://github.com/knative/community/blob/main/VALUES.md
8686
docs/community/contributing/working-groups/working-groups.md: https://github.com/knative/community/blob/main/working-groups
8787
docs/community/meetup.md: community/README.md
8888
docs/community/samples.md: https://github.com/knative/docs/tree/main/code-samples/community
@@ -147,7 +147,7 @@ plugins:
147147
docs/eventing/samples/helloworld/helloworld-python/README.md: https://github.com/knative/docs/tree/main/code-samples/eventing/helloworld/helloworld-python
148148
docs/eventing/samples/kafka/binding/README.md: https://github.com/knative/docs/tree/main/code-samples/eventing/kafka/binding
149149
docs/eventing/samples/kafka/channel/README.md: https://github.com/knative/docs/tree/main/code-samples/eventing/kafka/channel
150-
docs/eventing/samples/kubernetes-event-source/index.md: eventing/sources/apiserversource/README.md
150+
docs/eventing/samples/kubernetes-event-source/index.md: docs/eventing/sources/apiserversource/README.md
151151
docs/eventing/samples/parallel/README.md: https://github.com/knative/docs/tree/main/code-samples/eventing/parallel
152152
docs/eventing/samples/parallel/multiple-branches/README.md: https://github.com/knative/docs/tree/main/code-samples/eventing/parallel/multiple-branches
153153
docs/eventing/samples/parallel/mutual-exclusivity/README.md: https://github.com/knative/docs/tree/main/code-samples/eventing/parallel/mutual-exclusivity
@@ -207,7 +207,7 @@ plugins:
207207
docs/serving/samples/hello-world/helloworld-nodejs/README.md: https://github.com/knative/docs/tree/main/code-samples/serving/hello-world/helloworld-nodejs
208208
docs/serving/samples/hello-world/helloworld-php/README.md: https://github.com/knative/docs/tree/main/code-samples/serving/hello-world/helloworld-php
209209
docs/serving/samples/hello-world/helloworld-python/README.md: https://github.com/knative/docs/tree/main/code-samples/serving/hello-world/helloworld-python
210-
docs/serving/samples/hello-world/helloworld-ruby/README.md: docs/https://github.com/knative/docs/tree/main/code-samples/serving/hello-world/helloworld-ruby
210+
docs/serving/samples/hello-world/helloworld-ruby/README.md: https://github.com/knative/docs/tree/main/code-samples/serving/hello-world/helloworld-ruby
211211
docs/serving/samples/hello-world/helloworld-scala/README.md: https://github.com/knative/docs/tree/main/code-samples/serving/hello-world/helloworld-scala
212212
docs/serving/samples/hello-world/helloworld-shell/README.md: https://github.com/knative/docs/tree/main/code-samples/serving/hello-world/helloworld-shell
213213
docs/serving/samples/knative-routing-go/README.md: https://github.com/knative/docs/tree/main/code-samples/serving/knative-routing-go

docs/blog/articles/get-started-knative-eventing.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
I’ve been exploring [Knative Eventing](https://knative.dev/docs/eventing/), a system that enables a cloud native eventing ecosystem to be easily deployed through the use of **event producers** and **event consumers.** Most of the work on this demo has been done in version 0.11, and I have also run it in version 0.13, and now it also works on version 0.15.
66

77
This demo was presented at the first Knative Community Meetup, so you can also watch the video version here:
8-
{{< youtube sGi_LuAaaT0 >}}
8+
9+
<div class="video-wrapper">
10+
<iframe width="720" height="480" src="https://www.youtube.com/embed/sGi_LuAaaT0" frameborder="0" allowfullscreen></iframe>
11+
</div>
912

1013
I put together a simple demo to explore some of the key advantages of event-driven architectures, such as:
1114

docs/blog/articles/orchestrating-cloud-events-with.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,11 @@ As mentioned before, further integrations should deal with more advanced topolog
184184

185185
In this blog post, I’ve spent some time describing the wonders of what you can do with a Workflow Engine like Zeebe on top of Knative Applications. I’ve personally had a lot of fun while working with Knative, as the abstractions provided helped me to build a very robust application that I can move to different cloud providers easily, without changing any of my services.
186186
Watch this demo live here:
187-
{{< youtube msDDdqmyEFA >}}
187+
188+
<div class="video-wrapper">
189+
<iframe width="720" height="480" src="https://www.youtube.com/embed/msDDdqmyEFA" frameborder="0" allowfullscreen></iframe>
190+
</div>
191+
188192
The projects and the integration shown in this blog post are in active development, so if you are interested or want to get involved please reach out via twitter: [@salaboy](http://twitter.com/salaboy) or join our slack channel: [zeebe-io.slack.com](http://zeebe-io.slack.com)
189193

190194
If you want to run this demo in your own Kubernetes Cluster you can find the instructions here: [https://github.com/salaboy/orchestrating-cloud-events/](https://github.com/salaboy/orchestrating-cloud-events/) and if you feel like giving the repository a star we will appreciate it :)

docs/blog/releases/announcing-knative-v0-21-release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ Please refer to issue [#1144](https://github.com/knative/client/issues/1144) (an
190190

191191
**ACTION REQUIRED**
192192

193-
If you rely on client-side revision naming, you have to add `--revision-name {{.Service}}-{{.Random 5}}-{{.Generation}}` to `kn service create` to get back the previous default behaviour. However, in most of all cases, you shound not worry about whether the revision names are created by `kn` or by the Knative serving controller
193+
If you rely on client-side revision naming, you have to add `{{ '--revision-name {{.Service}}-{{.Random 5}}-{{.Generation}}' }}` to `kn service create` to get back the previous default behaviour. However, in most of all cases, you shound not worry about whether the revision names are created by `kn` or by the Knative serving controller
194194

195195
In case of issues with this change, please let us know and we will fix it asap. We are committed to supporting you with any issues caused by this change.
196196

docs/community/contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Submit a Pull Request to the community sample directory under the Knative compon
7171
- [Contribute code samples](https://github.com/knative/docs/tree/main/code-samples/community):
7272
Share your samples with the community.
7373

74-
- [Link existing code samples](../samples/README.md#external-code-samples):
74+
- [Link existing code samples](../docs/samples/README.md#external-code-samples):
7575
Link to your Knative samples that live on another site.
7676

7777
## Contributor Roles

docs/smoketest.md

Lines changed: 0 additions & 87 deletions
This file was deleted.

hack/build.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ cp -r "$TEMP/content/docs/images" "$TEMP/content/docs/docs/images"
5353

5454
# Point top-level nav to docs directory.
5555
echo -e "nav:\n- docs\n- about\n- blog\n- community" > "$TEMP/content/docs/.nav.yml"
56+
# We use samples_branch to flag that the documentation is versioned
57+
echo -e "\n\nsamples_branch: main" >> "$TEMP/content/docs/docs/.meta.yml"
5658
curl -f -L --show-error https://raw.githubusercontent.com/knative/serving/main/docs/serving-api.md -s > "$TEMP/content/docs/docs/serving/reference/serving-api.md"
5759
curl -f -L --show-error https://raw.githubusercontent.com/knative/eventing/main/docs/eventing-api.md -s > "$TEMP/content/docs/docs/eventing/reference/eventing-api.md"
5860
versionjson="{\"version\": \"docs\", \"title\": \"(Pre-release)\", \"aliases\": [\"\"]}"
@@ -77,6 +79,8 @@ if [ "$BUILD_VERSIONS" != "no" ]; then
7779
if [ ! -f "$TEMP/content/docs/docs/.nav.yml" ]; then
7880
sed '/- Blog:/,$d' "$TEMP/current-release/config/nav.yml" >> "$TEMP/content/docs/docs/.nav.yml"
7981
fi
82+
# Smoketests were written for Hugo, not mkdocs, so remove
83+
rm "$TEMP/content/docs/docs/smoketest.md"
8084
# Fill in meta content for macros.py
8185
echo -e "\n\nknative_version: ${VERSIONS[0]}.0\nsamples_branch: ${DOCS_BRANCHES[0]}" >> "$TEMP/content/docs/docs/.meta.yml"
8286

@@ -92,6 +96,8 @@ if [ "$BUILD_VERSIONS" != "no" ]; then
9296
cp -r "$TEMP/docs-$version/docs" "$TEMP/content/docs/v$version-docs"
9397
echo "- Docs: v${version}-docs" >> "$TEMP/content/docs/.nav.yml"
9498
echo " v${version}-docs/README.md: v${version}-docs/concepts/README.md" >> "$TEMP/content/config/redirects.yml"
99+
# Smoketests were written for Hugo, not mkdocs, so remove
100+
rm "$TEMP/content/docs/v$version-docs/smoketest.md"
95101
# Copy the nav, but strip out non-versioned content, starting with blog
96102
# This can be retired after we stop supporting v1.19.
97103
if [ ! -f "$TEMP/content/docs/v$version-docs/.nav.yml" ]; then
@@ -108,7 +114,8 @@ fi
108114

109115
# Only build the site _once_ -- we used to build sub-components, and it
110116
# introduced a bunch of navigation / base-url problems.
111-
(cd "$TEMP/content"; mkdocs build -f mkdocs.yml -d "$SITE")
117+
# We pass through the command-line arguments to this script to enable --strict checks in CI.
118+
(cd "$TEMP/content"; mkdocs build -f mkdocs.yml -d "$SITE" "$@")
112119

113120
# Set up the version file to point to the set of built docs.
114121
cat << EOF > $SITE/versions.json

mkdocs.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ site_url: https://knative.dev/docs
55
site_description: Knative Documentation
66
extra_css:
77
- stylesheets/extra.css
8+
# Don't try to make snippets into regular docs (e.g. link-checking, nav, etc)
9+
exclude_docs: |
10+
*docs/snippets/
11+
12+
# TODO: make these stricter (move to "warn" to flag new link breakages)
13+
# validation:
14+
# omitted_files: warn
15+
# absolute_links: relative_to_docs
16+
# anchors: warn
17+
# unrecognized_links: warn
818

919
repo_url: https://github.com/knative/docs
1020
edit_uri: edit/main/docs

overrides/main.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ <h1>⚠ You are viewing an archived snapshot of the documentation for Knative ve
3131
{% set _.tags = config.extra.tags %}
3232

3333
<!-- Versioning -->
34-
{%- if config.extra.version -%}
34+
{# This is changed from upstream to only show version picker on versioned pages #}
35+
{%- if page and (page.meta.samples_branch) -%}
3536
{%- set mike = config.plugins.mike -%}
3637
{%- if not mike or mike.config.version_selector -%}
3738
{%- set _.version = config.extra.version -%}

0 commit comments

Comments
 (0)