From 83b283239f16f303eaf1c3a379f6242ea6a07c5b Mon Sep 17 00:00:00 2001 From: Jacob Janzen Date: Fri, 9 Aug 2024 22:38:51 -0500 Subject: fix links --- fix-dotfile-paths.sh | 9 +++++---- 1 file 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 -- cgit v1.2.3