change resource id schema to type/headline

This commit is contained in:
sorrel 2024-02-25 20:15:24 -05:00
parent 2e134c7644
commit b64d7d47e0

View file

@ -88,10 +88,8 @@
".scm")) ".scm"))
(error "'root resource requires headline"))) (error "'root resource requires headline")))
(define (make-res-file-handle x r id) (define (make-res-file-handle x r id)
(if (< 0 id) (path->string (path-add-extension (build-path (if x "publish-test/source" "source") r (~a id))
(path->string (path-add-extension (build-path (if x "publish-test/source" "source") r (~a id)) ".scm")))
".scm"))
(error "~a resource requires r-id" r)))
(if (equal? r-type "root") (if (equal? r-type "root")
(make-root-file-handle x-test l-headline) (make-root-file-handle x-test l-headline)
(make-res-file-handle x-test r-type r-id))) (make-res-file-handle x-test r-type r-id)))
@ -144,8 +142,8 @@
[resources (make-weak-hash)] [resources (make-weak-hash)]
[posts (map (lambda (lookup/id) [posts (map (lambda (lookup/id)
(if (hash-has-key? post-lookup lookup/id) (if (hash-has-key? post-lookup lookup/id)
(append (list lookup/id) (rest (hash-ref post-lookup lookup/id))) (hash-ref post-lookup lookup/id)
(append (list lookup/id) (rest (get-post-data lookup/id resources post-lookup x))))) (get-post-data lookup/id resources post-lookup x)))
(filter non-empty-string? (rest tag-table-row)))] (filter non-empty-string? (rest tag-table-row)))]
[make-index (read (open-input-file "source/make-index.scm"))] [make-index (read (open-input-file "source/make-index.scm"))]
[new-index ((eval make-index ns) (~a "tagged/" tag) posts)] [new-index ((eval make-index ns) (~a "tagged/" tag) posts)]
@ -225,9 +223,7 @@
(build-path "data" r)) (build-path "data" r))
#".csv")))) #".csv"))))
(define res-id (if (equal? r "root") (define res-id (string-replace l " " "-"))
(string-replace l " " "-")
(length res-table)))
;; before anything else, open output file ;; before anything else, open output file
;; doing this means that if a file exists of the intended ;; doing this means that if a file exists of the intended
(define out (define out