diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-01-06 23:41:25 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-01-06 23:41:25 +0900 |
| commit | 2aa21ef38a65f1888b161dc36b7e8492d3b2aab2 (patch) | |
| tree | ea7323bea8be6038391ef5eed03f6f150475a8b4 /ar/.local/bin/hugow | |
| parent | 63d0f3244b429e360297e8cb683689d16dacd77e (diff) | |
modified bin/hugow
Diffstat (limited to 'ar/.local/bin/hugow')
| -rwxr-xr-x | ar/.local/bin/hugow | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/ar/.local/bin/hugow b/ar/.local/bin/hugow index 0460174..13cdf51 100755 --- a/ar/.local/bin/hugow +++ b/ar/.local/bin/hugow @@ -2,11 +2,11 @@ set -eu repodir="$HOME/Private/repos/THESIAH" -out="$repodir/public/recordings/index.html" +out="$repodir/public/diary/index.html" server="${THESIAH_SERVER:-root@thesiah.xyz}" -dest="/var/www/thesiah/recordings/" +dest="/var/www/thesiah/diary/" defaults="sy after foramonth" -src="$repodir/public/recordings/" +src="$repodir/public/diary/" cd "$repodir" hugo --cleanDestinationDir @@ -16,35 +16,35 @@ if [ ! -f "$out" ]; then exit 1 fi -tmp="$(mktemp "$out.XXXXXXXX.tmp")" - -awk -v defaults="$defaults" ' -BEGIN { - n = split(defaults, a, /[[:space:]]+/) - insert = "" - for (i = 1; i <= n; i++) { - if (a[i] == "") continue - name = a[i] ".mp4" - insert = insert \ -" <li>\n" \ -" <a href=\"/recordings/" name "\" data-name=\"" name "\" class=\"vid\">" name "</a>\n" \ -" </li>\n" - } - injected = 0 -} -{ - print - if (!injected && $0 ~ /<ul[^>]*id=["'\''"]list["'\''"][^>]*>/) { - printf("%s", insert) - injected = 1 - } -} -END { if (!injected) exit 2 } -' "$out" >"$tmp" - -mv "$tmp" "$out" -echo "Injected defaults into: $out" +# tmp="$(mktemp "$out.XXXXXXXX.tmp")" +# awk -v defaults="$defaults" ' +# BEGIN { +# n = split(defaults, a, /[[:space:]]+/) +# insert = "" +# for (i = 1; i <= n; i++) { +# if (a[i] == "") continue +# name = a[i] ".mp4" +# insert = insert \ +# " <li>\n" \ +# " <a href=\"/diary/" name "\" data-name=\"" name "\" class=\"vid\">" name "</a>\n" \ +# " </li>\n" +# } +# injected = 0 +# } +# { +# print +# if (!injected && $0 ~ /<ul[^>]*id=["'\''"]list["'\''"][^>]*>/) { +# printf("%s", insert) +# injected = 1 +# } +# } +# END { if (!injected) exit 2 } +# ' "$out" >"$tmp" +# +# mv "$tmp" "$out" +# echo "Injected defaults into: $out" +# ssh "$server" "mkdir -p '$dest'" if [ -n "${THESIAH_SSH_OPTS:-}" ]; then @@ -57,7 +57,7 @@ else fi if [ -n "${1-}" ]; then - new="$repodir/content/recordings/$1" + new="$repodir/content/diary/$1" if [ -f "$new" ]; then rsync -az --update "$new" "$server:$dest" elif [ -d "$new" ]; then |
