From 849013a6d2ae99ea1b088298b8f2067818b7404d Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 24 May 2022 17:16:49 -0500 Subject: Generate a feed --- .last_build | 0 Makefile | 12 ++++++++++-- ht.awk | 9 +++------ src/beans.html | 21 --------------------- src/compile.ht | 1 + src/favicon.ht | 1 + src/friday.ht | 15 +++++++++++++++ tmpl.feed.xml | 27 +++++++++++++++++++++++++++ tmpl.index.htm | 6 +++++- 9 files changed, 62 insertions(+), 30 deletions(-) delete mode 100644 .last_build delete mode 100644 src/beans.html create mode 100644 src/friday.ht create mode 100644 tmpl.feed.xml diff --git a/.last_build b/.last_build deleted file mode 100644 index e69de29..0000000 diff --git a/Makefile b/Makefile index 87e730d..e7c5863 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,13 @@ ITMPR = \ env HTTMP='$T' HTOUT='\$$@' \ ${HTSH} "${ITMPL}" < /dev/null > '\$$@' -TMPL = ${PTMPL} ${ITMPL} +RTMPL = tmpl.feed.xml +RTMPR = \ + feed.xml: ${RTMPL} index.html $$(cat ${TPG}); \ + env HTTMP='$T' HTOUT='\$$@' \ + ${HTSH} "${RTMPL}" < /dev/null > '\$$@' + +TMPL = ${PTMPL} ${ITMPL} ${RTMPL} BUILD_INPUTS = ${INPUT}/* ${TMPL} ${HT} RSYNCEXCLUDE = \ @@ -51,6 +57,7 @@ RSYNCEXCLUDE = \ "*.mk" \ "*.awk" \ "*.bod.txt" \ + "tmpl.*" \ "tmp/" RSYNCEXCLUDEFILE = ${BUILD}/.rsync-exclude RSYNC = rsync -auvz --exclude-from="${RSYNCEXCLUDEFILE}" --delete @@ -75,7 +82,8 @@ ${HTMK}: Makefile ${INPUT}/*.ht $T done >> '$@' @printf '%s\n' "${ITMPR}" >> '$@' - @printf "build: $$(cat ${TPG}) index.html" >> '$@' + @printf '%s\n' "${RTMPR}" >> '$@' + @printf "build: $$(cat ${TPG}) index.html feed.xml" >> '$@' @printf '%s\n' 'done' $T: ; mkdir -p "$@" diff --git a/ht.awk b/ht.awk index 5328361..faa729d 100755 --- a/ht.awk +++ b/ht.awk @@ -15,6 +15,7 @@ function buflush() { } function esc(t) { + # This is of much more limited utility than I initially realized. gsub(/&/, "\\&", t); gsub(//, "\\>", t); @@ -30,8 +31,8 @@ function esc(t) { } /^=>/ { # Links (Gemini-style) - link = "" esc($3); - for (i=4;i<=NF;i++) link = link " " esc($i); + link = "" $3; + for (i=4;i<=NF;i++) link = link " " $i; link = link ""; bufpush(link); next; @@ -39,20 +40,17 @@ function esc(t) { /^-/ { # Unordered lists if (! (tag == "ul")) tag = "ul"; - esc($0); sub(/^-[ \t]*/, "
  • "); } /^[0-9]+\./ { # Ordered lists if (! (tag == "ol")) tag = "ol"; - esc($0); sub(/^[0-9]+\.[ \t]/, "
  • "); } /^>/ { # Blockquotes if (! (tag == "blockquote")) tag = "blockquote"; sub(/^>[ \t]*/,""); - esc($0); } /^#+/ { # Headers @@ -62,7 +60,6 @@ function esc(t) { tag = "h" RLENGTH; } sub(/^#+[ \t]*/,""); - esc($0); } /^$/ { diff --git a/src/beans.html b/src/beans.html deleted file mode 100644 index ff89934..0000000 --- a/src/beans.html +++ /dev/null @@ -1,21 +0,0 @@ -html,body { - min-height: 100vh; - margin:0; padding: 0; -} - -html { - font: 18px serif; - background: #385180; -} - -body { - max-width: 79ch; - padding: 0 2ch; - margin: 0 auto; - background: #405990; - color: white; -} - -a { - color: yellow; -} diff --git a/src/compile.ht b/src/compile.ht index 5764828..9fb91c9 100644 --- a/src/compile.ht +++ b/src/compile.ht @@ -1,4 +1,5 @@ ;@@title: Compiling!@@ +;@@date: 2022-05-24@@ I've been using Emacs to write this site so far, and it has a convenient M-x compile command that is fun to use. However, I frequently want diff --git a/src/favicon.ht b/src/favicon.ht index b9df118..adb0ea6 100644 --- a/src/favicon.ht +++ b/src/favicon.ht @@ -1,4 +1,5 @@ ;@@title: Embedded data-url favicon@@ +;@@date: 2022-05-18@@ You might notice that I have a new favicon on this site. I didn't want to make a whole nother request, so I took a page from diff --git a/src/friday.ht b/src/friday.ht new file mode 100644 index 0000000..a1180e8 --- /dev/null +++ b/src/friday.ht @@ -0,0 +1,15 @@ +;@@title: Friday@@ +;@@date: 2022-05-20@@ + +It's Friday, y'all. +I don't want to do nothin' at all today. + +I'm going to fun concert tonight with friends, which is nice. +And getting ready to move at the end of the month this weekend. + +I'm about to be in a game jam soon, which is going to be great. +And I'm writing this. I kind of want to re-do it in scheme... + +Anyway, I don't know. I'm vibing but I'd love to be vibing at home. + +What do I want to do with my life, anyway? \ No newline at end of file diff --git a/tmpl.feed.xml b/tmpl.feed.xml new file mode 100644 index 0000000..d133471 --- /dev/null +++ b/tmpl.feed.xml @@ -0,0 +1,27 @@ + + + acdw.casa + mi casa es su casa + + + acdw.casa + hat-trick + Copyright (C) 2022 CC-BY-SA Case Duckworth + $(date -u +%FT%TZ) + + $(set -x;cat .tmp/index-list | while read line; do + entry_date="$(echo "$line" | sed 's/.*
  • .*/\1/')" + entry_title="$(echo "$line" | sed 's#.*\(.*\).*#\1#')" + entry_html="$(echo "$line" | sed 's#.*.*#\1#')" + entry_url="https://acdw.casa/$entry_html" + print "" + print "$entry_url" + print "" + print "$entry_title" + print "$entry_date" + print "Case Duckworth" + print "" + print "" + done) + + diff --git a/tmpl.index.htm b/tmpl.index.htm index 427be53..9dd605b 100644 --- a/tmpl.index.htm +++ b/tmpl.index.htm @@ -9,7 +9,11 @@ $(sed 's#$(title)#acdw.casa#' _head.htm)

    pages here

    -- cgit 1.4.1-21-gabe81