From 68ea7a6b124f7dae8a14608fd39a1a8fac139dbe Mon Sep 17 00:00:00 2001 From: Bill Stumbo Date: Mon, 3 Nov 2025 08:14:28 -0500 Subject: [PATCH] Add lastmod, last modified date of the bibliographic entry lastmod is used in the sitemap to help identify files that have changed and should be recrawled. Writing lastmod into the markdown file's YAML will ensure it takes presidence over the current date field, which represents the publication date of the item, not the last time the bibliographic entry was modified. --- scripts/bibSplit.pl | 7 ++++++- scripts/update_bibliography.sh | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/bibSplit.pl b/scripts/bibSplit.pl index 044a1738..c0083d6b 100755 --- a/scripts/bibSplit.pl +++ b/scripts/bibSplit.pl @@ -103,7 +103,9 @@ sub sanitize_text { my $urlSource = defined $obj->{url} ? $obj->{url} : ''; - # Some/most/all of these *may* need sanitize_text + # Modified date + my $dateModified = defined $obj->{dateModified} ? $obj->{dateModified} : ''; + # optional fields - ones used vary by value of type my $applicationNumber = defined $obj->{applicationNumber} ? qq{"$obj->{applicationNumber}"} : '""'; my $assignee = defined $obj->{assignee} ? qq{"$obj->{assignees}"} : '""'; @@ -185,6 +187,9 @@ sub sanitize_text { tags: url_source: $urlSource zotero_url: "https://www.zotero.org/groups/2914042/items/$key" + +# Timestamp of last modification to bibliographic item +lastmod: $dateModified --- ENDITEM diff --git a/scripts/update_bibliography.sh b/scripts/update_bibliography.sh index 2229ae5f..e56f8f58 100755 --- a/scripts/update_bibliography.sh +++ b/scripts/update_bibliography.sh @@ -282,7 +282,7 @@ fi # Remove library, links, and meta objects; and some fields from entries # (These are not used any further on, so simplify.) -items=$(jq 'map(del(.["library", "links", "meta", "accessed", "accessDate", "dateAdded", "dateModified"]))' <<< "$items") +items=$(jq 'map(del(.["library", "links", "meta", "accessed", "accessDate", "dateAdded"]))' <<< "$items") showInfo 8 "Remove library, links, and meta objects and some unnecessary fields" if $debugFiles ; then dfn=$(debugFileName "noLibraryLinksMeta" $dfn)