Skip to content

Commit

Permalink
[version-3-4] docs: Version Branches Robots.txt Update (#4324) (#4326)
Browse files Browse the repository at this point in the history
* docs: Version Branches Robots.txt Update (#4324)

* chore: sligh bash modification

* chore: Apply suggestions from code review

Co-authored-by: Lenny Chen <55669665+lennessyy@users.noreply.github.com>

---------

Co-authored-by: Lenny Chen <55669665+lennessyy@users.noreply.github.com>
(cherry picked from commit 7927729)

* ci: adding missing robots.txt or updating noindex in docusaurus.config.js

---------

Co-authored-by: Karl Cardenas <29551334+karl-cardenas-coding@users.noreply.github.com>
Co-authored-by: vault-token-factory-spectrocloud[bot] <vault-token-factory-spectrocloud[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Oct 17, 2024
1 parent 0ab3712 commit c8db9a4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/versions_robot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,21 @@ jobs:
- name: Check if robots.txt exists and create if missing
shell: bash
run: |
if [ ! -f "static/robots.txt" ]; then
echo "Does not Exist"
echo "User-agent: *" > static/robots.txt
echo "Disallow: /" >> static/robots.txt
else
echo "Robots.txt file exists"
fi
if [ ! -f "static/robots.txt" ]; then
echo "Does not Exist. Creating file with expected content..."
echo "User-agent: *" > static/robots.txt
echo "Disallow: /" >> static/robots.txt
else
echo "Robots.txt file exists"
if ! grep -Fxq "User-agent: *" static/robots.txt || ! grep -Fxq "Disallow: /" static/robots.txt; then
echo "Robots.txt file does not have the expected content. Updating..."
echo "User-agent: *" > static/robots.txt
echo "Disallow: /" >> static/robots.txt
else
echo "Robots.txt file has the expected content."
fi
fi
- name: Ensure noIndex is set
id: check_noindex
run: node scripts/noindex_docusaurus_config.js $RUNNER_TEMP $PWD && mv $RUNNER_TEMP/temp.docusaurus.config.js $PWD/docusaurus.config.js
Expand Down
2 changes: 2 additions & 0 deletions static/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Disallow: /

0 comments on commit c8db9a4

Please sign in to comment.