@@ -32,10 +32,11 @@ ;; Provides common helper functions used throughout the project (provide maybe-meta ; Select from (current-metas) or default value ("") if not available maybe-attr ; Return an attribute’s value or a default ("") if not available series-noun ; Retrieve noun-singular from current 'series meta, or "" + series-title ; Retrieve title of series in current 'series meta, or "" attr-present? ; Test if an attribute is present disposition-values ymd->english ymd->dateformat default-authorname @@ -57,10 +58,16 @@ (define series-pagenode (->pagenode (or (select-from-metas 'series (current-metas)) ""))) (case series-pagenode ['|| ""] ; no series specified [else (or (select-from-metas 'noun-singular series-pagenode) "")])) +(define (series-title) + (define series-pagenode (->pagenode (or (select-from-metas 'series (current-metas)) ""))) + (case series-pagenode + ['|| ""] ; no series specified + [else (or (select-from-metas 'title series-pagenode) "")])) + (define (attr-present? name attrs) (for/or ([attr-pair (in-list attrs)]) (equal? name (car attr-pair)))) (define (maybe-attr name attrs [missing ""]) @@ -98,12 +105,11 @@ (values (car splut) (string-join (cdr splut))))])) ;; The format of a note’s ID is “HTML-driven” (used as an anchor link) but is included ;; here since it also serves as a primary key in the DB. (define (build-note-id txpr) - (string-append "#" - (maybe-attr 'date (get-attrs txpr)) + (string-append (maybe-attr 'date (get-attrs txpr)) "_" (uri-encode (maybe-attr 'author (get-attrs txpr) default-authorname)))) ;; Extract the last disposition (if any), and the ID of the disposing note, out of a list of notes (define (notes->last-disposition-values txprs)