Overview
| Comment: | Split cache schema and fetchers into a separate module |
|---|---|
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
cb8af9fcd70a9471978978ac9be749a6 |
| User & Date: | joel on 2020-02-02 04:20:23.576 |
| Other Links: | manifest | tags |
Context
|
2020-02-02
| ||
| 04:53 | Include bold type check-in: 4fecf9d9 user: joel tags: trunk | |
| 04:20 | Split cache schema and fetchers into a separate module check-in: cb8af9fc user: joel tags: trunk | |
|
2020-02-01
| ||
| 22:54 | Remove filter property on home page image, closes [0d5932bd9996832b] check-in: 1129e752 user: joel tags: trunk | |
Changes
Modified blog.rkt
from [abf461d1]
to [75b9d900].
1 2 3 4 5 6 7 8 | #lang pollen/mode racket/base ; SPDX-License-Identifier: BlueOak-1.0.0 ; This file is licensed under the Blue Oak Model License 1.0.0. ;; Builds the paginated “blog” HTML files (blog-pg1.html ...) from the SQLite cache ;; The files will be written out every time this module is evaluated! (see end) | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
#lang pollen/mode racket/base
; SPDX-License-Identifier: BlueOak-1.0.0
; This file is licensed under the Blue Oak Model License 1.0.0.
;; Builds the paginated “blog” HTML files (blog-pg1.html ...) from the SQLite cache
;; The files will be written out every time this module is evaluated! (see end)
(require "cache.rkt"
"snippets-html.rkt"
"dust.rkt"
racket/file
sugar/list)
(provide main)
|
| ︙ | ︙ |
Added cache.rkt version [7fc7c05e].
Modified crystalize.rkt
from [f45f7570]
to [c41782ea].
1 2 3 4 5 | #lang racket/base ; SPDX-License-Identifier: BlueOak-1.0.0 ; This file is licensed under the Blue Oak Model License 1.0.0. | | | > > | | < | > | < < | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
#lang racket/base
; SPDX-License-Identifier: BlueOak-1.0.0
; This file is licensed under the Blue Oak Model License 1.0.0.
(require deta
db/base
db/sqlite3
threading
racket/match
racket/string
txexpr
pollen/template
(except-in pollen/core select) ; avoid conflict with deta
)
(require "dust.rkt" "cache.rkt" "snippets-html.rkt")
(provide parse-and-cache-article!
cache-series!)
;; Save an article and its notes (if any) to the database, and return the
;; rendered HTML of the complete article.
(define (parse-and-cache-article! pagenode doc)
(define-values (doc-no-title maybe-title)
(splitf-txexpr doc (make-tag-predicate 'title)))
(define-values (body-txpr note-txprs)
(splitf-txexpr doc-no-title (make-tag-predicate 'note)))
(define-values (disposition disp-note-id)
(notes->last-disposition-values note-txprs))
|
| ︙ | ︙ | |||
325 326 327 328 329 330 331 |
(where (= entry.page ,(symbol->string pagenode))))))
(unless (null? entry-txs)
(void
(apply insert! cache-conn
(for/list ([etx (in-list entry-txs)])
(txexpr->index-entry etx pagenode))))))
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 228 229 230 231 232 233 234 235 236 237 238 239 240 241 |
(where (= entry.page ,(symbol->string pagenode))))))
(unless (null? entry-txs)
(void
(apply insert! cache-conn
(for/list ([etx (in-list entry-txs)])
(txexpr->index-entry etx pagenode))))))
;; Save the current article to the `series` table of the SQLite cache
;; Should be called from a template for series pages
(define (cache-series!)
(define here-page (path->string (here-output-path)))
(query-exec cache-conn
(delete (~> (from cache:series #:as s)
|
| ︙ | ︙ |
Modified keyword-index.rkt
from [50258609]
to [d37c4752].
| ︙ | ︙ | |||
10 11 12 13 14 15 16 |
racket/list
racket/file
racket/string
db/base
net/uri-codec
pollen/template)
| | | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
racket/list
racket/file
racket/string
db/base
net/uri-codec
pollen/template)
(require "cache.rkt"
"dust.rkt"
"snippets-html.rkt")
(provide main)
;; Terminology (because these things get confusing fast)
;;
|
| ︙ | ︙ |
Modified makefile
from [ceed52b6]
to [223b34de].
1 2 3 4 5 6 7 8 9 | # SPDX-License-Identifier: BlueOak-1.0.0 # This file is licensed under the Blue Oak Model License 1.0.0. SHELL = /bin/bash # ~~~ Variables used by rules ~~~ # core-files := pollen.rkt dust.rkt | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # SPDX-License-Identifier: BlueOak-1.0.0 # This file is licensed under the Blue Oak Model License 1.0.0. SHELL = /bin/bash # ~~~ Variables used by rules ~~~ # core-files := pollen.rkt dust.rkt html-deps := snippets-html.rkt tags-html.rkt crystalize.rkt cache.rkt article-sources := $(wildcard articles/*.poly.pm) articles-html := $(patsubst %.poly.pm, %.html, $(article-sources)) articles-pdf := $(patsubst %.poly.pm, %.pdf, $(article-sources)) series-sources := $(wildcard series/*.poly.pm) series-html := $(patsubst %.poly.pm, %.html, $(series-sources)) |
| ︙ | ︙ |
Modified pollen.rkt
from [ec6e30b5]
to [5f7205ca].
| ︙ | ︙ | |||
9 10 11 12 13 14 15 16 17 18 19 20 |
racket/syntax
syntax/parse
pollen/setup))
(require pollen/tag
pollen/setup
racket/function
"tags-html.rkt"
"snippets-html.rkt"
"crystalize.rkt")
(provide (all-defined-out)
| > | > > | 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
racket/syntax
syntax/parse
pollen/setup))
(require pollen/tag
pollen/setup
racket/function
"cache.rkt"
"tags-html.rkt"
"snippets-html.rkt"
"crystalize.rkt")
(provide (all-defined-out)
(all-from-out "crystalize.rkt" "snippets-html.rkt" "cache.rkt"))
(module setup racket/base
(require syntax/modresolve
racket/runtime-path
pollen/setup)
(provide (all-defined-out))
(define poly-targets '(html))
(define block-tags (append '(title style dt note) default-block-tags))
(define-runtime-path tags-html.rkt "tags-html.rkt")
(define-runtime-path snippets-html.rkt "snippets-html.rkt")
(define-runtime-path dust.rkt "dust.rkt")
(define-runtime-path crystalize.rkt "crystalize.rkt")
(define-runtime-path cache.rkt "cache.rkt")
(define cache-watchlist
(map resolve-module-path
(list tags-html.rkt
snippets-html.rkt
dust.rkt
cache.rkt
crystalize.rkt))))
(case (current-poly-target)
[(html) (init-cache-db!)])
;; Macro for defining tag functions that automatically branch based on the
;; current output format and the list of poly-targets in the setup module.
|
| ︙ | ︙ |
Modified rss-feed.rkt
from [ca1031f8]
to [502871b7].
| ︙ | ︙ | |||
8 9 10 11 12 13 14 |
(require txexpr
racket/match
racket/file
racket/date
racket/string
db/base
"dust.rkt"
| | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
(require txexpr
racket/match
racket/file
racket/date
racket/string
db/base
"dust.rkt"
"cache.rkt")
(provide main)
(define feed-author default-authorname)
(define feed-author-email "[email protected]")
(define feed-title "The Local Yarn (Beta)")
(define feed-site-url "https://thelocalyarn.com")
|
| ︙ | ︙ |