Skip to content

Commit 2c79dca

Browse files
committed
Fix base URL change
1 parent c4d3cea commit 2c79dca

File tree

3 files changed

+11
-29
lines changed

3 files changed

+11
-29
lines changed

hack/build.sh

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ set -x
2727
# 1) Make a release-NN branch as normal.
2828
# 2) Update VERSIONS below (on main) to include the new version, and remove the oldest
2929
# Order matters :-), Most recent first.
30-
VERSIONS=("1.19" "1.18" "1.17") # Docs version, results in the url e.g. knative.dev/docs-1.9/..
30+
VERSIONS=("1.19" "1.18" "1.17") # Docs version, results in the url e.g. knative.dev/v1.9-docs/..
3131
# 4) PR the result to main.
3232
# 5) Party.
3333

@@ -41,16 +41,16 @@ readonly SITE=$PWD/site
4141
rm -rf site/
4242

4343
if [ "$BUILD_VERSIONS" == "no" ]; then
44-
# HEAD to /docs if we're not doing versioning.
45-
mkdocs build -f mkdocs.yml -d site/docs
44+
# HEAD to root if we're not doing versioning.
45+
mkdocs build -f mkdocs.yml -d site
4646
else
4747
# Versioning: pre-release (HEAD): docs => development/
4848
cp -r . $TEMP/docs-main
4949
curl -f -L --show-error https://raw.githubusercontent.com/knative/serving/main/docs/serving-api.md -s > "$TEMP/docs-main/docs/serving/reference/serving-api.md"
5050
curl -f -L --show-error https://raw.githubusercontent.com/knative/eventing/main/docs/eventing-api.md -s > "$TEMP/docs-main/docs/eventing/reference/eventing-api.md"
5151
pushd "$TEMP/docs-main"; mkdocs build -f mkdocs.yml -d $SITE/development; popd
5252

53-
# Latest release branch to /docs
53+
# Latest release branch to root
5454
git clone --depth 1 -b ${DOCS_BRANCHES[0]} https://github.com/${GIT_SLUG} "$TEMP/docs-$latest"
5555

5656
if [ ${latest#*1.} -gt 6 ]; then
@@ -61,7 +61,7 @@ else
6161
curl -f -L --show-error https://raw.githubusercontent.com/knative/eventing/${DOCS_BRANCHES[0]}/docs/eventing-api.md -s > "$TEMP/docs-$latest/docs/reference/api/eventing-api.md"
6262
fi
6363

64-
pushd "$TEMP/docs-$latest"; KNATIVE_VERSION="${VERSIONS[0]}.0" SAMPLES_BRANCH="${DOCS_BRANCHES[0]}" mkdocs build -d $SITE/docs; popd
64+
pushd "$TEMP/docs-$latest"; KNATIVE_VERSION="${VERSIONS[0]}.0" SAMPLES_BRANCH="${DOCS_BRANCHES[0]}" mkdocs build -d $SITE; popd
6565

6666
# Previous release branches release-$version to /v$version-docs
6767
versionjson=""
@@ -107,25 +107,7 @@ cp golang/*.html site/golang/
107107
cat golang/_redirects >> site/_redirects
108108

109109

110-
# Home page is served from docs, so add a redirect.
111-
cat << EOF > site/index.html
112-
<!DOCTYPE html>
113-
<html>
114-
<head>
115-
<meta charset="utf-8">
116-
<title>Redirecting</title>
117-
<noscript>
118-
<meta http-equiv="refresh" content="1; url=docs/" />
119-
</noscript>
120-
<script>
121-
window.location.replace("docs/");
122-
</script>
123-
</head>
124-
<body>
125-
Redirecting to <a href="docs/">docs/</a>...
126-
</body>
127-
</html>
128-
EOF
110+
# Home page is now served directly from root, no redirect needed
129111

130112
# Clean up
131113
rm -rf $TEMP

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ extra_css:
77
- stylesheets/extra.css
88

99
repo_url: https://github.com/knative/docs
10-
edit_uri: edit/main/docs
10+
edit_uri: edit/main
1111

1212
theme:
1313
name: material

netlify.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
to = "/:splat"
3939
status = 301
4040

41-
# Ensure the root path serves the docs
41+
# Redirect old /docs path to root
4242
[[redirects]]
43-
from = "/"
44-
to = "/index.html"
45-
status = 200
43+
from = "/docs"
44+
to = "/"
45+
status = 301

0 commit comments

Comments
 (0)