yay! the script was easier to write than i expected (to clone my existing blog to
prose.sh
and fix relative links)
basically, i just have to replace anything that looks like [ATinyGame](/ATinyGame)
with [ATinyGame](https://johanv.net/ATinyGame/)
i do this by finding the ](/
part, which is between the link text and the URL of
the original
then i replace it with ](https://johanv.net/
, which preserves both the link text
and the rest of the URL
repeat this for all files in the blog directory, putting the output in the prose.sh directory
entire script #
1#!/bin/bash
2IN=~/git/johanvandegriff/johanv.net/content/blog
3OUT=~/nextcloud/website/prose.sh
4BASEURL=https://johanv.net/
5
6for file in $IN/*.md; do
7 echo "cat $file | sed 's,](/,]('$BASEURL',g' > $OUT/`basename $file`"
8 cat $file | sed 's,](/,]('$BASEURL',g' > $OUT/`basename $file`
9done
10
11scp $OUT/*.md prose.sh:/
12scp $OUT/_styles.css prose.sh:/
now all the links on here are fixed :] and all i have to do when i change something on my site is rerun that script which also uploads the posts to prose.sh
note: this post (and this one and this one) are only on prose.sh, which i did by editing them directly in the output folder, so i have to make sure not to delete that folder and regenerate it, or these will be missing
update: made the script better