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.


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