aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xblarg9
1 files changed, 5 insertions, 4 deletions
diff --git a/blarg b/blarg
index 1c7272e..0f212a1 100755
--- a/blarg
+++ b/blarg
@@ -9,14 +9,14 @@ index_tsv() {
do
created=$(git log --pretty='format:%aI' "$f" 2> /dev/null | tail -1)
updated=$(git log --pretty='format:%aI' "$f" 2> /dev/null | head -1)
- title=$(sed -n '/^# /{s/# //p; q}' "$f")
+ title=$(sed -n '/^# /{s/# //p; q;}' "$f")
printf '%s\t%s\t%s\t%s\n' "$f" "${title:="No Title"}" "${created}" "${updated}"
done
}
index_html() {
# Print header
- title=$(sed -n '/^# /{s/# //p; q}' index.md)
+ title=$(sed -n '/^# /{s/# //p; q;}' index.md)
sed -e 's/{{TITLE}}//g' header.html
# Intro text
@@ -47,7 +47,7 @@ atom_xml() {
<icon>https://justine.smithies.me.uk/public/favicon-32x32.png</icon>
<title>$(grep -o '<title>.*</title>' header.html | sed 's/\(<title>\|{{TITLE}}<\/title>\)//g')</title>
<link href="$uri" rel="self" />
- <updated>$(date --iso=seconds)</updated>
+ <updated>$(date -Iseconds)</updated>
<author>
<name>$(git config user.name)</name>
</author>
@@ -92,7 +92,8 @@ write_page() {
title=$2
$MARKDOWN "$filename" | \
- sed -e '1,/h1>/{/h1>/a <small><b>'$dates_text'</b></small>' -e '}' | \
+ sed -e '1,/h1>/{/h1>/a\
+ <small><b>'$dates_text'</b></small>' -e '}' | \
cat header.html - | \
sed "s/{{TITLE}}/ - $title/" \
> "$target" && sed "s/{{YEAR}}/$year/" footer.html >> "$target"