Skip to content

Commit c48cdc3

Browse files
authored
Add lastmod, last modified date of the bibliographic entry (#302)
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.
1 parent d1f9335 commit c48cdc3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

scripts/bibSplit.pl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ sub sanitize_text {
103103

104104
my $urlSource = defined $obj->{url} ? $obj->{url} : '';
105105

106-
# Some/most/all of these *may* need sanitize_text
106+
# Modified date
107+
my $dateModified = defined $obj->{dateModified} ? $obj->{dateModified} : '';
108+
107109
# optional fields - ones used vary by value of type
108110
my $applicationNumber = defined $obj->{applicationNumber} ? qq{"$obj->{applicationNumber}"} : '""';
109111
my $assignee = defined $obj->{assignee} ? qq{"$obj->{assignees}"} : '""';
@@ -185,6 +187,9 @@ sub sanitize_text {
185187
tags:
186188
url_source: $urlSource
187189
zotero_url: "https://www.zotero.org/groups/2914042/items/$key"
190+
191+
# Timestamp of last modification to bibliographic item
192+
lastmod: $dateModified
188193
---
189194
190195
ENDITEM

scripts/update_bibliography.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ fi
282282

283283
# Remove library, links, and meta objects; and some fields from entries
284284
# (These are not used any further on, so simplify.)
285-
items=$(jq 'map(del(.["library", "links", "meta", "accessed", "accessDate", "dateAdded", "dateModified"]))' <<< "$items")
285+
items=$(jq 'map(del(.["library", "links", "meta", "accessed", "accessDate", "dateAdded"]))' <<< "$items")
286286
showInfo 8 "Remove library, links, and meta objects and some unnecessary fields"
287287
if $debugFiles ; then
288288
dfn=$(debugFileName "noLibraryLinksMeta" $dfn)

0 commit comments

Comments
 (0)