@@ -41,55 +41,45 @@ readonly SITE=$PWD/site
41
41
rm -rf site/
42
42
43
43
if [ " $BUILD_VERSIONS " == " no" ]; then
44
- # HEAD to root if we're not doing versioning.
44
+ # Build to root if we're not doing versioning
45
45
mkdocs build -f mkdocs.yml -d site
46
46
else
47
- # Versioning: pre-release (HEAD): docs => development/
48
- cp -r . $TEMP /docs-main
47
+ # Build latest version to /docs
48
+ cp -r . " $TEMP /docs-main"
49
49
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"
50
50
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"
51
- pushd " $TEMP /docs-main" ; mkdocs build -f mkdocs.yml -d $SITE /development; popd
52
-
53
- # Latest release branch to root
54
- git clone --depth 1 -b ${DOCS_BRANCHES[0]} https://github.com/${GIT_SLUG} " $TEMP /docs-$latest "
55
-
56
- if [ ${latest#* 1.} -gt 6 ]; then
57
- curl -f -L --show-error https://raw.githubusercontent.com/knative/serving/${DOCS_BRANCHES[0]} /docs/serving-api.md -s > " $TEMP /docs-$latest /docs/serving/reference/serving-api.md"
58
- curl -f -L --show-error https://raw.githubusercontent.com/knative/eventing/${DOCS_BRANCHES[0]} /docs/eventing-api.md -s > " $TEMP /docs-$latest /docs/eventing/reference/eventing-api.md"
59
- else
60
- curl -f -L --show-error https://raw.githubusercontent.com/knative/serving/${DOCS_BRANCHES[0]} /docs/serving-api.md -s > " $TEMP /docs-$latest /docs/reference/api/serving-api.md"
61
- 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"
62
- fi
63
-
64
- pushd " $TEMP /docs-$latest " ; KNATIVE_VERSION=" ${VERSIONS[0]} .0" SAMPLES_BRANCH=" ${DOCS_BRANCHES[0]} " mkdocs build -d $SITE ; popd
65
-
66
- # Previous release branches release-$version to /v$version-docs
67
- versionjson=" "
51
+
52
+ # Create docs directory structure
53
+ mkdir -p " $SITE /docs"
54
+
55
+ # Build latest docs to /docs
56
+ pushd " $TEMP /docs-main"
57
+ KNATIVE_VERSION=" ${VERSIONS[0]} .0" SAMPLES_BRANCH=" ${DOCS_BRANCHES[0]} " mkdocs build -d " $SITE /docs"
58
+ popd
59
+
60
+ # Build versioned docs to /vX.Y-docs/
68
61
for i in " ${! previous[@]} " ; do
69
- version=${previous[$i]}
70
- versionjson+= " { \" version \" : \" v $version -docs \" , \" title \" : \" v $version \" , \" aliases \" : [ \"\" ]}, "
71
-
72
- echo " Building for previous version $version "
73
- git clone --depth 1 -b ${DOCS_BRANCHES[$i+1]} https://github.com/ ${GIT_SLUG} " $TEMP /docs- $version "
74
- if [ ${version #* 1.} -gt 6 ] ; then
75
- curl -f -L --show-error https://raw.githubusercontent.com/knative/serving/ ${DOCS_BRANCHES[i+1]} /docs/serving-api.md -s > " $TEMP /docs-$version /docs/serving/reference/serving-api.md "
76
- curl -f -L --show-error https://raw.githubusercontent.com/knative/eventing/ ${DOCS_BRANCHES[i+1]} /docs/eventing-api.md -s > " $TEMP /docs-$version /docs/eventing/reference/eventing-api.md "
77
- else
78
- curl -f -L --show-error https://raw.githubusercontent.com/knative/serving/ ${DOCS_BRANCHES[i+1]} /docs/serving-api.md -s > " $TEMP /docs-$version /docs/reference/api/serving-api.md "
79
- curl -f -L --show-error https://raw.githubusercontent.com/knative/eventing/ ${DOCS_BRANCHES[i+1]} /docs/eventing-api.md -s > " $TEMP /docs- $version /docs/reference/api/eventing-api.md "
80
- fi
81
- pushd " $TEMP /docs- $version " ; KNATIVE_VERSION=" ${VERSIONS[i+1]} .0" SAMPLES_BRANCH=" ${DOCS_BRANCHES[i+1]} " VERSION_WARNING=true mkdocs build -d " $SITE /v$version -docs" ; popd
82
-
62
+ version=" ${previous[$i]} "
63
+ branch= " ${DOCS_BRANCHES[$((i+1))]} "
64
+
65
+ git clone --depth 1 -b " $branch " " https://github.com/ $GIT_SLUG " " $TEMP /docs- $version "
66
+
67
+ # Copy non-versioned content from main branch
68
+ mkdir -p " $TEMP /docs-$version /docs/about "
69
+ cp -r " $TEMP /docs-main/docs/about " " $TEMP /docs-$version /docs/"
70
+ mkdir -p " $TEMP /docs- $version /docs/community "
71
+ cp -r " $TEMP /docs-main/docs/community " " $TEMP /docs-$version /docs/"
72
+
73
+ pushd " $TEMP /docs- $version "
74
+ KNATIVE_VERSION=" $version .0" SAMPLES_BRANCH=" $branch " mkdocs build -d " $SITE /v$version -docs"
75
+ popd
83
76
done
84
-
85
- # Set up the version file to point to the built docs.
86
- cat << EOF > $SITE /versions.json
87
- [
88
- {"version": "docs", "title": "v$latest ", "aliases": [""]},
89
- $versionjson
90
- {"version": "development", "title": "(Pre-release)", "aliases": [""]}
91
- ]
92
- EOF
77
+
78
+ # Move non-versioned content to /docs
79
+ mkdir -p " $SITE /docs/about"
80
+ cp -r " $TEMP /docs-main/docs/about" " $SITE /docs/"
81
+ mkdir -p " $SITE /docs/community"
82
+ cp -r " $TEMP /docs-main/docs/community" " $SITE /docs/"
93
83
fi
94
84
95
85
# Create the blog
0 commit comments