@@ -56,10 +56,22 @@ @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. + +@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. + +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 +a single HTML page. @section{Metas and @code{txexpr}s} @defproc[(maybe-attr [key symbol?] [attrs txexpr-attrs?] [missing-expr any/c ""]) any/c]