Title: Node Headers
+Tags: headers
++-Tags: *

<p>
    <a href="{{node-url:directories/nodes}}">Node files</a> support headers.
    You can define any custom headers you want, and reference them in
    <a href="{{node-url:parameters/value}}">substitution parameters</a>.
</p>

<p>
    The headers listed on this page also have special meanings, and are
    interpreted directly in various ways by Uriel.
</p>

<p>
    Some special headers can be set on any node, while others will only
    take effect if they are set on the
    <a href="{{node-url:directories/nodes}}">root node</a>
    (<i><a href="https://github.com/ratherlargerobot/uriel/blob/main/documentation/nodes/index">index</a></i>).
</p>

<h3>All Nodes</h3>

<p>These headers will take effect on any node.</p>

<table>
    <tr>
        <th>Header</th>
        <th>Default</th>
        <th>Notes</th>
    </tr>
    <tr>
        <td>{{node-link:headers/title}}</td>
        <td>&lt;inferred&gt;</td>
        <td>Page title</td>
    </tr>
    <tr>
        <td>{{node-link:headers/escape-title/index}}</td>
        <td><i>true</i></td>
        <td>HTML escape title</td>
    </tr>
    <tr>
        <td>{{node-link:headers/template}}</td>
        <td><i>default.html</i></td>
        <td>Template file</td>
    </tr>
    <tr>
        <td>{{node-link:headers/format/index}}</td>
        <td><i>html</i></td>
        <td><i>html</i> or <i>text</i></td>
    </tr>
    <tr>
        <td>{{node-link:headers/created}}</td>
        <td></td>
        <td>date -Is / date +%FT%T</td>
    </tr>
    <tr>
        <td>{{node-link:headers/modified}}</td>
        <td>node mtime</td>
        <td>date -Is / date +%FT%T</td>
    </tr>
    <tr>
        <td>{{node-link:headers/breadcrumb-separator}}</td>
        <td><i>&amp;raquo;</i></td>
        <td>Between breadcrumbs</td>
    </tr>
    <tr>
        <td>{{node-link:headers/breadcrumb-separator-spaces/index}}</td>
        <td><i>true</i></td>
        <td>Spaces around separator</td>
    </tr>
    <tr>
        <td>{{node-link:headers/flat-url/index}}</td>
        <td><i>false</i></td>
        <td>Move URL path to top</td>
    </tr>
    <tr>
        <td><a href="{{node-url:headers/link-prefix-link-suffix/index}}">Link-Prefix</a></td>
        <td><i>&lt;p&gt;</i></td>
        <td>For lists of links</td>
    </tr>
    <tr>
        <td><a href="{{node-url:headers/link-prefix-link-suffix/index}}">Link-Suffix</a></td>
        <td><i>&lt;/p&gt;</i></td>
        <td>For lists of links</td>
    </tr>
    <tr>
        <td>{{node-link:headers/tags}}</td>
        <td></td>
        <td>foo, bar, baz, quux</td>
    </tr>
    <tr>
        <td>{{node-link:headers/rss-include/index}}</td>
        <td><i>false</i></td>
        <td>Include node in RSS</td>
    </tr>
    <tr>
        <td>{{node-link:headers/rss-add-node-title-header/index}}</td>
        <td><i>true</i></td>
        <td>Add node title to RSS</td>
    </tr>
    <tr>
        <td>{{node-link:headers/sitemap-include/index}}</td>
        <td><i>true</i></td>
        <td>Include node in sitemap</td>
    </tr>
</table>

<h3>Root Node</h3>

<p>
    These headers will only take effect if they are set on the
    <a href="{{node-url:directories/nodes}}">root node</a>.
</p>

<table>
    <tr>
        <th>Header</th>
        <th>Default</th>
        <th>Notes</th>
    </tr>
    <tr>
        <td>{{node-link:headers/canonical-url}}</td>
        <td></td>
        <td>https://example.com</td>
    </tr>
    <tr>
        <td>{{node-link:headers/tag-node}}</td>
        <td></td>
        <td>tag</td>
    </tr>
    <tr>
        <td>{{node-link:headers/rss-url}}</td>
        <td></td>
        <td>/rss.xml</td>
    </tr>
    <tr>
        <td>{{node-link:headers/rss-description}}</td>
        <td></td>
        <td>Site description</td>
    </tr>
    <tr>
        <td>{{node-link:headers/rss-title}}</td>
        <td>&lt;value of {{node-link:headers/title}}&gt;</td>
        <td>Site name</td>
    </tr>
    <tr>
        <td>{{node-link:headers/rss-image-url}}</td>
        <td></td>
        <td>/rss-icon.png</td>
    </tr>
    <tr>
        <td>{{node-link:headers/rss-image-width}}</td>
        <td></td>
        <td>32</td>
    </tr>
    <tr>
        <td>{{node-link:headers/rss-image-height}}</td>
        <td></td>
        <td>32</td>
    </tr>
    <tr>
        <td>{{node-link:headers/rss-max-entries}}</td>
        <td><i>20</i></td>
        <td>unsigned int</td>
    </tr>
    <tr>
        <td>{{node-link:headers/sitemap-url}}</td>
        <td></td>
        <td>/sitemap.xml</td>
    </tr>
    <tr>
        <td>{{node-link:headers/sitemap-max-entries}}</td>
        <td><i>50000</i></td>
        <td>unsigned int</td>
    </tr>
</table>

<h3>Inheritance</h3>

<p>
    The <a href="{{node-url:directories/nodes}}">content nodes</a> form a tree
    hierarchy, starting with the root node (index). Generally speaking, if a
    header is set on a node, it will be inherited by all downstream child
    nodes by default.
</p>

<p>
    As an exception to this general rule, the following headers are
    specifically not inherited:
</p>

<ul>
    <li>{{node-link:headers/title}}</li>
    <li>{{node-link:headers/created}}</li>
    <li>{{node-link:headers/modified}}</li>
</ul>

<p>To delete an inherited header from the current node:</p>

<p><pre>-Foo: *</pre></p>

<p>To set a header in child nodes, but not the current node:</p>

<p><pre>+Foo: bar</pre></p>

<p>
    To leave a header alone in the current node, but unset it in child nodes:
<p>

<p><pre>+-Foo: *</pre></p>

<p>To set a header in the current node, but unset it in child nodes:</p>

<p><pre>Foo: bar
+-Foo: *</pre></p>

<p>
    Further combinations of + and - can be chained together, but a little bit
    goes a long way.
</p>

<p>
    The general rule is that each + at the beginning of a header name will
    push it down one additional level in the node tree, but the first - at the
    beginning of a header name that gets encountered will remove the header
    from that node.
</p>

{{include:header-parameter-naming-convention.html}}

