From 57abab7d0c27161e909d07498c86012c82db246e Mon Sep 17 00:00:00 2001 From: Adam Stück Date: Fri, 15 Dec 2023 11:23:21 +0000 Subject: overhaul: switch from ssg to barf - simplify and polish most pages - add /colophon, /now, /contact - drop /resume-da - drop javascript - patch barf to create symlinks for /rss.xml and /feed to /atom.xml --- .build.yml | 5 +- Makefile | 13 ++ barf | 107 +++++++++++++++++ build/2023-02-log/index.html | 73 ------------ build/2023-02/index.html | 75 ++++++++++++ build/atom.xml | 53 +++++++++ build/colophon/index.html | 56 +++++++++ build/contact/index.html | 48 ++++++++ build/donate/index.html | 82 +++++++------ build/feed | 1 + build/index.html | 109 +++++++---------- build/js/showhide.js | 27 ----- build/main.css | 86 -------------- build/now/index.html | 52 ++++++++ build/pages.tsv | 8 ++ build/posts.tsv | 1 + build/projects/index.html | 63 +++++----- build/resume-da/index.html | 181 ---------------------------- build/resume/index.html | 277 +++++++++++++++++++++++-------------------- build/rss.xml | 71 +---------- build/services/index.html | 109 ++++++----------- build/sitemap.xml | 15 --- build/uses/index.html | 195 ++++++++++++------------------ footer.html | 23 ++++ header.html | 16 +++ index.md | 12 ++ pages/colophon.md | 22 ++++ pages/contact.md | 9 ++ pages/donate.md | 24 ++++ pages/now.md | 16 +++ pages/projects.md | 5 + pages/resume.md | 181 ++++++++++++++++++++++++++++ pages/services.md | 6 + pages/uses.md | 58 +++++++++ posts/2023-02.md | 47 ++++++++ src/2023-02-log/index.md | 57 --------- src/_footer.html | 13 -- src/_header.html | 22 ---- src/donate/index.md | 8 -- src/index.md | 47 -------- src/js/showhide.js | 27 ----- src/main.css | 86 -------------- src/projects/index.md | 7 -- src/resume-da/index.md | 171 -------------------------- src/resume/index.md | 171 -------------------------- src/rss.xml | 70 ----------- src/services/index.md | 20 ---- src/uses/index.md | 60 ---------- ssg | 243 ------------------------------------- 49 files changed, 1225 insertions(+), 1903 deletions(-) create mode 100644 Makefile create mode 100755 barf delete mode 100644 build/2023-02-log/index.html create mode 100644 build/2023-02/index.html create mode 100644 build/atom.xml create mode 100644 build/colophon/index.html create mode 100644 build/contact/index.html create mode 120000 build/feed delete mode 100644 build/js/showhide.js delete mode 100644 build/main.css create mode 100644 build/now/index.html create mode 100644 build/pages.tsv create mode 100644 build/posts.tsv delete mode 100644 build/resume-da/index.html mode change 100644 => 120000 build/rss.xml delete mode 100644 build/sitemap.xml create mode 100644 footer.html create mode 100644 header.html create mode 100644 index.md create mode 100644 pages/colophon.md create mode 100644 pages/contact.md create mode 100644 pages/donate.md create mode 100644 pages/now.md create mode 100644 pages/projects.md create mode 100644 pages/resume.md create mode 100644 pages/services.md create mode 100644 pages/uses.md create mode 100644 posts/2023-02.md delete mode 100644 src/2023-02-log/index.md delete mode 100644 src/_footer.html delete mode 100644 src/_header.html delete mode 100644 src/donate/index.md delete mode 100644 src/index.md delete mode 100644 src/js/showhide.js delete mode 100644 src/main.css delete mode 100644 src/projects/index.md delete mode 100644 src/resume-da/index.md delete mode 100644 src/resume/index.md delete mode 100644 src/rss.xml delete mode 100644 src/services/index.md delete mode 100644 src/uses/index.md delete mode 100755 ssg diff --git a/.build.yml b/.build.yml index 845e183..68015ee 100644 --- a/.build.yml +++ b/.build.yml @@ -2,12 +2,11 @@ image: alpine/edge oauth: pages.sr.ht/PAGES:RW packages: - hut -- lowdown environment: site: adast.dk tasks: - package: | - cd $site - tar -C build -cvz . > ../site.tar.gz + cd $site/build + tar -cvz . > ../../site.tar.gz - upload: | hut pages publish -d $site site.tar.gz diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..b16a580 --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +build: + sh ./barf + rsync -r public/ build/public + +clean: + rm -rf build/* + +watch: + while true; do \ + ls -d .git/* * posts/* pages/* header.html | entr -cd make ;\ + done + +.PHONY: build clean watch diff --git a/barf b/barf new file mode 100755 index 0000000..07ad771 --- /dev/null +++ b/barf @@ -0,0 +1,107 @@ +#!/bin/sh +set -eu +MARKDOWN=smu +IFS=' ' + +# Create tab separated file with filename, title, creation date, last update +index_tsv() { + for f in "$1"/*.md + do + title=$(sed -n '/^# /{s/# //p; q}' "$f") + printf '%s\t%s\t%s\t%s\n' "$f" "${title:="No Title"}" + done +} + +index_html() { + # Print header + title=$(sed -n '/^# /{s/# //p; q}' index.md) + sed "s/{{TITLE}}/$title/" header.html + + # Intro text + $MARKDOWN index.md + + echo "" + + # Print footer after post list + cat footer.html +} + +atom_xml() { + uri=$(sed -rn '/atom.xml/ s/.*href="([^"]*)".*/\1/ p' header.html) + domain=$(echo "$uri" | sed 's/atom.xml//g' | sed 's|/[^/]*$||') + first_commit_date=$(git log --pretty='format:%ai' . | cut -d ' ' -f1 | tail -1) + + cat < + + $(sed -n '/^# /{s/# //p; q}' index.md) + + $(date +%FT%TZ) + + $(git config user.name) + + $domain,$first_commit_date:default-atom-feed/ +EOF + + while read -r f title created; do + + content=$($MARKDOWN "$f" | sed 's/&/\&/g; s//\>/g; s/"/\"/g; s/'"'"'/\'/g') + post_link=$(echo "$f" | sed -E 's|posts/(.*).md|\1|') + basic_date=$(echo $(head -3 "$f" | tail -1)) + published_date=$(date -d $basic_date -u +%Y-%m-%dT10:%M:%SZ) + + cat < + $title + $content + + $domain/$post_link + $published_date + $published_date + +EOF + done < "$1" + + echo '' +} + +write_page() { + filename=$1 + directory=$(echo $(basename "$filename" .md)) + $(mkdir -p build/$directory) + target=$(echo "$filename" | sed -r 's|\w+/(.*).md|build/\1/index.html|') + created=$(echo $(head -3 "$filename" | tail -1)) + title=$2 + + $MARKDOWN "$filename" | \ + cat header.html - |\ + sed "s|{{TITLE}}|$title|" \ + > "$target" && cat footer.html >> "$target" +} + +rm -rf build && mkdir build + +# Blog posts +index_tsv posts | sort -rt " " -k 3 > build/posts.tsv +index_html build/posts.tsv > build/index.html +atom_xml build/posts.tsv > build/atom.xml +ln -sf atom.xml build/rss.xml +ln -sf atom.xml build/feed +while read -r f title created; do + write_page "$f" "$title" "$created" +done < build/posts.tsv + +# Pages +index_tsv pages > build/pages.tsv +while read -r f title created; do + write_page "$f" "$title" "$created" +done < build/pages.tsv diff --git a/build/2023-02-log/index.html b/build/2023-02-log/index.html deleted file mode 100644 index 983a27a..0000000 --- a/build/2023-02-log/index.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - Status update, February 2023 - - - - - -
- -
-

Status update, February 2023

-

2023-03-04

-

Hello world!

-

Hi, welcome to my website.

-

This is probably your first time seeing it, but it just went through a -major makeover. I’ve archived the old -design if -you want to check it out.

-

The new design is blazingly fast, light as a feather, and anyone can navigate -it.

-

You’ll find my contact details and important links on the homepage. -There are links to more information about myself and this website, projects I’m -working on, and my RSS feed at the top. -I’ve included my PGP key if you wish to send me mail privately.

-

This redesign was heavily inspired by bt.ht and -drewdevault.com.

-

Game dev is back on the menu!

-

The CompSci department at my uni hosts an annual LAN party with tournaments -in the usual titles (csgo, lol, trackmania, etc). It would be amazing to get arena to a playable, -fun state, and have a LAN tournament to really put it to the test.

-

I want to start working on my game again, and I want to it to be playable in -time for the LAN party.

-

I have about 5 weeks to make it happen.

-

What to expect

-

I have a few technical blog posts planned, but I’ll also just be posting -about anything I that interests me.

-

I think I’ll start doing monthly status updates (like this post), much like -the engineers at -sourcehut.org. -I’d also like to start posting (weekly) development logs for arena.

-

Finally, I have a lot more services I need to start hosting before I really -call this my platform. You can see the list of publicly available -services by clicking the link at the top of the page. For now, I’m -prioritising hosting the services that I use regularly.

-

That’s all for now!

-

Book club

-

inspired by 100rabbits

-

I’m reading A Voyage for Madmen by Peter Nichols.

- -
- - diff --git a/build/2023-02/index.html b/build/2023-02/index.html new file mode 100644 index 0000000..38bdbf9 --- /dev/null +++ b/build/2023-02/index.html @@ -0,0 +1,75 @@ + + + + + + + Status update, February 2023 + + + + + + +
+

Status update, February 2023

+

2023-03-04

+

Hi, welcome to my website. +This is probably your first time seeing it, but it just went through a +major makeover. I've archived the old +design if +you want to check it out. +The new design is blazingly fast, light as a feather, and anyone can navigate +it. +This redesign was heavily inspired by bt.ht and +drewdevault.com.

+

You'll find my contact details and important links on the homepage. +There are links to more information about myself and this website, projects I'm +working on, and my RSS feed at the top. +I've included my PGP key if you wish to send me mail privately.

+

Game dev is back on the menu!

+

The CompSci department at my uni hosts an annual LAN party with tournaments +in the usual titles (csgo, lol, trackmania, etc). It would be amazing to get arena to a playable, +fun state, and have a LAN tournament to really put it to the test. +I want to start working on my game again, and I want to it to be playable in +time for the LAN party. +I have about 5 weeks to make it happen.

+

What to expect

+

I have a few technical blog posts planned, but I'll also just be posting +about anything I that interests me. +I think I'll start doing monthly status updates (like this post), much like +the engineers at +sourcehut.org. +I'd also like to start posting (weekly) development logs for arena.

+

Finally, I have a lot more services I need to start hosting before I really +call this my platform. You can see the list of publicly available +services by clicking the link at the top of the page. For now, I'm +prioritising hosting the services that I use regularly.

+

That's all for now!

+

Book club

+

I'm reading A Voyage for Madmen by Peter Nichols.

+ diff --git a/build/atom.xml b/build/atom.xml new file mode 100644 index 0000000..3ae5863 --- /dev/null +++ b/build/atom.xml @@ -0,0 +1,53 @@ + + + Adam Stück's blog + + 2023-12-15T11:58:18Z + + Adam Stück + + https://adast.dk,2022-04-23:default-atom-feed/ + + Status update, February 2023 + <h1>Status update, February 2023</h1> +<p>2023-03-04</p> +<p>Hi, welcome to my website. +This is probably your first time seeing it, but it just went through a +major makeover. I've archived <a href="https://web.archive.org/web/20221223055937/https://adast.xyz/">the old +design</a> if +you want to check it out. +The new design is <em>blazingly fast</em>, light as a feather, and anyone can navigate +it. +This redesign was <strong>heavily</strong> inspired by <a href="https://bt.ht">bt.ht</a> and +<a href="https://drewdevault.com">drewdevault.com</a>.</p> +<p>You'll find my contact details and important links on the homepage. +There are links to more information about myself and this website, projects I'm +working on, and my RSS feed at the top. +I've included my PGP key if you wish to send me mail privately.</p> +<h2>Game dev is back on the menu!</h2> +<p>The CompSci department at my uni hosts an annual LAN party with tournaments +in the usual titles (csgo, lol, trackmania, etc). It would be amazing to get <a href="https://arena.adast.dk">arena</a> to a playable, +fun state, and have a LAN tournament to really put it to the test. +I want to start working on my game again, and I want to it to be playable in +time for the LAN party. +I have about 5 weeks to make it happen.</p> +<h2>What to expect</h2> +<p>I have a few technical blog posts planned, but I'll also just be posting +about anything I that interests me. +I think I'll start doing monthly status updates (like this post), much like +the <a href="https://sourcehut.org/consultancy/#our-engineers">engineers at +sourcehut.org</a>. +I'd also like to start posting (weekly) development logs for arena. </p> +<p>Finally, I have a lot more services I need to start hosting before I really +call this <em>my platform</em>. You can see the list of publicly available +services by clicking the link at the top of the page. For now, I'm +prioritising hosting the services that I use regularly.</p> +<p>That's all for now! </p> +<h2>Book club</h2> +<p>I'm reading <strong>A Voyage for Madmen</strong> by Peter Nichols.</p> + + https://adast.dk/2023-02 + 2023-03-04T10:00:00Z + 2023-03-04T10:00:00Z + + diff --git a/build/colophon/index.html b/build/colophon/index.html new file mode 100644 index 0000000..9e89bd7 --- /dev/null +++ b/build/colophon/index.html @@ -0,0 +1,56 @@ + + + + + + + Colophon + + + + + + +
+

Colophon

+

This website is a collection of living, breathing documents. As I mention on +the homepage, this place is better referred to as an online brain +dump. It might change over time. Styles might come and go. +I can't help that, since tinkering with my personal blog is something I am very +fond of. It's almost therapeutic.

+

For those interested I try to keep the details of the blog up-to-date with the +information below:

+

Website Fast Facts

+ + + + + + + + +
Parameter Source
Built with:barf
Hosted on:SourceHut Pages
Source code available:SourceHut
Licensed under:MIT
Developed on:One of my machines
Operating system:Arch Linux
diff --git a/build/contact/index.html b/build/contact/index.html new file mode 100644 index 0000000..e2ab681 --- /dev/null +++ b/build/contact/index.html @@ -0,0 +1,48 @@ + + + + + + + Contact + + + + + + +
+

Contact

+ +

Have a comment on one of my posts? Start a discussion in my public +inbox by sending an email to +~adamski/public-inbox@lists.sr.ht +[mailing list etiquette]

+ diff --git a/build/donate/index.html b/build/donate/index.html index 483013f..76c52d9 100644 --- a/build/donate/index.html +++ b/build/donate/index.html @@ -1,40 +1,56 @@ - - - - - - Donate - - - - - -
- -
-

Donate

-

Help keep the server running.

-

Hetzner Referral

-

Use my referral link, and get 20 EUR -of Hetzner Cloud credits for free.

-