diff options
| author | Paul Buetow <git@mx.buetow.org> | 2021-05-05 12:48:48 +0100 |
|---|---|---|
| committer | Paul Buetow <git@mx.buetow.org> | 2021-05-21 05:11:04 +0100 |
| commit | 34514d0686ce42f5e55e750f873c537eae476513 (patch) | |
| tree | d6d61cb5a9ec4e89b3a4772945d8c9b579e63bb1 | |
| parent | a0a2af847e31cb31ca134e92412d60d17294b4f8 (diff) | |
can parse meta date from feed's file name
| -rwxr-xr-x | buetow.org.sh | 10 | ||||
| -rw-r--r-- | content/gemtext/gemfeed/atom.xml | 4 | ||||
| -rw-r--r-- | content/html/gemfeed/atom.xml | 4 | ||||
| -rw-r--r-- | content/meta/gemfeed/2010-05-09-the-fype-programming-language.meta | 2 |
4 files changed, 11 insertions, 9 deletions
diff --git a/buetow.org.sh b/buetow.org.sh index d8ead24..c9b3c75 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 57a2d48..1004999 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 ff147c0..f9b5cf5 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 77c4a44..a626558 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" |
