From 64b434986bba325d1545e3ed767f89d2823c0d6d Mon Sep 17 00:00:00 2001 From: vilmibm Date: Sat, 28 May 2022 01:23:50 +0100 Subject: [PATCH] link handling --- make.sh | 17 +++++++++++++---- posts/0001_newblog.md | 6 +++--- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/make.sh b/make.sh index 0ce4a78..08ef7f3 100755 --- a/make.sh +++ b/make.sh @@ -19,7 +19,13 @@ gopherIndex="${gopherPath}/gophermap" geminiPath=$HOME/public_gemini/blog geminiIndex="${geminiPath}/index.gmi" -cd $postDir > /dev/null +# attempt compilation +if [ ! -e "linkpost" ] +then + go build -o linkpost main.go +fi + +lp="$(pwd)/linkpost" # backup HTML index if [ -e "${htmlIndex}" ] @@ -40,6 +46,8 @@ echo >> $gopherIndex echo "the gemblog of vilmibm as it were" > $geminiIndex echo >> $geminiIndex +cd $postDir > /dev/null + for p in $(ls *.md | sort -r) do pubdate=$(grep "pubdate:" $p | sed 's/pubdate: //') @@ -53,16 +61,17 @@ do echo "

${title}

" >> $htmlIndex echo "${pubdate}" >> $htmlIndex echo "
" >> $htmlIndex - grep -v "pubdate:" $p | grep -v "title:" | grep -v "slug:" | pandoc -fmarkdown -thtml >> $htmlIndex + grep -v "pubdate:" $p | grep -v "title:" | grep -v "slug:" | $lp --mode "html" | pandoc -fmarkdown -thtml >> $htmlIndex echo "
" >> $htmlIndex + # Gopher echo "0${title} ${slug}.txt" >> $gopherIndex gopherPostPath="${gopherPath}/${slug}.txt" echo "# ${title}" > $gopherPostPath echo >> $gopherPostPath echo "_published ${pubdate}_" >> $gopherPostPath - grep -v "pubdate:" $p | grep -v "title:" | grep -v "slug:" >> $gopherPostPath + grep -v "pubdate:" $p | grep -v "title:" | grep -v "slug:" | $lp --mode "gopher" >> $gopherPostPath # Gemini echo "=> gemini://tilde.town/~vilmibm/blog/${slug}.gmi ${title}" >> $geminiIndex @@ -70,7 +79,7 @@ do echo "# ${title}" > $geminiPostPath echo >> $geminiPostPath echo "_published ${pubdate}_" >> $geminiPostPath - grep -v "pubdate:" $p | grep -v "title:" | grep -v "slug:" >> $geminiPostPath + grep -v "pubdate:" $p | grep -v "title:" | grep -v "slug:" | $lp --mode "gemini" >> $geminiPostPath fi done diff --git a/posts/0001_newblog.md b/posts/0001_newblog.md index 9116e95..1dd9f4f 100644 --- a/posts/0001_newblog.md +++ b/posts/0001_newblog.md @@ -6,15 +6,15 @@ I made a blog. I haven't had one in years. When I did it was mostly for dream lo Another reason I'm making one of these again is self-actualization. Historically I've thought very poorly of myself and agonized over anyone actually caring what I posted. Now, I'm just excited to share whatever I'm excited about or mentally chewing on, not out of self-aggrandizement, but because the stuff I find interesting is interesting because I find it interesting. It's a very cozy tautology. I'm not interested in building a following or crafting a brand: just sharing what inspires me in an honest way while still keeping some of myself to myself. -Finally, I like to mark time with the discovery of artifacts. I'm always hunting for inspiring things--books, sites, objects, people--and feel an urge to catalogue them so I can be re-inspired in the future. I post on social media about these things sometimes, but social media is uniquely unsuited to reflection and later perusal. I liked Tumblr for this to an extent but never got comfy posting there; too many numbers and buttons and noise there for me to feel like I could collect my thoughts or feel like I was posting for myself instead of a hypothetical audience that might "like" something. I also don't like being beholden to corporate platforms. +Finally, I like to mark time with the discovery of artifacts. I'm always hunting for inspiring things--books, sites, objects, people--and feel an urge to catalogue them so I can be re-inspired in the future. I post on social media about these things sometimes, but social media is uniquely unsuited to reflection and later perusal. I liked Tumblr for this to an extent but never got comfy posting there; too many numbers and buttons and noise there for me to feel like I could collect my thoughts or feel like I was posting for myself instead of a hypothetical audience that might "like" something. I also don't like being beholden to (LINK https://twitter.com/nate_smith corporate platforms). Some initial posting fodder: * Going through a decade's worth of unsorted bookmarks and posting interesting finds -* Reviews or pre-reviews of 1990s primary "cyber media" that I collect like old academic books on hypertext culture and trashy web magazines +* Reporting on 1990s primary "cyber media" that I collect like academic books on hypertext and trashy web magazines * Project ideas that I'll never get to * Project ideas that I have gotten to * My "religious" interests in Discordianism and Hermeticism * Fiction/poetry/essays -Technically speaking, this is all powered by some markdown files with custom metadata embedded in it and a <100 line (LINK https://git.tilde.town/vilmibm/blog/src/branch/trunk/make.sh bash script). I considered a static site generator...but I prefer scripting my own thing wrt blogging. It keeps me humble and I find that I don't use most of the features of off the shelf things. I wanted to take an idiosyncratic approach to drafting posts and have control over posting to all three of html, gemini, and gopher. +Technically speaking, this is all powered by some markdown files with custom metadata embedded in it, a <100 line bash script, and a Go program for handling a little linking macro. I wanted to be able to author links in a consistent way but have sensible renderings in HTML, Gemini, and Gopher. All of this, including posts, can be found in (LINK https://git.tilde.town/vilmibm/blog this repository). I considered a static site generator...but I prefer scripting my own thing wrt blogging. It keeps me humble and I find that I don't use most of the features of off the shelf things.