file is a name inside dir. The default for dir is quartz/static/snippets, counted from
the root of the site:
options:
dir: quartz/static/snippets # default
file: snippet.html # -> darinSubfolders are allowed: file: header/mark.html reads
quartz/static/snippets/header/mark.html.
The line
A path leading out of dir is refused — the box outputs nothing and the build warns once:
options:
file: ../../../etc/passwd # refusedWhat is checked is not the string but the resolved path. A .. in the middle of the name helps as
little as a link pointing out of the folder.
Why a line at all
The configuration of a Quartz site gets passed around — as a template package, as a repository, as an example in a forum. A
fileallowed to read any path on the machine would turn a shared entry into a tool for reading other people’s files. The line costs nothing and rules that out.
Why quartz/static/
The folder belongs to the site, not to the content. That is deliberate: a snippet is design, and design has no business in the vault — otherwise it shows up in the explorer, in the search and in the graph.
Everything under quartz/static/ is shipped by Quartz anyway. Which also means: the snippet files
themselves are reachable through the site’s address. For markup that appears on every page anyway
that is of no consequence — but it is not a place for anything meant to stay private.