Overview
Comment: | Allow here-output-path even when no metas are available |
---|---|
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
bd48c56a0502cf339932d7f33da50b2a |
User & Date: | joel on 2019-07-05 03:27:59 |
Other Links: | manifest | tags |
Context
2019-07-10
| ||
01:29 | Make parallel processing in Pollen setup explicit check-in: 7d4de0ec user: joel tags: trunk | |
2019-07-05
| ||
03:27 | Allow here-output-path even when no metas are available check-in: bd48c56a user: joel tags: trunk | |
2019-07-04
| ||
18:19 | Add close-head? to page header function check-in: 5fc9abc0 user: joel tags: trunk | |
Changes
Modified code-docs/dust.scrbl from [aa4ce70b] to [d5eab31d].
58 58 document contained in @racket[articles-folder], and @racket[series-pagetree] contains a pagenode for 59 59 every Pollen document in @racket[series-folder]. The pagenodes themselves point to the rendered 60 60 @tt{.html} targets of the source documents. 61 61 62 62 @defproc[(here-output-path) path?] 63 63 64 64 Returns the path to the current output file, relative to @racket[current-project-root]. If no metas 65 -are available, raises an error. This is like what you can get from the @tt{here} variable that Pollen 66 -provides, except it is available outside templates. 65 +are available, returns @racket[(string->path ".")]. This is like what you can get from the @tt{here} 66 +variable that Pollen provides, except it is available outside templates. 67 67 68 68 @defproc[(here-id [suffix (or/c (listof string?) string? #f) #f]) string?] 69 69 70 70 Returns the 8-character prefix of the SHA1 hash of the current document’s output path. If no metas 71 -are available, raises an error. If @racket[_suffix] evaluates to a string or a list of strings, they 72 -are appended verbatim to the end of the hash. 71 +are available, the hash of @racket[(string->path ".")] is used. If @racket[_suffix] evaluates to 72 +a string or a list of strings, they are appended verbatim to the end of the hash. 73 73 74 74 This ID is used when creating URL fragment links within an article, such as for footnotes and index 75 75 entries. As long as the web version of the article is not moved to a new URL, the ID will remain the 76 76 same, which ensures deep links using the ID don’t break. The ID also ensures each article’s internal 77 77 links will be unique, so that links do not collide when multiple articles are being shown on 78 78 a single HTML page. 79 79
Modified dust.rkt from [30ceaf46] to [4209ef85].
61 61 ;; except this is an actual path, not a string. 62 62 (define (here-output-path) 63 63 (cond [(current-metas) 64 64 (define-values (_ rel-path-parts) 65 65 (drop-common-prefix (explode-path (current-project-root)) 66 66 (explode-path (string->path (select-from-metas 'here-path (current-metas)))))) 67 67 (->output-path (apply build-path rel-path-parts))] 68 - [else (error "No metas are available")])) 68 + [else (string->path ".")])) 69 69 70 70 ;; Checks current-metas for a 'series meta and returns the pagenode of that series, 71 71 ;; or '|| if no series is specified. 72 72 (define (series-pagenode) 73 73 (define maybe-series (or (select-from-metas 'series (current-metas)) "")) 74 74 (cond 75 75 [(non-empty-string? maybe-series)