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); 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]*/, "
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 @@
+
+