Skip to content

Commit 3c6c38b

Browse files
Docs build cleanup (#6407)
* Fix misspell detected typos * Fix missing newline at EOF * Switch from 'git clone' to 'git worktree add' for higher speed
1 parent 9672064 commit 3c6c38b

File tree

9 files changed

+21
-12
lines changed

9 files changed

+21
-12
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
*.ai binary
88
*.pdf binary
99
*.png binary
10+
# We are vendoring this fork of material-mkdocs typescript for now -- don't lint, etc.
11+
/overrides/assets/javascripts/bundle.*.min.js linguist-vendored
1012

1113
# coverage-excluded is an attribute used to explicitly exclude a path from being
1214
# included in code coverage. If a path is marked as linguist-generated already,

docs/about/.nav.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ nav:
88
- Outfit7: about/case-studies/outfit7.md
99
- Puppet: about/case-studies/puppet.md
1010
- PNC Bank: about/case-studies/pnc.md
11-
- SVA: about/case-studies/sva.md
11+
- SVA: about/case-studies/sva.md

docs/community/.nav.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ nav:
22
- Community:
33
- How To Get Involved: community/README.md
44
- Contribute to Knative: community/contributing.md
5-
- Community Rules and Practices: community/governance.md
5+
- Community Rules and Practices: community/governance.md

docs/versioned/reference/security/threat-model.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ Knative to handle HTTP requests when there is no current user pod available to
146146
handle the request. The activator works in concert with the autoscaler to manage
147147
the number of Pods for a particular Revision based on traffic routing decisions
148148
made by the ingress gateway. Not all incoming requests are handled by the
149-
activator -- when a particular revision has sufficent replicas to handle bursty
149+
activator -- when a particular revision has sufficient replicas to handle bursty
150150
traffic, the ingress gateway is programmed with the direct backend addresses of
151151
the application pods.
152152

@@ -179,7 +179,7 @@ configuration of the application, and can presumably run arbitrary code and
179179
access all the resources which the application can.)
180180

181181
Because not all components are involved in processing a request, we declare in
182-
each situation which Knative components may be targeted by an attacker to achive
182+
each situation which Knative components may be targeted by an attacker to achieve
183183
these goals. See [migitations](#threat-mitigations) for implemented defenses and
184184
additional cluster-specific configuration which may be considered.
185185

@@ -272,7 +272,7 @@ traffic between application namespaces. Knative recommends one or more of the
272272
following technologies which can limit cross-namespace access:
273273

274274
- [Knative Eventing EventPolicy](https://knative.dev/docs/eventing/features/authorization/#defining-an-eventpolicy)
275-
in conjuction with
275+
in conjunction with
276276
[Sender Identity](https://knative.dev/docs/eventing/features/sender-identity/).
277277
- Use of a service mesh, like Istio. This may require
278278
[specific configuration](https://knative.dev/docs/serving/istio-authorization/#before-you-begin)

docs/versioned/reference/security/verifying-cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ Authority=Apple Root CA
5656
Timestamp=3 Oct 2022 at 22:50:07
5757
...
5858
TeamIdentifier=7R64489VHL
59-
```
59+
```

hack/build.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ readonly TEMP="$(mktemp -d)"
4040
readonly SITE=$PWD/site
4141
rm -rf site/
4242

43+
# If we're running on Netlify, update git branches
44+
if [ "$CI" == "true" ]; then
45+
git fetch --prune origin
46+
fi
47+
48+
4349
mkdir "$TEMP/content"
4450
cp -r . "$TEMP/content/"
4551

@@ -64,8 +70,8 @@ if [ "$BUILD_VERSIONS" != "no" ]; then
6470
sed -i 's| versioned/| development/|g' "$TEMP/content/config/redirects.yml"
6571

6672
# Handle current release specially, as we don't include a version slug
67-
# TODO: can we make one clone and reuse it, possibly with git worktrees?
68-
git clone --depth 1 -b "${DOCS_BRANCHES[0]}" "https://github.com/${GIT_SLUG}" "$TEMP/current-release"
73+
# Note that git worktree reuses the same git clone, so we don't need to clone 50+MB each time.
74+
git worktree add --detach "$TEMP/current-release" "origin/${DOCS_BRANCHES[0]}"
6975
if [ -d "$TEMP/current-release/docs/versioned" ]; then
7076
cp -r "$TEMP/current-release/docs/versioned" "$TEMP/content/docs/docs"
7177
echo -e "\ndoc_base: /docs/versioned/" >> "$TEMP/content/docs/docs/.meta.yml"
@@ -99,7 +105,7 @@ if [ "$BUILD_VERSIONS" != "no" ]; then
99105
version=${previous[$i]}
100106

101107
echo "Building for previous version $version"
102-
git clone --depth 1 -b ${DOCS_BRANCHES[$i+1]} https://github.com/${GIT_SLUG} "$TEMP/docs-$version"
108+
git worktree add --detach "$TEMP/docs-$version" "origin/${DOCS_BRANCHES[i+1]}"
103109
if [ -d "$TEMP/docs-$version/docs/versioned" ]; then
104110
cp -r "$TEMP/docs-$version/docs/versioned" "$TEMP/content/docs/v$version-docs"
105111
echo -e "\ndoc_base: /docs/versioned/" >> "$TEMP/content/docs/v$version-docs/.meta.yml"
@@ -159,6 +165,7 @@ cat golang/_redirects >> site/_redirects
159165

160166
# Clean up
161167
# rm -rf $TEMP
168+
# git worktree prune
162169
echo "Temp dir was: $TEMP"
163170

164171
if [ "$1" = "serve" ]; then

overrides/main.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ <h1>⚠ You are viewing an archived snapshot of the documentation for Knative ve
6868
"version": _.version or none
6969
} | tojson -}}
7070
</script>
71-
{% endblock %}
71+
{% endblock %}

overrides/partials/nav.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,4 @@
7575
{{ item.render(nav_item, path, 1) }}
7676
{% endfor %}
7777
</ul>
78-
</nav>
78+
</nav>

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ mkdocs-git-revision-date-localized-plugin>=1.2
66
mkdocs-redirects>=1.0.3
77
mkdocs-rss-plugin>=0.18.0
88
pygithub==1.55
9-
semver==2.13.0
9+
semver==2.13.0

0 commit comments

Comments
 (0)