From 7ab4f235cf20e6da6999a37f3c1ac51124782931 Mon Sep 17 00:00:00 2001 From: "Christopher P. Brown" Date: Mon, 24 Jan 2022 17:51:30 -0700 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20inittles=20committles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++ feed.tmpl | 11 ++++++++++ justfile | 37 ++++++++++++++++++++++++++++++++ src/00001.md | 5 +++++ 4 files changed, 113 insertions(+) create mode 100644 README.md create mode 100644 feed.tmpl create mode 100644 justfile create mode 100644 src/00001.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..5018384 --- /dev/null +++ b/README.md @@ -0,0 +1,60 @@ +# Gardener 🌱 + +This is a tool for making a weed. + +weed +: short for "web feed" +: an rss-only blog + +(All of the content is in the RSS feed. There is no web content.) + +## About + +This uses pandoc's `--template` flag to create an rss feed item. + +See `feed.tmpl`. + +## Motivation + +RSS is dead, but we never stopped using it. + +We are the necromancers who fill it with the foul mimicry of life. + +## Requirements + +- [pandoc](https://pandoc.org/) +- [casey/just](https://github.com/casey/just) +- [sharkdp/fd](https://github.com/sharkdp/fd) + +## Getting Started + +1. Edit the `vars` section at the top of the justfile + +2. Edit the `author` tag in `feed.tmpl`. Or, as a learning exercise, change the contents of the tag to `$author$` and start including an "author" value in the front matter of all your markdown sources. See how that works? + +3. Create a new markdown file in `/src` + +4. Give it the following YAML metadata block + + ``` + --- + title: 'title of my post' + created_at: 'Mon, 24 Jan 2022 17:26:03 -0700' + --- + ``` + + Note that values need to be quoted. + + Note further that the timestamp should in RFC 5532 format. (`date -R`) + +5. Write the rest of your post + +6. Run `just build` to assemble your xml + +7. Edit the `up` recipe in the justfile so you can upload to your server. + +8. If you're feeling swoopy, run `just all` to build and upload in one fell swoop. + +## Acknowledgments + +Thanks to the #basement crew for making such a lovely garden full of beautiful weeds <3 diff --git a/feed.tmpl b/feed.tmpl new file mode 100644 index 0000000..715b387 --- /dev/null +++ b/feed.tmpl @@ -0,0 +1,11 @@ + + $if(title)$$title$$else$Title Unknown$endif$ + TODO: FIXME + $if(created_at)$$created_at$$else$Unknown Date$endif$ + $if(created_at)$$created_at$$else$Unknown Date$endif$ + + + + diff --git a/justfile b/justfile new file mode 100644 index 0000000..6db3963 --- /dev/null +++ b/justfile @@ -0,0 +1,37 @@ +# vars +feed_title := "confessions of a gardener" +feed_desc := "all about my dirty life and times" +feed_href := "https://example.com/weed/feed.xml" +outfile := "feed.xml" + +# show all available commands +default: + just --list + +# build feed.xml +build: + #!/bin/sh + echo "Building xml file!!" + echo "" > {{outfile}} + echo "" >> {{outfile}} + echo " " >> {{outfile}} + echo " " >> {{outfile}} + echo " {{feed_title}}" >> {{outfile}} + echo " {{feed_href}}" >> {{outfile}} + echo " {{feed_desc}}" >> {{outfile}} + + fd . 'src/' -e md -x pandoc --template=feed.tmpl >> {{outfile}} + + echo " " >> {{outfile}} + echo " " >> {{outfile}} + echo "Done building xml file \o/" + +# upload feed.xml +up: + @echo "Uploading to server!!" + #@rsync -azP feed.xml server:www/weed/ + @echo "Done uploading to server \o/" + +# build and upload +all: build up + @echo "Roger dodger, it's all done: you have tended your garden 🌱" diff --git a/src/00001.md b/src/00001.md new file mode 100644 index 0000000..4afdd03 --- /dev/null +++ b/src/00001.md @@ -0,0 +1,5 @@ +--- +title: 'the beginning of our adventure together' +created_at: 'Mon, 24 Jan 2022 17:34:36 -0700' +--- +So the other day I was riding my bike, and....