Upgrade material-mkdocs to major version 8 (#4705)

* update from mkdocs 7.3.1 to 8.1.10

Signed-off-by: Carlos Santana <csantana23@gmail.com>

* add GIT_SLUG to make easier to test with user forks

Signed-off-by: Carlos Santana <csantana23@gmail.com>

* fix warning banner

Signed-off-by: Carlos Santana <csantana23@gmail.com>
This commit is contained in:
Carlos Santana 2022-02-09 12:16:42 -05:00 committed by GitHub
parent 7d94819226
commit a64978b55d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 10 deletions

View File

@ -32,7 +32,8 @@ markdown_extensions:
- attr_list
- meta
- pymdownx.superfences
- pymdownx.tabbed
- pymdownx.tabbed:
alternate_style: true
- pymdownx.details
- pymdownx.snippets:
base_path: docs/snippets

View File

@ -65,20 +65,20 @@
}
/* bit of a hack to stop the banner taking space when empty */
.md-announce .md-announce__inner {
.md-banner .md-banner__inner {
margin: 0 auto;
padding: 0;
}
.md-announce {
.md-banner {
background: #fff5b5;
}
.md-announce .versionwarning h1 {
.md-banner .versionwarning h1 {
font-weight: bold;
}
.md-announce .versionwarning p {
.md-banner .versionwarning p {
color: black;
}
.md-announce a {
.md-banner a {
color: blue;
text-decoration: underline;
}

View File

@ -21,6 +21,7 @@ RELEASE_BRANCHES=("knative-v1.2.0" "knative-v1.1.0" "knative-v1.0.0" "v0.26.0")
DOCS_BRANCHES=("release-${VERSIONS[0]}" "release-${VERSIONS[1]}" "release-${VERSIONS[2]}" "release-${VERSIONS[3]}")
latest=${VERSIONS[0]}
previous=("${VERSIONS[@]:1}")
GIT_SLUG="knative/docs"
readonly TEMP="$(mktemp -d)"
readonly SITE=$PWD/site
@ -37,7 +38,7 @@ else
pushd "$TEMP/docs-main"; mkdocs build -f mkdocs.yml -d $SITE/development; popd
# Latest release branch to /docs
git clone --depth 1 -b ${DOCS_BRANCHES[0]} https://github.com/knative/docs "$TEMP/docs-$latest"
git clone --depth 1 -b ${DOCS_BRANCHES[0]} https://github.com/${GIT_SLUG} "$TEMP/docs-$latest"
curl -f -L --show-error https://raw.githubusercontent.com/knative/serving/${RELEASE_BRANCHES[0]}/docs/serving-api.md -s > "$TEMP/docs-$latest/docs/reference/api/serving-api.md"
curl -f -L --show-error https://raw.githubusercontent.com/knative/eventing/${RELEASE_BRANCHES[0]}/docs/eventing-api.md -s > "$TEMP/docs-$latest/docs/reference/api/eventing-api.md"
pushd "$TEMP/docs-$latest"; KNATIVE_VERSION=${RELEASE_BRANCHES[0]} SAMPLES_BRANCH="${DOCS_BRANCHES[0]}" mkdocs build -d $SITE/docs; popd
@ -49,7 +50,7 @@ else
versionjson+="{\"version\": \"v$version-docs\", \"title\": \"v$version\", \"aliases\": [\"\"]},"
echo "Building for previous version $version"
git clone --depth 1 -b ${DOCS_BRANCHES[$i+1]} https://github.com/knative/docs "$TEMP/docs-$version"
git clone --depth 1 -b ${DOCS_BRANCHES[$i+1]} https://github.com/${GIT_SLUG} "$TEMP/docs-$version"
curl -f -L --show-error https://raw.githubusercontent.com/knative/serving/${RELEASE_BRANCHES[i+1]}/docs/serving-api.md -s > "$TEMP/docs-$version/docs/reference/api/serving-api.md"
curl -f -L --show-error https://raw.githubusercontent.com/knative/eventing/${RELEASE_BRANCHES[i+1]}/docs/eventing-api.md -s > "$TEMP/docs-$version/docs/reference/api/eventing-api.md"
pushd "$TEMP/docs-$version"; KNATIVE_VERSION=${RELEASE_BRANCHES[i+1]//knative-} SAMPLES_BRANCH="${DOCS_BRANCHES[i+1]}" VERSION_WARNING=true mkdocs build -d "$SITE/v$version-docs"; popd

View File

@ -29,7 +29,8 @@ markdown_extensions:
- attr_list
- meta
- pymdownx.superfences
- pymdownx.tabbed
- pymdownx.tabbed:
alternate_style: true
- pymdownx.details
- pymdownx.snippets:
base_path: docs/snippets

View File

@ -1,4 +1,4 @@
mkdocs-material==7.3.1
mkdocs-material==8.1.10
mkdocs-exclude>=1.0
mkdocs-macros-plugin>=0.5.12
mkdocs-awesome-pages-plugin>=2.5