achorg / DH-Answers-Archive

Archive version of the DH Q&A website acquired via Wayback Machine in early 2020
https://dhanswers.ach.org/
2 stars 1 forks source link

Replace absolute urls pointing to digitalhumanities.org/answers/ to new site url #7

Closed rlskoeser closed 4 years ago

rlskoeser commented 4 years ago

This is already done, but I wanted to document how I did it in case we need to do something similar again.

Multiple command-line search and replace commands for working with the site on a github.io url:

find . -name '*.html' -print0 | xargs -0 sed -i "" "s/='http:\/\/digitalhumanities.org\/answers/='\/DH-Answers-Archive/g"
find . -name '*.html' -print0 | xargs -0 sed -i "" "s/url(http:\/\/digitalhumanities.org\/answers/url(\/DH-Answers-Archive/g"
find . -name '*.html' -print0 | xargs -0 sed -i "" 's/="\/answers/="\/DH-Answers-Archive/g'

Then one more change to remove the github.io relative urls for putting the site on dhanswers.ach.org:

find . -name '*.html' -print0 | xargs -0 sed -i "" 's/\/DH-Answers-Archive//g'