Moved to Makefile based build system
Got rid of janky build.sh script. Now uses a bunch of janky scripts and a make file - because that is bound to be easier to maintain.
This commit is contained in:
parent
39791363fa
commit
56f95cb9aa
13 changed files with 289 additions and 234 deletions
bin
24
bin/rssIntro
Executable file
24
bin/rssIntro
Executable file
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
file="$1"
|
||||
|
||||
getBlogSlug(){
|
||||
echo "$1" | sed 's/^content\//\//' | sed 's/.md$/\//' | sed -E 's/[0-9]+-//'
|
||||
}
|
||||
|
||||
info="$(sed -n '/---/,/---/p' "$file" | sed '/^$/,$d' | sed -n '1,/---/p' | sed '/^---$/d')"
|
||||
|
||||
slug=$(getBlogSlug "$file")
|
||||
date="$(echo "$info" | yq -r .date)"
|
||||
rfc822="$(date --utc -d "$date" "+%a, %d %b %Y %H:%M:%S") UT"
|
||||
title="$(echo "$info" | yq -r .title)"
|
||||
description="$(echo "$info" | yq -r .description)"
|
||||
|
||||
echo "<item>
|
||||
<title>
|
||||
<![CDATA[$title]]></title>
|
||||
<link>https://jonathanh.co.uk$slug</link>
|
||||
<guid isPermaLink=\"true\">https://jonathanh.co.uk$slug</guid>
|
||||
<pubDate>$rfc822</pubDate>
|
||||
<description><![CDATA[$description]]></description>
|
||||
</item>"
|
Loading…
Add table
Add a link
Reference in a new issue