Index: code-docs/dust.scrbl ================================================================== --- code-docs/dust.scrbl +++ code-docs/dust.scrbl @@ -60,18 +60,18 @@ @tt{.html} targets of the source documents. @defproc[(here-output-path) path?] Returns the path to the current output file, relative to @racket[current-project-root]. If no metas -are available, raises an error. This is like what you can get from the @tt{here} variable that Pollen -provides, except it is available outside templates. +are available, returns @racket[(string->path ".")]. This is like what you can get from the @tt{here} +variable that Pollen provides, except it is available outside templates. @defproc[(here-id [suffix (or/c (listof string?) string? #f) #f]) string?] Returns the 8-character prefix of the SHA1 hash of the current document’s output path. If no metas -are available, raises an error. If @racket[_suffix] evaluates to a string or a list of strings, they -are appended verbatim to the end of the hash. +are available, the hash of @racket[(string->path ".")] is used. If @racket[_suffix] evaluates to +a string or a list of strings, they are appended verbatim to the end of the hash. This ID is used when creating URL fragment links within an article, such as for footnotes and index entries. As long as the web version of the article is not moved to a new URL, the ID will remain the same, which ensures deep links using the ID don’t break. The ID also ensures each article’s internal links will be unique, so that links do not collide when multiple articles are being shown on Index: dust.rkt ================================================================== --- dust.rkt +++ dust.rkt @@ -63,11 +63,11 @@ (cond [(current-metas) (define-values (_ rel-path-parts) (drop-common-prefix (explode-path (current-project-root)) (explode-path (string->path (select-from-metas 'here-path (current-metas)))))) (->output-path (apply build-path rel-path-parts))] - [else (error "No metas are available")])) + [else (string->path ".")])) ;; Checks current-metas for a 'series meta and returns the pagenode of that series, ;; or '|| if no series is specified. (define (series-pagenode) (define maybe-series (or (select-from-metas 'series (current-metas)) ""))