about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--Makefile8
-rw-r--r--asset/casa.css (renamed from src/static/casa.css)4
-rwxr-xr-xht.awk24
-rwxr-xr-xht.sh7
-rw-r--r--src/.dir-locals.el4
-rw-r--r--src/_head.htm2
-rw-r--r--src/_index.htm3
-rw-r--r--src/paper-airplane-day-and-two-fire-alarms.ht49
-rw-r--r--src/static/rss.xml27
-rw-r--r--src/twtxt.ht22
10 files changed, 114 insertions, 36 deletions
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/
6SITE_TITLE = acdw.casa 6SITE_TITLE = acdw.casa
7 7
8INPUT = src 8INPUT = src
9ASSET = asset
9BUILD = build 10BUILD = build
10 11
11HTAWK = ./ht.awk 12HTAWK = ./ht.awk
@@ -39,7 +40,7 @@ ITMPC = \
39 done) \ 40 done) \
40 </ul> 41 </ul>
41ITMPR = \ 42ITMPR = \
42 index.html: ${ITMPL} $$(cat ${TPG}); \ 43 index.html: ${ITMPL} _index.htm ${INCLUDES} $$(cat ${TPG}); \
43 env HTTMP='$T' HTOUT='\$$@' \ 44 env HTTMP='$T' HTOUT='\$$@' \
44 ${HTSH} "${ITMPL}" < /dev/null > '\$$@' 45 ${HTSH} "${ITMPL}" < /dev/null > '\$$@'
45 46
@@ -50,7 +51,7 @@ RTMPR = \
50 ${HTSH} "${RTMPL}" < /dev/null > '\$$@' 51 ${HTSH} "${RTMPL}" < /dev/null > '\$$@'
51 52
52TMPL = ${PTMPL} ${ITMPL} ${RTMPL} 53TMPL = ${PTMPL} ${ITMPL} ${RTMPL}
53BUILD_INPUTS = ${INPUT}/* ${TMPL} ${HT} 54BUILD_INPUTS = ${INPUT}/* ${ASSET}/* ${TMPL} ${HT}
54 55
55RSYNCEXCLUDE = \ 56RSYNCEXCLUDE = \
56 "*.ht" \ 57 "*.ht" \
@@ -60,7 +61,8 @@ RSYNCEXCLUDE = \
60 "*.awk" \ 61 "*.awk" \
61 "*.bod.txt" \ 62 "*.bod.txt" \
62 "tmpl.*" \ 63 "tmpl.*" \
63 "tmp/" 64 "tmp/" \
65 "tw.txt"
64RSYNCEXCLUDEFILE = ${BUILD}/.rsync-exclude 66RSYNCEXCLUDEFILE = ${BUILD}/.rsync-exclude
65RSYNC = rsync -auvz --exclude-from="${RSYNCEXCLUDEFILE}" --delete 67RSYNC = rsync -auvz --exclude-from="${RSYNCEXCLUDEFILE}" --delete
66 68
diff --git a/src/static/casa.css b/asset/casa.css index 36bdda0..47f496f 100644 --- a/src/static/casa.css +++ b/asset/casa.css
@@ -30,3 +30,7 @@ footer {
30 text-align: right; 30 text-align: right;
31 padding: 1ch 0; 31 padding: 1ch 0;
32} 32}
33
34code {
35 color: #c0ffee;
36}
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) {
11function buflush() { 11function buflush() {
12 if (BUF) print BUF; 12 if (BUF) print BUF;
13 BUF = ""; 13 BUF = "";
14 if (tag && (tag != "html")) print "</" tag ">"; 14 if (tag && (tag != "html") && (tag != "raw"))
15 print "</" tag ">";
15} 16}
16 17
17function esc(t) { 18function esc(t) {
@@ -19,6 +20,7 @@ function esc(t) {
19 gsub(/&/, "\\&amp;", t); 20 gsub(/&/, "\\&amp;", t);
20 gsub(/</, "\\&lt;", t); 21 gsub(/</, "\\&lt;", t);
21 gsub(/>/, "\\&gt;", t); 22 gsub(/>/, "\\&gt;", t);
23 sub(/^ /, "\\&nbsp;", t);
22 return t; 24 return t;
23} 25}
24 26
@@ -30,7 +32,21 @@ function esc(t) {
30 next; 32 next;
31} 33}
32 34
35/^```$/ { # Raw block
36 if (! (tag == "raw")) {
37 tag = "raw";
38 getline;
39 bufpush("<pre><code>" $0);
40 } else {
41 bufpush("</code></pre>");
42 buflush();
43 tag = "";
44 }
45 next;
46}
47
33/^=>/ { # Links (Gemini-style) 48/^=>/ { # Links (Gemini-style)
49 if (tag == "raw") next;
34 link = "<a href=\"" esc($2) "\">" $3; 50 link = "<a href=\"" esc($2) "\">" $3;
35 for (i=4;i<=NF;i++) link = link " " $i; 51 for (i=4;i<=NF;i++) link = link " " $i;
36 link = link "</a>"; 52 link = link "</a>";
@@ -39,21 +55,25 @@ function esc(t) {
39} 55}
40 56
41/^-/ { # Unordered lists 57/^-/ { # Unordered lists
58 if (tag == "raw") next;
42 if (! (tag == "ul")) tag = "ul"; 59 if (! (tag == "ul")) tag = "ul";
43 sub(/^-[ \t]*/, "<li>"); 60 sub(/^-[ \t]*/, "<li>");
44} 61}
45 62
46/^[0-9]+\./ { # Ordered lists 63/^[0-9]+\./ { # Ordered lists
64 if (tag == "raw") next;
47 if (! (tag == "ol")) tag = "ol"; 65 if (! (tag == "ol")) tag = "ol";
48 sub(/^[0-9]+\.[ \t]/, "<li>"); 66 sub(/^[0-9]+\.[ \t]/, "<li>");
49} 67}
50 68
51/^>/ { # Blockquotes 69/^>/ { # Blockquotes
70 if (tag == "raw") next;
52 if (! (tag == "blockquote")) tag = "blockquote"; 71 if (! (tag == "blockquote")) tag = "blockquote";
53 sub(/^>[ \t]*/,""); 72 sub(/^>[ \t]*/,"");
54} 73}
55 74
56/^#+/ { # Headers 75/^#+/ { # Headers
76 if (tag == "raw") next;
57 match($0, /^#+/); 77 match($0, /^#+/);
58 if (! (tag == "h" RLENGTH)) { 78 if (! (tag == "h" RLENGTH)) {
59 buflush(); 79 buflush();
@@ -63,6 +83,7 @@ function esc(t) {
63} 83}
64 84
65/^$/ { 85/^$/ {
86 if (tag == "raw") next;
66 buflush(); 87 buflush();
67 tag = ""; 88 tag = "";
68} 89}
@@ -70,6 +91,7 @@ function esc(t) {
70/./ { 91/./ {
71 if (! tag) tag = "p"; 92 if (! tag) tag = "p";
72 if (! BUF) bufpush("<" tag ">"); 93 if (! BUF) bufpush("<" tag ">");
94 if (tag == "raw") $0 = esc($0);
73 bufpush($0); 95 bufpush($0);
74} 96}
75 97
diff --git a/ht.sh b/ht.sh index 9c3302f..e874e3c 100755 --- a/ht.sh +++ b/ht.sh
@@ -27,7 +27,7 @@ htt() { # htt FILES...
27 27
28ht_build_env() { # ht_build_env FILE... 28ht_build_env() { # ht_build_env FILE...
29 print "body() { cat \"$HTBOD\"; }" > "$HTENV" 29 print "body() { cat \"$HTBOD\"; }" > "$HTENV"
30 : > "$HTBOD"; # clear out body 30 : > "$HTBOD"; # clear
31 while read -r line; do 31 while read -r line; do
32 case "$line" in 32 case "$line" in
33 *@@*:*@@*) # "simple" metadata; just a string 33 *@@*:*@@*) # "simple" metadata; just a string
@@ -38,7 +38,8 @@ ht_build_env() { # ht_build_env FILE...
38 print "$line" | 38 print "$line" |
39 sed 's/.*@@\([^:]*\):: \?\(.*\)@@.*/\1() { \2 ; }/' 39 sed 's/.*@@\([^:]*\):: \?\(.*\)@@.*/\1() { \2 ; }/'
40 ;; 40 ;;
41 esac >> "$HTENV" 41 esac |
42 sed '/%s() {.*}/d' >> "$HTENV"
42 # Still print the line to the body (no need to escape or w/e) 43 # Still print the line to the body (no need to escape or w/e)
43 print "$line" >> "$HTBOD" 44 print "$line" >> "$HTBOD"
44 done 45 done
@@ -53,7 +54,7 @@ ht_main() { # main TEMPLATE < INPUT
53 exit 1 54 exit 1
54 fi 55 fi
55 56
56 eval "ht_build_env; . \"$HTENV\"; print \"\$(htt \"\$@\")\";"; 57 eval "ht_build_env; . \"$HTENV\"; htt \"\$@\";";
57} 58}
58 59
59# To keep this POSIX-compliant, we can't use a bashism like 60# To keep this POSIX-compliant, we can't use a bashism like
diff --git a/src/.dir-locals.el b/src/.dir-locals.el new file mode 100644 index 0000000..8e332c0 --- /dev/null +++ b/src/.dir-locals.el
@@ -0,0 +1,4 @@
1;;; Directory Local Variables
2;;; For more information see (info "(emacs) Directory Variables")
3
4((fundamental-mode . ((compile-command . "make build"))))
diff --git a/src/_head.htm b/src/_head.htm index e8ec1cc..0eef7ac 100644 --- a/src/_head.htm +++ b/src/_head.htm
@@ -8,7 +8,7 @@
8 <title>$(title)</title> 8 <title>$(title)</title>
9 <link rel="shortcut icon" 9 <link rel="shortcut icon"
10 href="data:image/gif;base64,R0lGODdhEAAQAIAAAAByL8zAGiwAAAAAEAAQAAACK4wNqQsX+1hD6kiaXKxQb+ZZYChmpGNinfpxV/q02dzUrx1L+Lzlp60LFgAAOw==" /> 10 href="data:image/gif;base64,R0lGODdhEAAQAIAAAAByL8zAGiwAAAAAEAAQAAACK4wNqQsX+1hD6kiaXKxQb+ZZYChmpGNinfpxV/q02dzUrx1L+Lzlp60LFgAAOw==" />
11 <link rel="stylesheet" type="text/css" href="static/casa.css"> 11 <link rel="stylesheet" type="text/css" href="casa.css">
12 <link rel="alternate" type="application/atom+xml" href="feed.xml"> 12 <link rel="alternate" type="application/atom+xml" href="feed.xml">
13 </head> 13 </head>
14 <body> 14 <body>
diff --git a/src/_index.htm b/src/_index.htm index 6b7b809..918edf5 100644 --- a/src/_index.htm +++ b/src/_index.htm
@@ -1,7 +1,8 @@
1<p>Ahoy! This here is my little home-away-from-home on the interwebs. 1<p>Ahoy! This here is my little home-away-from-home on the interwebs.
2 I'm currently experimenting with a custom little <abbr title="static site generator">SSG</abbr> 2 I'm currently experimenting with a custom little <abbr title="static site generator">SSG</abbr>
3 I'm calling <strong>HAT TRICK</strong>. 3 I'm calling <strong>HAT TRICK</strong>.
4 I should probably throw the source up somewhere, but I haven't yet. 4 <del>I should probably throw the source up somewhere, but I haven't yet.</del>
5 <a href="https://git.acdw.net/hat-trick/">Download the source here!</a>
5</p> 6</p>
6 7
7 8
diff --git a/src/paper-airplane-day-and-two-fire-alarms.ht b/src/paper-airplane-day-and-two-fire-alarms.ht new file mode 100644 index 0000000..58720ed --- /dev/null +++ b/src/paper-airplane-day-and-two-fire-alarms.ht
@@ -0,0 +1,49 @@
1;@@title: Paper airplane day and two fire alarms@@
2;@@date: 2022-05-26@@
3
4Apparently, today is National Paper Airplane Day, so we had a little paper
5airplane contest at work. It was quite fun, though my go-to airplane style
6didn't win over the YouTube-d and other "professionally"-done airplanes.
7
8We also had a potluck with my department and another, and in preparation the
9ovens set off two fire alarms. The first was totally charred french bread and
10the second was some drippings that were left on foil in the oven for who knows
11how long. Quite annoying, but the potluck turned out quite well!
12
13I've also sold my desk as we prepare for our move, and I'm looking at others.
14Thinking an Ikea number, maybe.
15
16I'm back on <code>nyan-mode</code> in my mode-line. Oh, I need to remember the
17<code>actually-selected-window</code> package, which I wrote I belive
18<em>for</em> <code>nyan-mode</code>! I'll do that when I'm done here.
19
20I also wrote a little function to make it easier to post on this blog. Here it
21is:
22
23```
24(defun blog-post (title &optional date)
25 "Make a new blog post, with TITLE on DATE."
26 (interactive (list (read-string "Title: ")
27 (format-time-string "%F")))
28 (let ((blog-directory (expand-file-name "~/src/hat-trick/src/"))
29 (metadata-format ";@@%s: %s@@\n")
30 (slug (string-trim (downcase (replace-regexp-in-string "[^[:alnum:]]"
31 "-" title))
32 "-" "-")))
33 (find-file (expand-file-name (concat slug ".ht") blog-directory))
34 (insert (format metadata-format "title" title))
35 (when date
36 (insert (format metadata-format "date" date)))
37 (insert "\n")))
38```
39
40I think the next thing I should do is make a major-mode ... or maybe I should
41just use <code>web-mode</code>....
42
43And of course, I need to update the syntax of these .ht files. They're
44<em>okay</em>, but I think I could improve them in a few ways. Not that I've
45figured out what those ways are, lol.
46
47<hr>
48
49Wow, this was a long one! That's good, I spose :)
diff --git a/src/static/rss.xml b/src/static/rss.xml deleted file mode 100644 index 44617d8..0000000 --- a/src/static/rss.xml +++ /dev/null
@@ -1,27 +0,0 @@
1<?xml version="1.0" encoding="UTF-8" ?>
2<rss version="2.0">
3<channel>
4 <title>Acdw's Casa</title>
5 <description>My casa, in the middle of the web</description>
6 <link>https://acdw.casa</link>
7 <copyright>2022 Case Duckworth</copyright>
8 <lastBuildDate>2022-03-03</lastBuildDate>
9 <pubDate>2022-03-03</pubDate>
10 <ttl>1800</ttl>
11
12 <item>
13 <title>And we're live</title>
14 <description>Hi basement</description>
15 <link>https://acdw.casa/</link>
16 <pubDate>2022-03-03</pubDate>
17 </item>
18
19 <item>
20 <title>Good Choices License</title>
21 <description>A license for people</description>
22 <link>https://acdw.casa/gcl/</link>
23 <pubDate>2022-05-13</pubDate>
24 </item>
25
26</channel>
27</rss>
diff --git a/src/twtxt.ht b/src/twtxt.ht new file mode 100644 index 0000000..7ae86c9 --- /dev/null +++ b/src/twtxt.ht
@@ -0,0 +1,22 @@
1;@@title: TwTxt ? What's next!?@@
2;@@date: 2022-05-25@@
3
4Whoa, two posts in one day. Better be careful, lol.
5
6Anyway, this is to say I've also got a
7=> tw.txt twtxt
8set up as well, and even forked
9=> https://github.com/duckwork/twtxt-el twtxt.el
10to work for my needs!
11
12Luckily, rsync's <code>--delete</code> flag
13doesn't do anything with excluded files by default, so I can
14just throw it in the site root and have a grand ol' time.
15
16Still to do:
17
18- Finalize hat-trick markup
19- Figure out a way to cross-post to gemini and gopher too, why not
20- Write more content? I suppose?
21- ...
22- Profit!!!