diff options
author | Sarah German <sgerman@gitlab.com> | 2023-02-01 02:00:59 +0300 |
---|---|---|
committer | David O'Regan <doregan@gitlab.com> | 2023-02-01 02:00:59 +0300 |
commit | e67b7d42efefac4bbb566299287e62813a517e4d (patch) | |
tree | 237da105ddd901760fca55f306e846e23880fc91 /scripts | |
parent | afefd480f4d05b48c9a890911d75a2965678ade8 (diff) |
Add Google search forms
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/check-lunr-index.sh | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/check-lunr-index.sh b/scripts/check-lunr-index.sh index 591b1fcd..2fd4b68e 100755 --- a/scripts/check-lunr-index.sh +++ b/scripts/check-lunr-index.sh @@ -9,18 +9,18 @@ COLOR_RESET="\e[39m" # # - index_check: checks if the lunr.js index is built. There's two files when the # index is built: 'lunr-index.json' and 'lunr-map.json'. -# - dev_check: when SEARCH_BACKEND is set to 'lunr' the div we're looking for -# is set to 'js-lunr-form'. Otherwise, it's set to 'docsearch' by default. +# - dev_check: when SEARCH_BACKEND is set to 'lunr' the string we're looking for +# is 'lunr.min.js'. Otherwise, it's set to 'docsearch' by default. # This is defined in # https://gitlab.com/gitlab-org/gitlab-docs/-/blob/83ebc0de813c6e916b522a9203a6182d7425dd20/content/index.erb#L20-24. # if [ "$CI" = "true" ]; then - div_check=$(docker run --rm "$IMAGE_NAME" grep -o js-lunr-form "/usr/share/nginx/html/$GITLAB_VERSION/index.html") + lunr_check=$(docker run --rm "$IMAGE_NAME" grep -o lunr.min.js "/usr/share/nginx/html/$GITLAB_VERSION/search/index.html") index_check=$(docker run --rm "$IMAGE_NAME" find "/usr/share/nginx/html/$GITLAB_VERSION/assets/javascripts/lunr-index.json" | wc -l) else - div_check=$(grep -o js-lunr-form public/index.html) + lunr_check=$(grep -o lunr.min.js public/search/index.html) index_check=$(find public/assets/javascripts/lunr-index.json | wc -l) fi @@ -33,7 +33,7 @@ then printf " For more information, see https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/doc/docsearch.md#lunrjs-search${COLOR_RESET}\n" exit 1; else - if [ "$div_check" != "js-lunr-form" ]; + if [ "$lunr_check" != "lunr.min.js" ]; then # shellcheck disable=2059 printf "${COLOR_RED}ERROR: lunr.js index is found, but not enabled!\n" |