From bc5d01c53a97d8cb652f87b16a63e0e258a051ab Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 19 Apr 2024 14:10:59 -0500 Subject: 2024-04-19 --- good-soups.ul | 13 ++++++ ll | 100 ++++++++++++++++++++++++------------------ ok | 2 +- titles-of-poems.ul | 3 ++ what-i-had-for-lunch-today.ol | 7 +++ why-dont-i-blog.ul | 17 +++++++ 6 files changed, 98 insertions(+), 44 deletions(-) create mode 100644 good-soups.ul create mode 100644 titles-of-poems.ul create mode 100644 what-i-had-for-lunch-today.ol create mode 100644 why-dont-i-blog.ul diff --git a/good-soups.ul b/good-soups.ul new file mode 100644 index 0000000..1cd1357 --- /dev/null +++ b/good-soups.ul @@ -0,0 +1,13 @@ +good soups + +minestrone +miso +tomato +borscht (veggie) +mulligatawny (in name only) +chili (with beans, fight me) +ramen noodle +pho +hell, any noodle +ice water +the kind with croutons in \ No newline at end of file diff --git a/ll b/ll index 6ce90db..da9da55 100755 --- a/ll +++ b/ll @@ -7,26 +7,35 @@ SITE_COPYRIGHT="Case Duckworth" BACK_LINK=index.html,back wrap() { - title="$(sed 1q "$1")" - cat < + + $title

$title

HEAD - cat - cat < FOOT @@ -44,7 +53,7 @@ al()(list ul -F"\n" -vRS= '{printf "
  • %s
  • \n",$1,$2}') dl()(list dl -F"\n" -vRS= '{printf "
    %s
    \n
    %s
    \n",$1,$2}') rss() { - cat < $(sed 1q index.al) @@ -54,29 +63,22 @@ rss() { $SITE_COPYRIGHT $(date +%FT%TZ) HEAD - # entries - awk -F"\n" -vRS= \ - -vbase="$BASE_URL" \ - -vauthor="$SITE_COPYRIGHT" \ - 'NR==1{next} -{ url=$1; title=$2; + # entries + awk -F"\n" -vRS= \ + -vbase="$BASE_URL" \ + -vauthor="$SITE_COPYRIGHT" \ + 'NR==1{next} +{ url=$1; title=$2; updated=$3; file=url; sub(base "/", "", file) printf "\n%s\n", url printf "\n", url printf "%s\n", title printf "%s\n", author - printf "%s\n", updated(file) + printf "%s\n", updated printf "\n", slurp(file) printf "\n" } -function updated (file) { - cmd = "stat -c %y " file " 2>/dev/null" - cmd = cmd " || stat -f %Sm -t %FT%TZ " file " 2>/dev/null" - cmd | getline upd - close(cmd) - return upd -} function slurp (file, out, bodyp) { oldRS=RS; RS="\n" while ((getline < file) > 0) { @@ -87,32 +89,44 @@ function slurp (file, out, bodyp) { RS=oldRS return out }' - cat < FOOT } +modtime() { + mtime="$(stat -c%Y "$1" 2>/dev/null || + stat -f%Sm -t%FT%TZ "$1" 2>/dev/null)" + if test -n "$mtime" + then + # busybox date + date -u -d "@$mtime" +%FT%TZ + fi +} + # Main main() { - printf "%s\n\n" "$SITE_TITLE" > index.al - ls -t *.ul *.dl *.ol *.al 2>/dev/null | - sed '/index.al/d' | - while read -r lst - do - printf >&2 "Processing %s..." "$lst" - "${lst##*.}" < "$lst" | - wrap "$lst" "$BACK_LINK" > "${lst%%.*}.html" - echo "$BASE_URL/${lst%%.*}.html" >> index.al - echo "$(sed 1q "$lst")" >> index.al - echo >> index.al - echo >&2 ok - done - printf >&2 "Processing index..." - al < index.al | wrap index.al > index.html && - echo >&2 ok - printf >&2 "Processing rss..." - rss < index.al > feed.xml && - echo >&2 ok + printf "%s\n\n" "$SITE_TITLE" > index.al + ls -t *.ul *.dl *.ol *.al 2>/dev/null | + sed '/index.al/d' | + while read -r lst + do + printf >&2 "Processing %s..." "$lst" + "${lst##*.}" < "$lst" | + wrap "$lst" "$BACK_LINK" > "${lst%%.*}.html" + printf '%s\n%s\n%s\n\n' \ + "$BASE_URL/${lst%%.*}.html" \ + "$(sed 1q "$lst")" \ + "$(modtime "$lst")" \ + >> index.al + echo >&2 ok + done + printf >&2 "Processing index..." + al < index.al | wrap index.al > index.html && + echo >&2 ok + printf >&2 "Processing rss..." + rss < index.al > feed.xml && + echo >&2 ok } main "$@" diff --git a/ok b/ok index 26ec2b7..6cf1c9c 100644 --- a/ok +++ b/ok @@ -3,7 +3,7 @@ watch(){ # repeatedly serve directory as files change while : do - printf '%s\n' *.ul *.ol *.al *.dl | + printf '%s\n' *.ul *.ol *.al *.dl ll | ok entr -d -r ok serve $NORUN && break done diff --git a/titles-of-poems.ul b/titles-of-poems.ul new file mode 100644 index 0000000..6fc42b9 --- /dev/null +++ b/titles-of-poems.ul @@ -0,0 +1,3 @@ +titles of poems i have not written and may never write + +birds fly to the stars, i guess diff --git a/what-i-had-for-lunch-today.ol b/what-i-had-for-lunch-today.ol new file mode 100644 index 0000000..e460232 --- /dev/null +++ b/what-i-had-for-lunch-today.ol @@ -0,0 +1,7 @@ +what i had for lunch today + +6 lance crackers (toast chee) +1 peanut butter (crunchy) and jelly sandwich +1 mozzarella cheese stick +1 apple (gala) +water \ No newline at end of file diff --git a/why-dont-i-blog.ul b/why-dont-i-blog.ul new file mode 100644 index 0000000..671869c --- /dev/null +++ b/why-dont-i-blog.ul @@ -0,0 +1,17 @@ +why don't i blog? + +too much friction to start a new post +busy with work and other software hobby projects +no ideas +too easy to make excuses +nothing to say +anxiety over being perceived +unsure of tone to strike +i write all day at work as is +i don't read; why would i write +too much pressure on myself to do something good +other reasons +other reasons i should not worry about +other reasons i am using to put a lot of pressure on myself +other "shoulds" +things i can just let go \ No newline at end of file -- cgit 1.4.1-21-gabe81