Verified Commit 75423a8d authored by Allen Mak's avatar Allen Mak

Fix redirects (again).

This should remove "/public/" from redirect URLs.

Fix redirects for real this time.

Update build.sh.

Redirect fix has been made prettier and avoids UUOC (Useless Use of Cat)
parent 9612b829
......@@ -50,6 +50,9 @@ cp src/favicon/* public/ || echo "[build.sh] Failure."
#temporarily create redirects for old, non-slug links
#this portion can be removed after gitlab fixes custom 404s
echo [build.sh] Generating redirects…
cat -n src/redirect/redirect.txt | while read n f; do cp src/redirect/redirect.html $f || echo "[build.sh] Failure."; done
<src/redirect/redirect.txt xargs -I % cp src/redirect/redirect.html %
#fix redirects to slugs instead of wiki index
cat -n src/redirect/redirect.txt | while read n f; do find public/ -name $f && sed -i "s|gitlab.io\/|gitlab.io\/${f%.html}\/|g" $f; done
while read r; do
sed -i "s|gitlab.io\/|gitlab.io\/${r%.html}\/|g" $r
sed -i "s|gitlab.io\/public\/|gitlab.io\/|g" $r
done <src/redirect/redirect.txt
......@@ -20,4 +20,4 @@ public/tech/customizing-tildes.html
public/tech/foss-alternatives.html
public/tech/recommended-extensions.html
public/tildes/how-to-guide.html
public/tildes/introduction.html
\ No newline at end of file
public/tildes/introduction.html
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