Commit 7ec2b22d authored by Nathalie Furmento's avatar Nathalie Furmento

create redirect instead of modifying source files

parent 455b679e
Pipeline #159493 passed with stages
in 1 minute and 22 seconds
......@@ -21,7 +21,7 @@
<h3>Need any help?</h3>
<p>For any questions regarding StarPU, you can
<ul>
<li>Read the latest <a href="/files/testing/master/doc/html">documentation</a>,
<li>Read the latest <a href="/files/testing/master/doc/html/">documentation</a>,
and more specifically the <a href="/files/testing/master/doc/html/FrequentlyAskedQuestions.html">FAQ</a>,</li>
<li>Read the <a href="/tutorials/">tutorials</a>,</li>
<li>Browse
......
......@@ -68,7 +68,7 @@ StarPU.
</p>
<p>
The latest documentation in <a href="/files/testing/master/doc/starpu.pdf">PDF</a>
and <a href="/files/testing/master/doc/html">HTML</a> is updated everyday, but covers
and <a href="/files/testing/master/doc/html/">HTML</a> is updated everyday, but covers
the latest developments which may not be available in the latest release.
</p>
</div>
......
......@@ -2,14 +2,10 @@
dir=$(dirname $0)
createRedirect()
createRedirectFile()
{
while read line
do
src=$(echo $line | awk '{print $1}')
dst=$(echo $line | awk '{print $2}')
echo create redirect from $src to $dst
mkdir -p public/$src
src=$1
dst=$2
(cat <<EOF
<head>
<title>Page has moved!</title>
......@@ -17,17 +13,44 @@ createRedirect()
</head>
EOF
) > public/$src/index.html
) > public/$src
}
createRedirectDir()
{
src=$1
dst=$2
mkdir -p public/$src
createRedirectFile $src/index.html $dst
}
createRedirect()
{
while read line
do
src=$(echo $line | awk '{print $1}')
dst=$(echo $line | awk '{print $2}')
echo create redirect from $src to $dst
createRedirectDir $src $dst
done< $dir/redirect.txt
}
updateFileLinks()
{
for f in $(grep -rsl 'href="/files' public)
for x in $(grep -rs 'href="\/files/' public | tr ' ' '\012' | tr '\t' '\012' | grep href | sed -e 's/href="//' -e 's/".*//' -e 's/#.*//' | sort | uniq)
do
echo update file links in $f
sed -i 's/href="\/files/href="http:\/\/starpu.gforge.inria.fr\/files/g' $f
echo "create redirect for $x"
case "$x" in
*/) createRedirectDir $x "http://starpu.gforge.inria.fr$x" ;;
*) mkdir -p public/$(dirname $x) && createRedirectFile $x "http://starpu.gforge.inria.fr$x" ;;
esac
done
# for f in $(grep -rsl 'href="/files' public)
# do
# echo update file links in $f
# sed -i 's/href="\/files/href="http:\/\/starpu.gforge.inria.fr\/files/g' $f
# done
}
rm -rf public
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment