summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <git@mx.buetow.org>2021-05-05 12:48:48 +0100
committerPaul Buetow <git@mx.buetow.org>2021-05-05 12:48:48 +0100
commit062b74ed9b5ab711c391ca7547224cdb80630f9e (patch)
tree038e2f5c534184198c57e7428d6ed79e0e91127d
parentcab10097634694e8d13642bf3dd330fc15333ee3 (diff)
can parse meta date from feed's file name
-rwxr-xr-xbuetow.org.sh10
-rw-r--r--content/gemtext/gemfeed/atom.xml4
-rw-r--r--content/html/gemfeed/atom.xml4
-rw-r--r--content/meta/gemfeed/2010-05-09-the-fype-programming-language.meta2
4 files changed, 11 insertions, 9 deletions
diff --git a/buetow.org.sh b/buetow.org.sh
index d8ead249..c9b3c75e 100755
--- a/buetow.org.sh
+++ b/buetow.org.sh
@@ -26,7 +26,6 @@ ERROR
## Atom module
atom::meta () {
- local -r now="$1"; shift
local -r gmi_file_path="$1"; shift
local -r meta_file=$(sed 's|gemtext|meta|; s|.gmi$|.meta|;' <<< "$gmi_file_path")
@@ -38,9 +37,12 @@ atom::meta () {
local title=$(sed -n '/^# / { s/# //; p; q; }' "$gmi_file_path" | tr '"' "'")
# Extract first paragraph from Gemtext
local summary=$(sed -n '/^[A-Z]/ { p; q; }' "$gmi_file_path" | tr '"' "'")
+ # Extract the date from the file name.
+ local filename_date=$(basename $gmi_file_path | cut -d- -f1,2,3)
+ local date=$(date --iso-8601=seconds --date "$filename_date $(date +%H:%M:%S)")
cat <<META | tee "$meta_file"
-local meta_date="$now"
+local meta_date="$date"
local meta_author="$AUTHOR"
local meta_email="$EMAIL"
local meta_title="$title"
@@ -71,7 +73,7 @@ ATOMHEADER
while read -r gmi_file; do
# Load cached meta information about the post.
- source <(atom::meta "$now" "$gemfeed_dir/$gmi_file")
+ source <(atom::meta "$gemfeed_dir/$gmi_file")
cat <<ATOMENTRY >> "$atom_file.tmp"
<entry>
@@ -93,7 +95,7 @@ ATOMENTRY
ATOMFOOTER
# Delete the 3rd line of the atom feeds (global feed update timestamp)
- if ! diff -u <(sed 3d "$atom_file.tmp") <(sed 3d "$atom_file"); then
+ if ! diff -u <(sed 3d "$atom_file") <(sed 3d "$atom_file.tmp"); then
echo "Feed got something new!"
mv "$atom_file.tmp" "$atom_file"
git add "$atom_file"
diff --git a/content/gemtext/gemfeed/atom.xml b/content/gemtext/gemfeed/atom.xml
index 57a2d485..10049994 100644
--- a/content/gemtext/gemfeed/atom.xml
+++ b/content/gemtext/gemfeed/atom.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
- <updated>2021-05-05T09:27:32+01:00</updated>
+ <updated>2021-05-05T12:48:29+01:00</updated>
<title>buetow.org feed</title>
<subtitle>Having fun with computers!</subtitle>
<link href="gemini://buetow.org/gemfeed/atom.xml" rel="self" />
@@ -76,7 +76,7 @@
<title>The Fype Programming Language</title>
<link href="gemini://buetow.org/gemfeed/2010-05-09-the-fype-programming-language.gmi" />
<id>gemini://buetow.org/gemfeed/2010-05-09-the-fype-programming-language.gmi</id>
- <updated>2010-05-09T09:26:28+01:00</updated>
+ <updated>2010-05-09T12:48:29+01:00</updated>
<summary>Fype is an interpreted programming language created by me for learning and fun. The interpreter is written in C. It has been tested on FreeBSD and NetBSD and may also work on other Unix like operating systems such as Linux based ones. To be honest, besides learning and fun there is really no other use case of why Fype actually exists as many other programming languages are much faster and more powerful.. .....to read on please visit my site.</summary>
<author>
<name>Paul Buetow</name>
diff --git a/content/html/gemfeed/atom.xml b/content/html/gemfeed/atom.xml
index ff147c01..f9b5cf5b 100644
--- a/content/html/gemfeed/atom.xml
+++ b/content/html/gemfeed/atom.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
- <updated>2021-05-05T09:27:32+01:00</updated>
+ <updated>2021-05-05T12:48:29+01:00</updated>
<title>buetow.org feed</title>
<subtitle>Having fun with computers!</subtitle>
<link href="https://buetow.org/gemfeed/atom.xml" rel="self" />
@@ -76,7 +76,7 @@
<title>The Fype Programming Language</title>
<link href="https://buetow.org/gemfeed/2010-05-09-the-fype-programming-language.html" />
<id>https://buetow.org/gemfeed/2010-05-09-the-fype-programming-language.html</id>
- <updated>2010-05-09T09:26:28+01:00</updated>
+ <updated>2010-05-09T12:48:29+01:00</updated>
<summary>Fype is an interpreted programming language created by me for learning and fun. The interpreter is written in C. It has been tested on FreeBSD and NetBSD and may also work on other Unix like operating systems such as Linux based ones. To be honest, besides learning and fun there is really no other use case of why Fype actually exists as many other programming languages are much faster and more powerful.. .....to read on please visit my site.</summary>
<author>
<name>Paul Buetow</name>
diff --git a/content/meta/gemfeed/2010-05-09-the-fype-programming-language.meta b/content/meta/gemfeed/2010-05-09-the-fype-programming-language.meta
index 77c4a44d..a6265580 100644
--- a/content/meta/gemfeed/2010-05-09-the-fype-programming-language.meta
+++ b/content/meta/gemfeed/2010-05-09-the-fype-programming-language.meta
@@ -1,4 +1,4 @@
-local meta_date="2010-05-09T09:26:28+01:00"
+local meta_date="2010-05-09T12:48:29+01:00"
local meta_author="Paul Buetow"
local meta_email="comments@mx.buetow.org"
local meta_title="The Fype Programming Language"