◊(Local Yarn Code "Check-in [d0e6644b]")

Overview
Comment:Correct fetching of metadata from 'series' metas
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: d0e6644b1c7f3ee1e680b0839f6a11099ee33a8802995bf0ec0e9fb641fa115e
User & Date: joel on 2019-02-10 20:50:13
Other Links: manifest | tags
Context
2019-02-11
05:15
Add makefile and beginnings of code docs check-in: e4d9446c user: joel tags: trunk
2019-02-10
20:50
Correct fetching of metadata from 'series' metas check-in: d0e6644b user: joel tags: trunk
2019-02-09
19:32
Rename template-html.rkt → snippets-html.rkt check-in: 99fe3246 user: joel tags: trunk
Changes

Modified dust.rkt from [27351ca1] to [498fe5c1].

44
45
46
47
48
49
50

51
52
53
54
55
56
57
58
59
60










61
62

63
64
65
66


67
68

69
70
71
72
73
74
75
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58



59
60
61
62
63
64
65
66
67
68
69

70
71
72


73
74
75

76
77
78
79
80
81
82
83







+







-
-
-
+
+
+
+
+
+
+
+
+
+

-
+


-
-
+
+

-
+







         tx-strs
         first-words
         build-note-id
         notes->last-disposition-values
         )

(define default-authorname "Joel Dueck")
(define series-path "series/")

(define (default-title date)
  (format "Entry of ~a" (ymd->dateformat date "d MMM YYYY")))

(define (maybe-meta m [missing ""])
  (or (select-from-metas m (current-metas)) missing))

(define (series-noun)
  (define series-pagenode (->pagenode (or (select-from-metas 'series (current-metas)) "")))
  (case series-pagenode
(define (series-pagenode)
  (define maybe-series (or (select-from-metas 'series (current-metas)) ""))
  (cond
    [(non-empty-string? maybe-series)
     (->pagenode (string-append series-path maybe-series ".html"))]
    [else '||]))

(define (series-noun)
  (define series-pnode (series-pagenode)) 
  (case series-pnode
    ['|| ""] ; no series specified
    [else (or (select-from-metas 'noun-singular series-pagenode) "")]))
    [else (or (select-from-metas 'noun-singular series-pnode) "")]))

(define (series-title)
  (define series-pagenode (->pagenode (or (select-from-metas 'series (current-metas)) "")))
  (case series-pagenode
  (define series-pnode (series-pagenode)) 
  (case series-pnode
    ['|| ""] ; no series specified
    [else (or (select-from-metas 'title series-pagenode) "")]))
    [else (or (select-from-metas 'title series-pnode) "")]))

(define (attr-present? name attrs)
  (for/or ([attr-pair (in-list attrs)])
          (equal? name (car attr-pair))))

(define (maybe-attr name attrs [missing ""])
  (define result (assoc name attrs))