This repository has been archived by the owner on Jul 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 280
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(docs): redirect docs pages to new docs
- Loading branch information
1 parent
de10506
commit 7c4dedc
Showing
23 changed files
with
169 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
<meta http-equiv="refresh" content="1; url='https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/'" /> | ||
|
||
!!! important "This page has moved" | ||
This page has moved to [https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Geting-Started/](https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Geting-Started/). Redirecting to the new page. | ||
|
||
|
||
# Getting Started | ||
|
||
The Getting Started document has moved [here](Getting-Started.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env bash | ||
|
||
# ApplicationSet docs now live at https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/ | ||
# This script adds redirects to the top of each ApplicationSet doc to redirect to the new location. | ||
|
||
set -e pipefail | ||
|
||
new_docs_base_path="https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/" | ||
new_docs_base_path_regex=$(echo "$new_docs_base_path" | sed 's/\//\\\//g') | ||
|
||
# Loop over files in the docs directory recursively. For each file, use sed to add the following redirect to the top: | ||
# <meta http-equiv="refresh" content="0; url='https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/{FILE PATH}'" /> | ||
# FILE_PATH should be the path to the file relative to the docs directory, stripped of the .md extension. | ||
|
||
files=$(find docs -type f -name '*.md') | ||
for file in $files; do | ||
file_path=$(echo "$file" | sed 's/^docs\///' | sed 's/\.md$/\//') | ||
echo "Adding redirect to $file_path" | ||
# If a redirect is already present at the top of the file, remove it. | ||
sed '1s/<meta http-equiv="refresh" content="0; url='\''https:\/\/argo-cd.readthedocs.io\/en\/latest\/operator-manual\/applicationset\/.*'\'' \/>//' "$file" > "$file.tmp" | ||
mv "$file.tmp" "$file" | ||
|
||
# Add the new redirect. | ||
# Default to an empty path. | ||
file_path_regex="" | ||
if curl -s -o /dev/null -w "%{http_code}" "$new_docs_base_path$file_path/" | grep -q 200; then | ||
# If the destination path exists, use it. | ||
file_path_regex=$(echo "$file_path" | sed 's/\//\\\//g') | ||
fi | ||
|
||
notice="!!! important \"This page has moved\"\n This page has moved to [$new_docs_base_path$file_path]($new_docs_base_path$file_path). Redirecting to the new page.\n" | ||
|
||
notice_regex=$(echo "$notice" | sed 's/\//\\\//g') | ||
|
||
sed "1s/^/<meta http-equiv=\"refresh\" content=\"1; url='$new_docs_base_path_regex$file_path_regex'\" \/>\\n\\n$notice_regex\\n\\n/" "$file" > "$file.tmp" | ||
mv "$file.tmp" "$file" | ||
done |