aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustine Smithies <justine@smithies.me.uk>2024-05-25 17:02:06 +0100
committerJustine Smithies <justine@smithies.me.uk>2024-05-25 17:02:06 +0100
commit630f3954da722568e41a2aab14c508d95fd0fb99 (patch)
treeaf86c79e5079d226b27902dc21a53dfb1e6ddd51
parent5da13ec669a2e9df7914fd250980d951bceeaccb (diff)
Resolved issues after moving from gnu/linux to a bsd/linux hybrid - Chimera Linux
-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"