diff options
author | Jacob Janzen <jjanzenn@proton.me> | 2024-08-09 22:38:51 -0500 |
---|---|---|
committer | Jacob Janzen <jjanzenn@proton.me> | 2024-08-09 22:38:51 -0500 |
commit | 83b283239f16f303eaf1c3a379f6242ea6a07c5b (patch) | |
tree | 4f168ee829577dbbf90ca30ebb16ad1f8e822277 | |
parent | c62274d9cbfde56023b6f690e03164ac09a67095 (diff) |
fix links
-rwxr-xr-x | fix-dotfile-paths.sh | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fix-dotfile-paths.sh b/fix-dotfile-paths.sh index fcabd6f..31c0826 100755 --- a/fix-dotfile-paths.sh +++ b/fix-dotfile-paths.sh @@ -4,11 +4,11 @@ create_ls_entry () { echo "#+title: =~/$1=" > index.org echo "* Directories" >> index.org if [ "$1" != "" ]; then - echo "- [[https://jjanzen.ca/dotfiles/$1..][=../=]]" >> index.org + echo "- [[$2$1..][=../=]]" >> index.org fi find -L -- . -maxdepth 1 -type d | sed '/^\.$/d' | sed 's/^\.\///' | while read -r dir; do if [ "$dir" != "*" ] && [ "$dir" != ".git" ]; then - echo "- [[https://jjanzen.ca/dotfiles/$1$dir][=$dir/=]]" >> index.org + echo "- [[$2$1$dir][=$dir/=]]" >> index.org fi done echo "* Files" >> index.org @@ -18,13 +18,14 @@ create_ls_entry () { elif echo "$file" | grep -q "\.org$" && [ "$file" != "index.org" ]; then new_file=$(basename "$(grep '#+begin_src' "$file" | head -1 | cut -d ' ' -f 4)") html=$(echo "$file" | sed 's/\.org$/\.html/') - echo "- [[https://jjanzen.ca/dotfiles/$1$html][=$new_file=]]" >> index.org + echo "- [[$2$1$html][=$new_file=]]" >> index.org fi done } create_dir_tree () { ROOT="$HOME/.dotfiles/$1" + URLROOT="https://jjanzen.ca/dotfiles/$1/" create_ls_entry "" # iterate over all directories @@ -33,7 +34,7 @@ create_dir_tree () { dir=$(echo "$dir" | sed 's/^\.\///') - create_ls_entry "$dir/" + create_ls_entry "$dir/" "$URLROOT" cd "$ROOT" || exit done |