site

A custom static site generator written in C.
git clone https://unitehenry.com/git/site.git
Log | Files | Refs | README

commit 1dc3f67937e053a57027153769121906b86a8a04
parent d64cab4d638e26df0d8bd29cfc73764c4c101284
Author: Henry Unite <unitehenry@gmail.com>
Date:   Sat, 28 Nov 2026 20:30:35 +0000

refactor(rss): iterate blog entries by id with htmlq

Diffstat:
Mcontent/index.md | 22+++++++++++-----------
Mscripts/rss | 52+++++++++++++++++-----------------------------------
2 files changed, 28 insertions(+), 46 deletions(-)

diff --git a/content/index.md b/content/index.md @@ -84,67 +84,67 @@ produce more than you consume ## blog <details> - <summary>Practical Advice For Finding A Job • [read](/blog/practical-advice-for-finding-a-job)</summary> + <summary id="practical-advice-for-finding-a-job">Practical Advice For Finding A Job • [read](/blog/practical-advice-for-finding-a-job)</summary> <p>July 11th, 2026</p> <p>A guide that covers identifying important problems and companies worth working for, smart sourcing and outreach strategies, demonstrating your value through public work, playing the long game with persistence, LeetCode tips, and staying authentic throughout the process.</p> </details> <details> - <summary>OSSU • [read](/blog/ossu)</summary> + <summary id="ossu">OSSU • [read](/blog/ossu)</summary> <p>May 1st, 2026</p> <p>After five years of self-paced study alongside full-time software engineering work, I’ve finished the core of the Open Source Society University (OSSU) Computer Science curriculum.</p> </details> <details> - <summary>Hyprland on dGPU Laptop • [read](/blog/hyprland-for-dgpu-laptop)</summary> + <summary id="hyprland-for-dgpu-laptop">Hyprland on dGPU Laptop • [read](/blog/hyprland-for-dgpu-laptop)</summary> <p>November 14th, 2025</p> <p>This guide details a clever Arch Linux + Hyprland setup on a dual-boot NVIDIA dGPU laptop, allowing the user to boot directly into Hyprland on an external monitor while keeping the laptop lid closed — no keyboard interaction required.</p> </details> <details> - <summary>Domain-Driven Test Pipelines • [read](/blog/domain-driven-test-pipelines)</summary> + <summary id="domain-driven-test-pipelines">Domain-Driven Test Pipelines • [read](/blog/domain-driven-test-pipelines)</summary> <p>September 13th, 2025</p> <p>An effective strategy for optimizing CI pipelines in large, domain-driven projects by leveraging GitHub Actions matrix workflows to run tests per domain (e.g., user, order, shipping) in parallel.</p> </details> <details> - <summary>AI (2025) • [read](/blog/ai-2025)</summary> + <summary id="ai-2025">AI (2025) • [read](/blog/ai-2025)</summary> <p>April 19th, 2025</p> <p>My thoughts on AI in the year 2025.</p> </details> <details> - <summary>Working Hard • [read](/blog/working-hard)</summary> + <summary id="working-hard">Working Hard • [read](/blog/working-hard)</summary> <p>June 23rd, 2024</p> <p>Some concepts around my work ethic that I've learned over the years.</p> </details> <details> - <summary>Money (25) • [read](/blog/money-25)</summary> + <summary id="money-25">Money (25) • [read](/blog/money-25)</summary> <p>June 7th, 2024</p> <p>How I think about money at 25 years old.</p> </details> <details> - <summary>What's in My RC 2022 • [read](/blog/whats-in-my-rc-2022)</summary> + <summary id="whats-in-my-rc-2022">What's in My RC 2022 • [read](/blog/whats-in-my-rc-2022)</summary> <p>December 19th, 2022</p> <p>A tour of my RC file in 2022.</p> </details> <details> - <summary>What's in My RC 2021 • [read](/blog/whats-in-my-rc-2021)</summary> + <summary id="whats-in-my-rc-2021">What's in My RC 2021 • [read](/blog/whats-in-my-rc-2021)</summary> <p>May 29th, 2021</p> <p>A tour of my RC file in 2021.</p> </details> <details> - <summary>Building My Portfolio Website With Nextjs • [read](/blog/building-my-portfolio-website-with-nextjs)</summary> + <summary id="building-my-portfolio-website-with-nextjs">Building My Portfolio Website With Nextjs • [read](/blog/building-my-portfolio-website-with-nextjs)</summary> <p>November 20th, 2020</p> <p>Building a portfolio website with Nextjs.</p> </details> <details> - <summary>Striven Editor • [read](/blog/striven-editor)</summary> + <summary id="striven-editor">Striven Editor • [read](/blog/striven-editor)</summary> <p>October 27th, 2019</p> <p>At Striven, I led the research and development of a lightweight, in-house WYSIWYG editor to replace the heavy Kendo UI component.</p> </details> diff --git a/scripts/rss b/scripts/rss @@ -33,41 +33,23 @@ echo "<link>$PUBLIC_URL/blog</link>" echo "<description>$RSS_DESCRIPTION</description>" echo '<language>en-us</language>' -htmlq -f "$BLOG_HTML" '#blog ~ details' | - awk ' - /<details>/ { - in_block = 1 - block = $0 "\n" - next - } - - in_block { - block = block $0 "\n" - } - - in_block && /<\/details>/ { - printf "%s%c", block, 0 - in_block = 0 - block = "" - } - ' | - while IFS= read -r -d '' block; do - TITLE=$(printf '%s\n' "$block" | get_text summary | sed 's/ •.*$//') - DATE=$(printf '%s\n' "$block" | get_text 'p:nth-of-type(1)') - DESCRIPTION=$(printf '%s\n' "$block" | get_text 'p:nth-of-type(2)') - SLUG=$(printf '%s\n' "$block" | htmlq -a href 'summary a[href^="/blog/"]' | sed -n '1p') - CONTENT=$(cat "build$SLUG.html" | htmlq main | sed 's/<main>//;s/<\/main>//') - CLEAN_DATE=$(echo "$DATE" | sed 's/th//;s/st//;s/nd//;s/rd//') - PUBDATE=$(date -R -d "$CLEAN_DATE" 2>/dev/null || echo "$DATE") - - echo '<item>' - echo "<title>$TITLE</title>" - echo "<link>$PUBLIC_URL$SLUG</link>" - echo "<description>$DESCRIPTION</description>" - echo "<pubDate>$PUBDATE</pubDate>" - echo "<content:encoded><![CDATA[$CONTENT]]></content:encoded>" - echo '</item>' - done +cat "$BLOG_HTML" | htmlq -a id '#blog ~ details summary' | while read -r line; do + TITLE=$(cat "$BLOG_HTML" | get_text "#$line" | sed 's/ •.*$//') + DATE=$(cat "$BLOG_HTML" | get_text "#$line + p") + DESCRIPTION=$(cat "$BLOG_HTML" | get_text "#$line + p + p") + SLUG=$(cat "$BLOG_HTML" | htmlq -a href "#$line a[href^=\"/blog/\"]" | sed -n '1p') + CONTENT=$(cat "build$SLUG.html" | htmlq main | sed 's/<main>//;s/<\/main>//') + CLEAN_DATE=$(echo "$DATE" | sed 's/th//;s/st//;s/nd//;s/rd//') + PUBDATE=$(date -R -d "$CLEAN_DATE" 2>/dev/null || echo "$DATE") + + echo '<item>' + echo "<title>$TITLE</title>" + echo "<link>$PUBLIC_URL$SLUG</link>" + echo "<description>$DESCRIPTION</description>" + echo "<pubDate>$PUBDATE</pubDate>" + echo "<content:encoded><![CDATA[$CONTENT]]></content:encoded>" + echo '</item>' +done echo '</channel>' echo '</rss>'