Index: code-docs/crystalize.scrbl ================================================================== --- code-docs/crystalize.scrbl +++ code-docs/crystalize.scrbl @@ -42,10 +42,15 @@ specifies a @racket['series] meta, information about that series is fetched and used in the rendering of the article. If there are @racket[note]s in the doc, they are parsed and saved individually to the SQLite cache. If any of the notes use the @code{#:disposition} attribute, information about the disposition is parsed out and used in the rendering of the article. +@defproc[(crystalize-series!) void?] + +Saves metas for the current series page in the SQLite cache. Meant to be called from the HTML +template for “Series” pages (Pollen documents located in @racket[series-folder]). + @deftogether[(@defproc[(list/articles [type (or/c 'listing_full_html 'listing_short_html 'listing_excerpt_html)] [#:series series (or/c string? boolean?) #t] [#:limit limit stringish? -1] Index: crystalize.rkt ================================================================== --- crystalize.rkt +++ crystalize.rkt @@ -27,10 +27,11 @@ ;; ~~~ Provides ~~~ (provide spell-of-summoning! crystalize-article! + crystalize-series! article-plain-title list/articles list/articles+notes listing<>-short/articles listing<>-full/articles @@ -403,6 +404,16 @@ (hash-ref series-metas 'noun-plural "") (hash-ref series-metas 'noun-singular "")))) (define sql$-insert (make-insert-rows-query 'series table_series-fields series-values)) (displayln sql$-insert) (query! sql$-insert)) - + +;; Save the current article to the `series` table of the SQLite cache +;; Should be called from a template for series pages +(define (crystalize-series!) + (define series-row + (list (path->string (here-output-path)) + (hash-ref (current-metas) 'title) + (hash-ref (current-metas) 'published "") + (hash-ref (current-metas) 'noun-plural "") + (hash-ref (current-metas) 'noun-singular ""))) + (apply query! (make-insert/replace-query 'series table_series-fields) series-row)) Index: series/template.html.p ================================================================== --- series/template.html.p +++ series/template.html.p @@ -1,8 +1,8 @@ - +◊crystalize-series! ◊html$-page-head[(select-from-metas 'title metas)] ◊html$-page-body-open["series-page"] ◊(unfence (->html doc #:splice? #t))