diff options
author | Marcel Amirault <mamirault@gitlab.com> | 2022-05-24 10:54:46 +0300 |
---|---|---|
committer | Marcel Amirault <mamirault@gitlab.com> | 2022-05-24 10:54:46 +0300 |
commit | 0c7b52de16ad2db877210946e432c0eb2ad488ce (patch) | |
tree | c6c50eac5735a9372abdd93acb9e32c7a70ce20b | |
parent | a18b042fdd07f370d50dd1b58bcdf86ea084cdf5 (diff) | |
parent | 01d0d14208bb0b54830689195e1465e4e933275c (diff) |
Merge branch 'axil-operator-normalize-script' into 'main'
Add Operator to normalize-links.sh
See merge request gitlab-org/gitlab-docs!2715
-rw-r--r-- | doc/development.md | 2 | ||||
-rwxr-xr-x | scripts/normalize-links.sh | 12 |
2 files changed, 8 insertions, 6 deletions
diff --git a/doc/development.md b/doc/development.md index 640b581e..144544c7 100644 --- a/doc/development.md +++ b/doc/development.md @@ -209,3 +209,5 @@ To add an additional set of product documentation to <https://docs.gitlab.com> f ``` 1. Edit the [`Rakefile`](https://gitlab.com/gitlab-org/gitlab-docs/-/blob/68814c875e322b1871d6368135af49794041ddd1/Rakefile#L107-113) and add a line to replace the product's branch variable. If the product doesn't have a stable branch process, omit this step to use the product's default branch. +1. Edit [`scripts/normalize-links.sh`](https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/scripts/normalize-links.sh) + and add the new product to the `Relative URLs` and `Full URLs` sections. diff --git a/scripts/normalize-links.sh b/scripts/normalize-links.sh index 0e35e022..3f5d8e46 100755 --- a/scripts/normalize-links.sh +++ b/scripts/normalize-links.sh @@ -33,9 +33,6 @@ fi ## ## Relative URLs ## -echo "Replace relative URLs in $TARGET/$VER for /ce/" -find ${TARGET}/$VER -type f -name '*.html' -print0 | xargs -0 sed -i 's#="/ce/#="/'"$VER"'/ce/#g' - echo "Replace relative URLs in $TARGET/$VER for /ee/" find ${TARGET}/$VER -type f -name '*.html' -print0 | xargs -0 sed -i 's#="/ee/#="/'"$VER"'/ee/#g' @@ -48,6 +45,9 @@ find ${TARGET}/$VER -type f -name '*.html' -print0 | xargs -0 sed -i 's#="/omnib echo "Replace relative URLs in $TARGET/$VER for /charts/" find ${TARGET}/$VER -type f -name '*.html' -print0 | xargs -0 sed -i 's#="/charts/#="/'"$VER"'/charts/#g' +echo "Replace relative URLs in $TARGET/$VER for /operator/" +find ${TARGET}/$VER -type f -name '*.html' -print0 | xargs -0 sed -i 's#="/operator/#="/'"$VER"'/operator/#g' + echo "Replace relative URLs in $TARGET/$VER for /assets/" find ${TARGET}/$VER -type f -name '*.html' -print0 | xargs -0 sed -i 's#="/assets/#="/'"$VER"'/assets/#g' @@ -63,9 +63,6 @@ find ${TARGET}/$VER -type f -name '*.html' -print0 | xargs -0 sed -i 's#="/opens ## ## Full URLs ## -echo "Replace full URLs in $TARGET/$VER for /ce/" -find ${TARGET}/$VER -type f -name '*.html' -print0 | xargs -0 sed -i 's#="https://docs.gitlab.com/ce/#="/'"$VER"'/ce/#g' - echo "Replace full URLs in $TARGET/$VER for /ee/" find ${TARGET}/$VER -type f -name '*.html' -print0 | xargs -0 sed -i 's#="https://docs.gitlab.com/ee/#="/'"$VER"'/ee/#g' @@ -78,6 +75,9 @@ find ${TARGET}/$VER -type f -name '*.html' -print0 | xargs -0 sed -i 's#="https: echo "Replace full URLs in $TARGET/$VER for /charts/" find ${TARGET}/$VER -type f -name '*.html' -print0 | xargs -0 sed -i 's#="https://docs.gitlab.com/charts/#="/'"$VER"'/charts/#g' +echo "Replace full URLs in $TARGET/$VER for /operator/" +find ${TARGET}/$VER -type f -name '*.html' -print0 | xargs -0 sed -i 's#="https://docs.gitlab.com/operator/#="/'"$VER"'/operator/#g' + echo "Fix URLs inside the sitemap" find ${TARGET}/$VER -type f -name 'sitemap.xml' -print0 | xargs -0 sed -i 's#docs.gitlab.com/#docs.gitlab.com/'"$VER"'/#g' |