Default templates
The built-in Liquid template for each type, with annotations explaining what each line produces.
ZotLit ships a built-in Liquid default for every template type. These are embedded in the plugin and used when no ejected file exists in the template folder. This page shows each default verbatim and explains what it renders.
Ejected files in the template folder override these defaults. See Customize a template to create one.
Note template
Filename: zotlit-note.liquid.md
# {{ zt.title }}
[Zotero]({{ zt.backlink }}) {{ zt.attachments | map: "fileLink" | compact | join: " " }}
{% render "content" with zt as zt %}| Line | What it renders |
|---|---|
# {{ zt.title }} | Item title as an H1 heading. |
[Zotero]({{ zt.backlink }}) | Markdown link to the item in Zotero (deep link). |
{{ zt.attachments | map: "fileLink" | compact | join: " " }} | Wiki-links to every resolvable attachment. map extracts each attachment's file link, compact drops attachments without a link, join separates them with a space. |
{% render "content" with zt as zt %} | Includes the content template, passing the full item context. |
Content template
Filename: zotlit-content.liquid.md
{% if zt.notes.size > 0 %}
## Notes
{% for note in zt.notes -%}
- {{ note.noteLink }}
{% endfor %}
{% endif %}
{% if zt.annotations.size > 0 %}
## Annotations
{% for annotation in zt.annotations %}
{% render "annotation" with annotation as zt %}
{% endfor %}
{% endif %}The content template is the one whose rendered output is wrapped in managed-region markers. Running ZotLit: Update literature note re-renders this section while leaving the rest of the note body untouched.
| Section | What it renders |
|---|---|
| Notes | A bulleted list of linked child notes. Each note.noteLink resolves to an Obsidian wiki-link pointing at the imported note file. |
| Annotations | Each annotation rendered via the annotation template (see below). |
Both sections appear only when the corresponding array is non-empty.
Annotation template
Filename: zotlit-annotation.liquid.md
{% bq %}
[!note] Page {{ zt.pageLabel }}
{{ zt.imgLink | embed }}{{ zt.text }}
{% if zt.comment %}
{{ zt.comment }}
{% endif %}
{% endbq %}Rendered output for an annotation on page 42 with an image excerpt, highlighted text, and a comment:
> [!note] Page 42
>
> ![[excerpt.png]]The highlighted passage
>
> My thoughts on this| Element | Source |
|---|---|
| Callout type | [!note]: an Obsidian callout. Change note to quote, info, or any supported type to restyle. |
| Page label | {{ zt.pageLabel }} in the callout title. |
| Image | {{ zt.imgLink | embed }}: the embed filter prefixes ! for an Obsidian embed. Collapses to "" for non-image annotations. |
| Text | {{ zt.text }}: the highlighted passage. |
| Comment | {{ zt.comment }}: the user's marginal note, rendered only when present. |
The {% bq %} / {% endbq %} block tag handles the > prefix on every line and collapses consecutive blank lines into a single bare >.
Citation template
Filename: zotlit-cite.liquid.md
[{% liquid
assign cites = "" | split: ","
for c in zt.citations
if c.item.citationKey
if c.suppressAuthor
assign cite = "-@" | append: c.item.citationKey
else
assign cite = "@" | append: c.item.citationKey
endif
if c.locator
assign cite = cite | append: ", " | append: c.labelShort | append: " " | append: c.locator
endif
assign cites = cites | push: cite
endif
endfor
echo cites | join: "; "
%}]Produces Pandoc-style citations: [@smith2024, p. 62; -@doe2021].
| Behavior | Detail |
|---|---|
| Suppress-author | c.suppressAuthor true renders -@key instead of @key. |
| Locator | When c.locator is present, appends , <labelShort> <locator> (e.g. , p. 62). |
| Missing citation key | Items without c.item.citationKey are skipped entirely. |
| Brackets | The outer [ and ] wrap the joined citations. |
Alternate citation template
Filename: zotlit-cite2.liquid.md
{% liquid
assign cites = "" | split: ","
for c in zt.citations
if c.item.citationKey
if c.suppressAuthor
assign cite = "-@" | append: c.item.citationKey
else
assign cite = "@" | append: c.item.citationKey
endif
if c.locator
assign cite = cite | append: ", " | append: c.labelShort | append: " " | append: c.locator
endif
assign cites = cites | push: cite
endif
endfor
echo cites | join: "; "
%}The body is identical to the citation template without the surrounding [ ] brackets. cite2 produces the same citation string without enclosing brackets, for use inside existing bracket syntax.
Filename template
Filename: zotlit-filename.liquid.md
{{ zt.citationKey | default: zt.DOI | default: zt.title | default: zt.key }}{% suffix %}| Element | Detail |
|---|---|
| Fallback chain | citationKey > DOI > title > key. The default filter skips nil and empty values. |
{% suffix %} | Appends a short random string only when the rendered filename collides with an existing note. Absent a collision, it resolves to "". |
| Single line | The rendered output is collapsed to a single trimmed line (all newlines and surrounding whitespace removed). |
| Extension | The .md extension is appended automatically; the template produces only the base name. |
Subfolders in filenames
Include a forward slash (/) in the rendered filename to route the note into
a subfolder under the literature note folder.
Live recompilation
Editing a template file in your vault triggers live recompilation via a file watcher. Changes take effect immediately without reloading the plugin. Deleting an ejected file restores that template to the built-in default shown above.
See also
Template syntax
Liquid markup, filters, and ZotLit's custom tags.
Data reference
Properties available on zt for each template type.
How templates work
Template types, languages, and the defaults-plus-eject model.
Customize a template
Eject, edit, and test a template.
Customize your annotations
Tutorial lesson 2: change how annotations render.