Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 7ec2b22d authored by Nathalie Furmento's avatar Nathalie Furmento
Browse files

create redirect instead of modifying source files

parent 455b679e
No related branches found
No related tags found
No related merge requests found
......@@ -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,32 +2,55 @@
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
(cat <<EOF
src=$1
dst=$2
(cat <<EOF
<head>
<title>Page has moved!</title>
<meta http-equiv="Refresh" content="0; URL=$dst" />
</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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment