2023-08-06
This commit is contained in:
parent
7f44cb37eb
commit
4a2c068ec0
@ -1926,6 +1926,75 @@ If I don't, escalate the issue to the host of this site (this can also be found
|
|||||||
</HTML>
|
</HTML>
|
||||||
|
|
||||||
|
|
||||||
|
/blah/2023-08-06.html
|
||||||
|
|
||||||
|
The blah/ works now as well as it did early July, but is based on homepage, my
|
||||||
|
fucky single file static site generator. This was something I needed to take
|
||||||
|
care of before I left or I wouldn't get around to it; if I'm using some shitty
|
||||||
|
interface to edit the git repository instead of good old UNIX (which may happen
|
||||||
|
if my tech breaks down) I don't wanna figure out how to manage directories and
|
||||||
|
new files and stuff. I just want to edit the same old file and hope the web
|
||||||
|
interface doesn't fuck everything up. Granted, I don't know if Sourcehut has a
|
||||||
|
web interface. So that could be like 50 hours of work down the drain. But I'm
|
||||||
|
happy with homepage and it's another quirky little project of mine.
|
||||||
|
|
||||||
|
|
||||||
|
/homepage.local verbatim
|
||||||
|
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
for f in ./blah/*.html
|
||||||
|
do
|
||||||
|
awk '
|
||||||
|
BEGIN { n = 0; }
|
||||||
|
/^\$!NAVIGATION$/ {
|
||||||
|
if(++n == 1){
|
||||||
|
print $0 "\n\n" substr(FILENAME, 8, 10) "\n"
|
||||||
|
}else
|
||||||
|
print "\n" $0;
|
||||||
|
}
|
||||||
|
!/^\$!NAVIGATION$/ { print $0 }
|
||||||
|
' "$f" >"$f.tmp" \
|
||||||
|
&& mv "$f.tmp" "$f" \
|
||||||
|
|| rm "$f.tmp"
|
||||||
|
f="$(printf '%s\n' "$f" | sed -e 's,./blah/,,' -e 's,\.html$,,')"
|
||||||
|
test -n "$last" \
|
||||||
|
&& sed -i "./blah/$last.html" \
|
||||||
|
-e "s,\$!NAVIGATION,$nav<A HREF=\"$f.html\">\></A>,g" \
|
||||||
|
&& nav="<A HREF=\"$last.html\">\<</A>" \
|
||||||
|
|| true
|
||||||
|
nav="$nav<A HREF=\"index.html\">^</A>"
|
||||||
|
last="$f"
|
||||||
|
done
|
||||||
|
sed -i "s,\$!NAVIGATION,$nav,g" "./blah/$last.html"
|
||||||
|
|
||||||
|
ls ./blah/*.html \
|
||||||
|
| sed -e 's_.*/__g' \
|
||||||
|
-e 's/\.html$//g' \
|
||||||
|
| sort -r \
|
||||||
|
| tee ./feed.xml \
|
||||||
|
| sed -e 's_.*_<A HREF="/blah/&.html">&</A>_g' \
|
||||||
|
-e "1i\
|
||||||
|
<!DOCTYPE html><HEAD><TITLE>blah</TITLE></HEAD>\
|
||||||
|
<BODY><PRE><A HREF=\"..\">..</A>" \
|
||||||
|
-e '$a</PRE></BODY></HTML>' \
|
||||||
|
>./blah/index.html
|
||||||
|
|
||||||
|
sed -i feed.xml \
|
||||||
|
-e "1i\
|
||||||
|
<?xml version=\"1.0\" encoding=\"utf-8\"?><rss version=\"2.0\">\
|
||||||
|
<channel><title>trinity.moe/blah</title><link>https://trinity.moe/blah</link>\
|
||||||
|
<lastBuildDate>$(date)</lastBuildDate>" \
|
||||||
|
-e "s,^....-..-..\$,<item>\
|
||||||
|
<title>&</title>\
|
||||||
|
<link>https://trinity.moe/blah/&.html</link>\
|
||||||
|
<description>blah post for &</description>\
|
||||||
|
<pubdate>&</pubdate></item>," \
|
||||||
|
-e '$a</channel></rss>'
|
||||||
|
|
||||||
|
|
||||||
/blah/2023-08-05.html
|
/blah/2023-08-05.html
|
||||||
|
|
||||||
On August 19 I'm taking a Greyhound away from Lewiston, Maine and I'm probably
|
On August 19 I'm taking a Greyhound away from Lewiston, Maine and I'm probably
|
||||||
|
Loading…
Reference in New Issue
Block a user