Template Environment API

Template Environment

The template environment contains functions that are available from inside templates.

Index

dom-find find-section find-tag relative-url static-file

Reference

dom-findfunction
mendoza/template-env.janet at line 23, column 1
(dom-find pred root)

Find the first element in a depth first traversal of the DOM that satisfies a given predicate.

find-sectionfunction
mendoza/template-env.janet at line 44, column 1
(find-section name root)

Find a given section name to insert into the document.

find-tagfunction
mendoza/template-env.janet at line 35, column 1
(find-tag tag root)

Find the first instance of a given tag

relative-urlfunction
mendoza/template-env.janet at line 55, column 1
(relative-url url)

Express a url relative to (dyn :url). The given url should be absolute from the site root, like /index.html.

static-filefunction
mendoza/template-env.janet at line 49, column 1
(static-file src &opt dest)

Make sure a static file is available in the generated site