From e7254223846dbec352628aa9d156e0fe323a4e93 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Fri, 27 May 2022 13:27:21 -0500 Subject: New post, asset moving, dir-locals, etc. --- Makefile | 8 +++-- asset/casa.css | 36 ++++++++++++++++++++ ht.awk | 24 ++++++++++++- ht.sh | 7 ++-- src/.dir-locals.el | 4 +++ src/_head.htm | 2 +- src/_index.htm | 3 +- src/paper-airplane-day-and-two-fire-alarms.ht | 49 +++++++++++++++++++++++++++ src/static/casa.css | 32 ----------------- src/static/rss.xml | 27 --------------- src/twtxt.ht | 22 ++++++++++++ 11 files changed, 146 insertions(+), 68 deletions(-) create mode 100644 asset/casa.css create mode 100644 src/.dir-locals.el create mode 100644 src/paper-airplane-day-and-two-fire-alarms.ht delete mode 100644 src/static/casa.css delete mode 100644 src/static/rss.xml create mode 100644 src/twtxt.ht diff --git a/Makefile b/Makefile index 537fabe..328e634 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ UPLOAD_TARGET = hetzner:/var/www/acdw.casa/ SITE_TITLE = acdw.casa INPUT = src +ASSET = asset BUILD = build HTAWK = ./ht.awk @@ -39,7 +40,7 @@ ITMPC = \ done) \ ITMPR = \ - index.html: ${ITMPL} $$(cat ${TPG}); \ + index.html: ${ITMPL} _index.htm ${INCLUDES} $$(cat ${TPG}); \ env HTTMP='$T' HTOUT='\$$@' \ ${HTSH} "${ITMPL}" < /dev/null > '\$$@' @@ -50,7 +51,7 @@ RTMPR = \ ${HTSH} "${RTMPL}" < /dev/null > '\$$@' TMPL = ${PTMPL} ${ITMPL} ${RTMPL} -BUILD_INPUTS = ${INPUT}/* ${TMPL} ${HT} +BUILD_INPUTS = ${INPUT}/* ${ASSET}/* ${TMPL} ${HT} RSYNCEXCLUDE = \ "*.ht" \ @@ -60,7 +61,8 @@ RSYNCEXCLUDE = \ "*.awk" \ "*.bod.txt" \ "tmpl.*" \ - "tmp/" + "tmp/" \ + "tw.txt" RSYNCEXCLUDEFILE = ${BUILD}/.rsync-exclude RSYNC = rsync -auvz --exclude-from="${RSYNCEXCLUDEFILE}" --delete diff --git a/asset/casa.css b/asset/casa.css new file mode 100644 index 0000000..47f496f --- /dev/null +++ b/asset/casa.css @@ -0,0 +1,36 @@ +html { + min-height: 100vh; + margin:0; padding: 0; +} + +html { + font: 18px serif; +} + +body { + max-width: 79ch; + margin: 0 auto; + padding: 0 2ch; + background: #385180; + color: white; +} + +main { + max-width: 79ch; + padding: 2ch; + margin: auto; + background: #405990; +} + +a { + color: yellow; +} + +footer { + text-align: right; + padding: 1ch 0; +} + +code { + color: #c0ffee; +} diff --git a/ht.awk b/ht.awk index faa729d..a382ae7 100755 --- a/ht.awk +++ b/ht.awk @@ -11,7 +11,8 @@ function bufpush(s) { function buflush() { if (BUF) print BUF; BUF = ""; - if (tag && (tag != "html")) print "" tag ">"; + if (tag && (tag != "html") && (tag != "raw")) + print "" tag ">"; } function esc(t) { @@ -19,6 +20,7 @@ function esc(t) { gsub(/&/, "\\&", t); gsub(/, "\\<", t); gsub(/>/, "\\>", t); + sub(/^ /, "\\ ", t); return t; } @@ -30,7 +32,21 @@ function esc(t) { next; } +/^```$/ { # Raw block + if (! (tag == "raw")) { + tag = "raw"; + getline; + bufpush("
" $0);
+ } else {
+ bufpush("
");
+ buflush();
+ tag = "";
+ }
+ next;
+}
+
/^=>/ { # Links (Gemini-style)
+ if (tag == "raw") next;
link = "" $3;
for (i=4;i<=NF;i++) link = link " " $i;
link = link "";
@@ -39,21 +55,25 @@ function esc(t) {
}
/^-/ { # Unordered lists
+ if (tag == "raw") next;
if (! (tag == "ul")) tag = "ul";
sub(/^-[ \t]*/, "Ahoy! This here is my little home-away-from-home on the interwebs.
I'm currently experimenting with a custom little SSG
I'm calling HAT TRICK.
- I should probably throw the source up somewhere, but I haven't yet.
+ I should probably throw the source up somewhere, but I haven't yet.
+ Download the source here!
nyan-mode
in my mode-line. Oh, I need to remember the
+actually-selected-window
package, which I wrote I belive
+for nyan-mode
! I'll do that when I'm done here.
+
+I also wrote a little function to make it easier to post on this blog. Here it
+is:
+
+```
+(defun blog-post (title &optional date)
+ "Make a new blog post, with TITLE on DATE."
+ (interactive (list (read-string "Title: ")
+ (format-time-string "%F")))
+ (let ((blog-directory (expand-file-name "~/src/hat-trick/src/"))
+ (metadata-format ";@@%s: %s@@\n")
+ (slug (string-trim (downcase (replace-regexp-in-string "[^[:alnum:]]"
+ "-" title))
+ "-" "-")))
+ (find-file (expand-file-name (concat slug ".ht") blog-directory))
+ (insert (format metadata-format "title" title))
+ (when date
+ (insert (format metadata-format "date" date)))
+ (insert "\n")))
+```
+
+I think the next thing I should do is make a major-mode ... or maybe I should
+just use web-mode
....
+
+And of course, I need to update the syntax of these .ht files. They're
+okay, but I think I could improve them in a few ways. Not that I've
+figured out what those ways are, lol.
+
+--delete
flag
+doesn't do anything with excluded files by default, so I can
+just throw it in the site root and have a grand ol' time.
+
+Still to do:
+
+- Finalize hat-trick markup
+- Figure out a way to cross-post to gemini and gopher too, why not
+- Write more content? I suppose?
+- ...
+- Profit!!!
--
cgit 1.4.1-21-gabe81