Related issues
Closes #37643 (closed)
Description
This PR suggests to modify docs/v5.0
and docs/v5.1
to keep the context of navigation when going from v5.0/v5.1 to v5.2. Going from v5.2 to v5.1/v5.2 is already in place.
Used the following script to modify everything (not a good quality one but worked pretty well). Put it here, can be useful for future selves.
#!/bin/bash
echo "toto"
for file in `find docs/5.0 -name "index.html" -type f`
do
# echo $file
# Get path (e.g. /about/brand)
test=`echo $file | tail -c +9`
path=`echo $test | rev | cut -c 11- | rev`
# Filter the files we want to modify
toto=`cat $file | grep "<a class=\"dropdown-item\" href=\"https://getbootstrap.com/docs/5.2/\">"`
if [[ $toto ]]
then
ttt=`echo $path | sed 's/\//\\\\\//g'`
echo $ttt
# First modification
sed 's/<a class="dropdown-item" href="https:\/\/getbootstrap.com\/docs\/5.2\/">/<a class="dropdown-item" href="https:\/\/getbootstrap.com\/docs\/5.2'${ttt}'">/g' $file > $file.out
mv $file.out $file
# Second modification
sed 's/<a class="dropdown-item" href="https:\/\/getbootstrap.com\/docs\/5.1\/">v5.1.x<\/a>/<a class="dropdown-item" href="https:\/\/getbootstrap.com\/docs\/5.1'${ttt}'">v5.1.3<\/a>/g' $file > $file.out
mv $file.out $file
# Third modification
sed 's/<a class="dropdown-item current" aria-current="true" href="\/docs\/5.0\/">v5.0.x<\/a>/<a class="dropdown-item current" aria-current="true" href="\/docs\/5.0'${ttt}'">v5.0.2<\/a>/g' $file > $file.out
mv $file.out $file
fi
done
for file in `find docs/5.1 -name "index.html" -type f`
do
# echo $file
# Get path /about/brand for example
test=`echo $file | tail -c +9`
path=`echo $test | rev | cut -c 11- | rev`
# Filter the files we want to modify
toto=`cat $file | grep "<a class=\"dropdown-item\" href=\"https://getbootstrap.com/docs/5.2/\">"`
if [[ $toto ]]
then
ttt=`echo $path | sed 's/\//\\\\\//g'`
echo $ttt
# First modification
sed 's/<a class="dropdown-item" href="https:\/\/getbootstrap.com\/docs\/5.2\/">/<a class="dropdown-item" href="https:\/\/getbootstrap.com\/docs\/5.2'${ttt}'">/g' $file > $file.out
mv $file.out $file
# Second modification
sed 's/<a class="dropdown-item current" aria-current="true" href="\/docs\/5.1\/">v5.1.x<\/a>/<a class="dropdown-item current" aria-current="true" href="\/docs\/5.1'${ttt}'">v5.1.3<\/a>/g' $file > $file.out
mv $file.out $file
# Third modification
sed 's/<a class="dropdown-item" href="https:\/\/getbootstrap.com\/docs\/5.0\/">v5.0.x<\/a>/<a class="dropdown-item" href="https:\/\/getbootstrap.com\/docs\/5.0'${ttt}'">v5.0.2<\/a>/g' $file > $file.out
mv $file.out $file
fi
done
Motivation & Context
This modification could be very helpful for folks arriving from search engines results where, we know it, Bootstrap is not always referenced with the latest version (more details in the issue).
Type of changes
-
Enhancement
Checklist
-
I have read the contributing guidelines -
My code follows the code style of the project (using npm run lint
) -
My change introduces changes to the documentation -
I have updated the documentation accordingly -
All new and existing tests passed