From b97c7811c7fd1131ae931d65460fbe1a0986e726 Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Sat, 4 Feb 2023 13:09:27 -0800 Subject: what the fuck --- build/website/404.html | 2 +- build/website/about/contact.html | 2 +- build/website/about/index.html | 2 +- build/website/about/technology.html | 2 +- build/website/economics/index.html | 2 +- build/website/economics/source/index.html | 2 +- build/website/fonts/liberationmono-bold-demo.html | 2 +- .../fonts/liberationmono-bolditalic-demo.html | 2 +- .../website/fonts/liberationmono-italic-demo.html | 2 +- .../website/fonts/liberationmono-regular-demo.html | 2 +- build/website/index.html | 4 +-- build/website/mathematics/calculus/index.html | 2 +- .../website/mathematics/calculus/source/index.html | 2 +- .../mathematics/differential_equations/index.html | 2 +- build/website/mathematics/index.html | 2 +- .../website/mathematics/linear_algebra/index.html | 2 +- build/website/music/index.html | 2 +- build/website/philosophy/index.html | 2 +- build/website/physics/index.html | 2 +- build/website/projects/dotfiles.html | 2 +- build/website/projects/index.html | 2 +- build/website/projects/no_excess.html | 2 +- build/website/technology/index.html | 2 +- process_file | 30 +++++++++++----------- website/index.html | 2 +- 25 files changed, 40 insertions(+), 40 deletions(-) diff --git a/build/website/404.html b/build/website/404.html index 3a08ef4..8df2c8e 100644 --- a/build/website/404.html +++ b/build/website/404.html @@ -18,7 +18,7 @@ Home | About | Contact - | Back +
diff --git a/build/website/about/contact.html b/build/website/about/contact.html index f5e426e..179337b 100644 --- a/build/website/about/contact.html +++ b/build/website/about/contact.html @@ -18,7 +18,7 @@ Contact Home | About | Contact - | Back +
diff --git a/build/website/about/index.html b/build/website/about/index.html index b9883bd..3eac262 100644 --- a/build/website/about/index.html +++ b/build/website/about/index.html @@ -18,7 +18,7 @@ About Home | About | Contact - | Back +
diff --git a/build/website/about/technology.html b/build/website/about/technology.html index 38d7215..ad9fce3 100644 --- a/build/website/about/technology.html +++ b/build/website/about/technology.html @@ -18,7 +18,7 @@ About Home | About | Contact - | Back +
diff --git a/build/website/economics/index.html b/build/website/economics/index.html index 2003abb..6d416f5 100644 --- a/build/website/economics/index.html +++ b/build/website/economics/index.html @@ -18,7 +18,7 @@ Economics Home | About | Contact - | Back +
diff --git a/build/website/economics/source/index.html b/build/website/economics/source/index.html index f73696b..140fb76 100644 --- a/build/website/economics/source/index.html +++ b/build/website/economics/source/index.html @@ -18,7 +18,7 @@ Source Home | About | Contact - | Back +
diff --git a/build/website/fonts/liberationmono-bold-demo.html b/build/website/fonts/liberationmono-bold-demo.html index 0a248bd..fd63b2c 100644 --- a/build/website/fonts/liberationmono-bold-demo.html +++ b/build/website/fonts/liberationmono-bold-demo.html @@ -18,7 +18,7 @@ TITLE Home | About | Contact - | Back +
diff --git a/build/website/fonts/liberationmono-bolditalic-demo.html b/build/website/fonts/liberationmono-bolditalic-demo.html index 0a248bd..fd63b2c 100644 --- a/build/website/fonts/liberationmono-bolditalic-demo.html +++ b/build/website/fonts/liberationmono-bolditalic-demo.html @@ -18,7 +18,7 @@ TITLE Home | About | Contact - | Back +
diff --git a/build/website/fonts/liberationmono-italic-demo.html b/build/website/fonts/liberationmono-italic-demo.html index 0a248bd..fd63b2c 100644 --- a/build/website/fonts/liberationmono-italic-demo.html +++ b/build/website/fonts/liberationmono-italic-demo.html @@ -18,7 +18,7 @@ TITLE Home | About | Contact - | Back +
diff --git a/build/website/fonts/liberationmono-regular-demo.html b/build/website/fonts/liberationmono-regular-demo.html index 0a248bd..fd63b2c 100644 --- a/build/website/fonts/liberationmono-regular-demo.html +++ b/build/website/fonts/liberationmono-regular-demo.html @@ -18,7 +18,7 @@ TITLE Home | About | Contact - | Back +
diff --git a/build/website/index.html b/build/website/index.html index 60aa369..66ddff4 100644 --- a/build/website/index.html +++ b/build/website/index.html @@ -18,12 +18,12 @@ Preston Pan Home | About | Contact - +
-

Preston Pan

+

Preston Pan (aka LiCoO2)

Hi! I'm Preston Pan, and this is my v3 of my website. diff --git a/build/website/mathematics/calculus/index.html b/build/website/mathematics/calculus/index.html index 4d7f0bc..a1e1ea1 100644 --- a/build/website/mathematics/calculus/index.html +++ b/build/website/mathematics/calculus/index.html @@ -18,7 +18,7 @@ Calculus Home | About | Contact - | Back +


diff --git a/build/website/mathematics/calculus/source/index.html b/build/website/mathematics/calculus/source/index.html index 1676ae2..d713863 100644 --- a/build/website/mathematics/calculus/source/index.html +++ b/build/website/mathematics/calculus/source/index.html @@ -18,7 +18,7 @@ Calculus Home | About | Contact - | Back +
diff --git a/build/website/mathematics/differential_equations/index.html b/build/website/mathematics/differential_equations/index.html index ab9dd91..15e2dfe 100644 --- a/build/website/mathematics/differential_equations/index.html +++ b/build/website/mathematics/differential_equations/index.html @@ -18,7 +18,7 @@ Mathematics Home | About | Contact - | Back +
diff --git a/build/website/mathematics/index.html b/build/website/mathematics/index.html index e09e7f5..3b06048 100644 --- a/build/website/mathematics/index.html +++ b/build/website/mathematics/index.html @@ -18,7 +18,7 @@ Mathematics Home | About | Contact - | Back +
diff --git a/build/website/mathematics/linear_algebra/index.html b/build/website/mathematics/linear_algebra/index.html index ffebf17..41517ea 100644 --- a/build/website/mathematics/linear_algebra/index.html +++ b/build/website/mathematics/linear_algebra/index.html @@ -18,7 +18,7 @@ Mathematics Home | About | Contact - | Back +
diff --git a/build/website/music/index.html b/build/website/music/index.html index 6fe2f74..6b52ffd 100644 --- a/build/website/music/index.html +++ b/build/website/music/index.html @@ -18,7 +18,7 @@ Music Home | About | Contact - | Back +
diff --git a/build/website/philosophy/index.html b/build/website/philosophy/index.html index fab7dba..986ac0b 100644 --- a/build/website/philosophy/index.html +++ b/build/website/philosophy/index.html @@ -18,7 +18,7 @@ Philosophy Home | About | Contact - | Back +
diff --git a/build/website/physics/index.html b/build/website/physics/index.html index e1441b0..493149a 100644 --- a/build/website/physics/index.html +++ b/build/website/physics/index.html @@ -18,7 +18,7 @@ Physics Home | About | Contact - | Back +
diff --git a/build/website/projects/dotfiles.html b/build/website/projects/dotfiles.html index 5066d49..e0229db 100644 --- a/build/website/projects/dotfiles.html +++ b/build/website/projects/dotfiles.html @@ -18,7 +18,7 @@ Dotfiles Home | About | Contact - | Back +
diff --git a/build/website/projects/index.html b/build/website/projects/index.html index c97df09..3f711cc 100644 --- a/build/website/projects/index.html +++ b/build/website/projects/index.html @@ -18,7 +18,7 @@ Projects Home | About | Contact - | Back +
diff --git a/build/website/projects/no_excess.html b/build/website/projects/no_excess.html index 21910b1..623a61a 100644 --- a/build/website/projects/no_excess.html +++ b/build/website/projects/no_excess.html @@ -18,7 +18,7 @@ NoExcess Home | About | Contact - | Back +
diff --git a/build/website/technology/index.html b/build/website/technology/index.html index c686a69..73e89ef 100644 --- a/build/website/technology/index.html +++ b/build/website/technology/index.html @@ -18,7 +18,7 @@ Technology Home | About | Contact - | Back +
diff --git a/process_file b/process_file index 82b6aa2..a96f9e8 100755 --- a/process_file +++ b/process_file @@ -22,13 +22,13 @@ template_replacement() echo "$r_templates" | while read -r i do # Escapes special characters from line containing $$INCLUDE call - keyword_regexp="$(printf '%s' "$i" | -e sed 's/[]\/$*.^|[]/\\&/g' | sed ':a;N;$!ba;s,\n,\\n,g')" + keyword_regexp="$(printf '%s' "$i" | -e gsed 's/[]\/$*.^|[]/\\&/g' | gsed ':a;N;$!ba;s,\n,\\n,g')" r_tname="$TEMPLATE_DIR/$(echo "$i" | cut -d ' ' -f 2).html" # Get contents of file then escapes special characters f_contents="$(cat "$r_tname")" - replacement_regexp="$(printf '%s' "$f_contents" | sed -e 's/[\/&]/\\&/g' | sed ':a;N;$!ba;s,\n,\\n,g')" - #Finally do the sed replace to replace the $$INCLUDE line with the contents of the included template file - sed -i "s/$keyword_regexp/$replacement_regexp/g" "$TEMPLATE_BUILD_DIR/$(basename "$1")" # BUG: This shit does not work + replacement_regexp="$(printf '%s' "$f_contents" | gsed -e 's/[\/&]/\\&/g' | gsed ':a;N;$!ba;s,\n,\\n,g')" + #Finally do the gsed replace to replace the $$INCLUDE line with the contents of the included template file + gsed -i "s/$keyword_regexp/$replacement_regexp/g" "$TEMPLATE_BUILD_DIR/$(basename "$1")" # BUG: This shit does not work # Then we do it all again on the same file. template_replacement "$1" done @@ -66,23 +66,23 @@ echo "$vars" | while read -r var; do # Get the name of the variable name="$(echo "$var" | cut -d ' ' -f 2 | tr -d '\n')" - keyword_regexp="$(printf '%s' "$var" | sed -e 's/[]\/$*.^|[]/\\&/g' | sed ':a;N;$!ba;s,\n,\\n,g')" + keyword_regexp="$(printf '%s' "$var" | gsed -e 's/[]\/$*.^|[]/\\&/g' | gsed ':a;N;$!ba;s,\n,\\n,g')" # Get the endpoint of the variable var_end="\$\$END $name" - end_regexp="$(printf '%s' "$var_end" | sed -e 's/[\/&]/\\&/g' | sed ':a;N;$!ba;s,\n,\\n,g')" + end_regexp="$(printf '%s' "$var_end" | gsed -e 's/[\/&]/\\&/g' | gsed ':a;N;$!ba;s,\n,\\n,g')" # Get the value of the variable - value="$(< "$BUILD_DIR/$1" sed -n "/$keyword_regexp/,/$end_regexp/p" "$1")" - value_regexp="$(printf '%s' "$value" | sed -e 's/[]\/$*.^|[]/\\&/g' | sed ':a;N;$!ba;s,\n,\\n,g')" + value="$(< "$BUILD_DIR/$1" gsed -n "/$keyword_regexp/,/$end_regexp/p" "$1")" + value_regexp="$(printf '%s' "$value" | gsed -e 's/[]\/$*.^|[]/\\&/g' | gsed ':a;N;$!ba;s,\n,\\n,g')" # Get the string to replace replacement="\$\$VAR $name" - replacement_regexp="$(printf '%s' "$replacement" | sed -e 's/[\/&]/\\&/g' | sed ':a;N;$!ba;s,\n,\\n,g')" + replacement_regexp="$(printf '%s' "$replacement" | gsed -e 's/[\/&]/\\&/g' | gsed ':a;N;$!ba;s,\n,\\n,g')" # Then do the replacement - sed -i "s/$replacement_regexp/$value_regexp/g" "$BUILD_DIR/$1" # BUG: Doesn't work on openBSD + gsed -i "s/$replacement_regexp/$value_regexp/g" "$BUILD_DIR/$1" # BUG: Doesn't work on openBSD done # For some reason I can't trim these inside the loop (i tried) so this works. -sed -i '/\$\$START/d' "$BUILD_DIR/$1" -sed -i '/\$\$END/d' "$BUILD_DIR/$1" +gsed -i '/\$\$START/d' "$BUILD_DIR/$1" +gsed -i '/\$\$END/d' "$BUILD_DIR/$1" debug="$(< "$BUILD_DIR/$1" grep "\$\$SCRIPT")" printf "$debug\n" @@ -93,9 +93,9 @@ then do name="$(echo "$line" | cut -d ' ' -f 2 | tr -d '\n')" output="$(./"$PLUG_DIR/$name" "$1" "$template")" - keyword_regexp="$(printf '%s' "$line" | sed -e 's/[]\/$*.^|[]/\\&/g' | sed ':a;N;$!ba;s,\n,\\n,g')" - replacement_regexp="$(printf '%s' "$output" | sed -e 's/[\/&]/\\&/g' | sed ':a;N;$!ba;s,\n,\\n,g')" + keyword_regexp="$(printf '%s' "$line" | gsed -e 's/[]\/$*.^|[]/\\&/g' | gsed ':a;N;$!ba;s,\n,\\n,g')" + replacement_regexp="$(printf '%s' "$output" | gsed -e 's/[\/&]/\\&/g' | gsed ':a;N;$!ba;s,\n,\\n,g')" - sed -i "s/$keyword_regexp/$replacement_regexp/g" "$BUILD_DIR/$1" # BUG: doesn't work with openBSD + gsed -i "s/$keyword_regexp/$replacement_regexp/g" "$BUILD_DIR/$1" # BUG: doesn't work with openBSD done fi diff --git a/website/index.html b/website/index.html index 84a3a57..ab265c3 100644 --- a/website/index.html +++ b/website/index.html @@ -3,7 +3,7 @@ Preston Pan $$END TITLE $$START CONTENT -

Preston Pan

+

Preston Pan (aka LiCoO2)

Hi! I'm Preston Pan, and this is my v3 of my website. -- cgit