Skip to content

Commit

Permalink
Merge pull request #471 from line-o/feat/people-caching
Browse files Browse the repository at this point in the history
Cache additional routes: people/by-year and people/by-name
  • Loading branch information
windauer authored Jan 22, 2025
2 parents f56982e + d3e0fca commit cf17eaa
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions modules/config.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,16 @@ declare variable $config:FRUS_HISTORY_ARTICLES_COL := $config:FRUS_HISTORY_COL |
declare variable $config:FRUS_HISTORY_DOCUMENTS_COL := $config:FRUS_HISTORY_COL || '/documents';
declare variable $config:FRUS_HISTORY_EVENTS_COL := $config:FRUS_HISTORY_COL || '/events';
declare variable $config:FRUS_HISTORY_MONOGRAPH_COL := $config:FRUS_HISTORY_COL || '/monograph';
declare variable $config:POCOM_PEOPLE_COL := '/db/apps/pocom/people';

declare variable $config:IGNORED_DIVS := ("toc");

declare function config:pocom-people-last-modified() as xs:dateTime {
collection($config:POCOM_PEOPLE_COL)//last-modified-date
=> sort() => reverse() => head()
=> concat("T00:00:00Z") => xs:dateTime()
};

declare variable $config:PUBLICATIONS :=
map {
"frus": map {
Expand Down Expand Up @@ -423,13 +430,15 @@ declare variable $config:PUBLICATIONS :=
"breadcrumb-title":
function($parameters as map(*)) as xs:string? {
"Starting with " || upper-case($parameters?letter)
}
},
"publication-last-modified": config:pocom-people-last-modified#0
},
"people-by-year": map {
"title": "Principal Officers and Chiefs of Mission Chronological Listing - Department History",
"breadcrumb-title": function($parameters as map(*)) as xs:string? {
$parameters?year
}
},
"publication-last-modified": config:pocom-people-last-modified#0
},
"people-by-role": map {
"title": "Principal Officers and Chiefs of Mission Alphabetical Listing - Department History",
Expand Down

0 comments on commit cf17eaa

Please sign in to comment.