Index: code-docs/crystalize.scrbl ================================================================== --- code-docs/crystalize.scrbl +++ code-docs/crystalize.scrbl @@ -23,12 +23,12 @@ stores it in various pieces in a SQLite cache. Individual articles save chunks of rendered HTML to the cache when their individual pages are rendered. When pulling together listings of articles in different contexts that need to be filtered and sorted, a SQL query is much faster than trolling through the Pollen cache for matching docs and regenerating the HTML. -@margin-note{These functions are designed to be used within the template for articles and series, -respectively, so that the cache is updated precisely when the web page is rendered.} +@margin-note{These functions are designed to be used within templates, so that the rows in the cache +database for a page are updated right when that web page is rendered.} @defproc[(parse-and-cache-article! [pagenode pagenode?] [doc txexpr?]) (values non-empty-string? non-empty-string?)]{ Returns two values: the “plain” title of the article, and a string containing the full HTML of @@ -43,6 +43,19 @@ article. If there are @racket[note]s or @racket[index] tags in the doc, they are parsed and saved individually to the SQLite cache (using @racket[make-cache:note] and @racket[make-cache:index-entry]). 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[(cache-index-entries-only! [title string?] [page pagenode?] [doc txexpr?]) void?]{ + +Saves only the @racket[index] entres in @racket[_doc] to the cache database, so that they appear in +the keyword index. + +This function allows pages that are not @tech{articles} to have their own keyword index entries, and +should be used in the templates for such pages. + +As a side effect of calling this function, a minimal @racket[cache:article] is created for the page +with its @racket['conceal] meta set to @racket{all}, to exclude it from any listings. + } Index: crystalize.rkt ================================================================== --- crystalize.rkt +++ crystalize.rkt @@ -275,10 +275,11 @@ (lambda () (call-with-transaction (cache-conn) (lambda () (cache-index-entries! pagenode doc) + (delete-article! pagenode) (insert-one! (cache-conn) (make-cache:article #:title-plain title - #:conceal (maybe-meta 'conceal) + #:conceal "blog,feed" #:page pagenode))))))))