99
1010# The target deprecated versions to update, folders in site directory
1111# List to complete
12- DEPRECATED=(3.34 3.28 3.22 3.16 3.10 3.4)
12+ DEPRECATED=(3.40 3. 34 3.28 3.22 3.16 3.10 3.4)
1313# The versions to reference. List to complete
14- DOCVERSIONS=(testing latest 3.40 3.34 3.28 3.22 3.16 3.10 3.4 2.18)
14+ DOCVERSIONS=(testing latest 3.44 3. 40 3.34 3.28 3.22 3.16 3.10 3.4 2.18)
1515# The main parent folder as a parameter, or use current folder (default value)
1616SPATH=${1:- $PWD }
1717
@@ -21,29 +21,28 @@ export LC_ALL=en_US.UTF-8
2121
2222function fix_versionsUrl {
2323
24- for release in " ${DEPRECATED[@]} " ; do
24+ for release in " ${DEPRECATED[@]} " ; do
2525
26- echo " Replacing urls in ${release} doc files..."
27- for HTMLFILE in ` find ${SPATH} /${release} -type f -name ' *.html' ` ; do
26+ echo " Replacing urls in ${release} doc files..."
27+ for HTMLFILE in $( find ${SPATH} /${release} -type f -name ' *.html' ) ; do
2828
29- # Identify the actual file in doc structure, removing the parent folders
30- FILEURL=" ${HTMLFILE# ${SPATH} / ${release} / } "
29+ # Identify the actual file in doc structure, removing the parent folders
30+ FILEURL=" ${HTMLFILE# ${SPATH} / ${release} / } "
3131
32- # Create the replacement lines
33- for v in " ${DOCVERSIONS[@]} " ; do
34- REPL=" ${REPL} \n \n <dd><a href=\" https://docs.qgis.org/${v} /${FILEURL} \" >${v} </a></dd>"
35- done
32+ # Create the replacement lines
33+ for v in " ${DOCVERSIONS[@]} " ; do
34+ REPL=" ${REPL} \n \n <dd><a href=\" https://docs.qgis.org/${v} /${FILEURL} \" >${v} </a></dd>"
35+ done
3636
37- # Do the replacement
38- perl -i -p0e " s@<dl>(\s*)<dt>Versions</dt>.*</dl>@<dl>\1<dt>Versions</dt>${REPL} \n \n </dl>@smg" ${HTMLFILE} ;
37+ # Do the replacement
38+ perl -i -p0e " s@<dl>(\s*)<dt>Versions</dt>.*</dl>@<dl>\1<dt>Versions</dt>${REPL} \n \n </dl>@smg" ${HTMLFILE}
3939
40- # let's clear the replacement variable
41- unset REPL
40+ # let's clear the replacement variable
41+ unset REPL
4242
43+ done
44+ echo " Replacement of urls in ${release} doc files finished."
4345 done
44- echo " Replacement of urls in ${release} doc files finished."
45- done
4646}
4747
4848fix_versionsUrl ${SPATH}
49-
0 commit comments