Upgrade v1 Eta templates to ZotLit v2
Rename custom v1 Eta templates, update their variables for v2, and turn on JavaScript templates, or convert the templates to Liquid instead.
If you never changed the v1 templates, do nothing: v2 ships new defaults. Otherwise:
- Rename each
zt-template file tozotlit-;zt-annots.eta.mdbecomeszotlit-content.eta.md. - In the templates, replace
it.withzt.. - Turn on JavaScript templates on each device.
- Fix the few fields that changed, then run ZotLit: Overwrite literature note on old notes when you are ready.
Bring your Eta templates to v2
-
Rename the files in your template folder:
v1 file Rename to zt-note.eta.mdzotlit-note.eta.mdzt-annots.eta.mdzotlit-content.eta.mdzt-annot.eta.mdzotlit-annotation.eta.mdzt-cite*.eta.md(two citation files)same zt-→zotlit-renameZotLit loads and renders them under these names once step 4 is done. Renaming files changes nothing in your Zotero library.
-
Delete two files if you have them in your folder:
zt-field.eta.md(properties now live in the profile) andzt-colored.eta.md(colour styling is now handled automatically during note import). -
Replace
it.withzt.inside template tags, such asit.title→zt.titleandit.creators→zt.creators. Leavecomment,tags,collections,date, andnotesfor step 5. -
Turn on JavaScript templates. Open Settings > ZotLit > Advanced. In the Template engine group, on the JavaScript templates row, select Turn on. In the Enable JavaScript templates? dialog, select Enable. ZotLit recompiles the templates at once. This setting is per device; turn it on on each computer you use.
-
Fix the fields that changed. The common ones:
v1 v2 it.citekeyzt.citationKey(zt.citekeyalso works)it.dateused as a yearzt.date?.yearit.abstractNotezt.abstract(zt.abstractNotealso works)it.textExcerptzt.textit.commentMdzt.comment<%~ include("annots", it.annotations) %><%~ include("content", zt) %>Tags, collections, and authors are now objects that still print as their name in text, so expressions like
zt.tags.join(", ")keep working. For every other change, see v1 to v2 field changes. -
Rebuild an old note when you are ready. Open the note, run ZotLit: Overwrite literature note, and select Overwrite. ZotLit rebuilds the whole note body from the renamed templates and inserts the managed-region markers (
%%zt-managed%%…%%/zt-managed%%). After that, ZotLit: Update literature note refreshes the note. Notes you have not overwritten keep their body while their properties refresh.
| Choice | What it takes | Gate needed |
|---|---|---|
| Keep Eta | The steps above | JavaScript templates on, on each device |
| Convert to Liquid | Rewrite each template in Liquid, v2's default language (Eta to Liquid reference) | None |
Liquid templates can only combine data into text. Eta can run any JavaScript, which is why it requires the gate.
The renamed files work as they are, so this step is optional. ZotLit offers to fold them into v2's template documents in one pass, either from the setup banner above the Library View (Convert your literature note templates) or from the reminder row at the top of settings with Review conversion. It checks the output before it writes anything. Migrate from 2.1 templates covers what the conversion pass does and refuses.
Open Settings > ZotLit, select Edit profile on the Templates and properties row, and open the Properties tab. For each field, select Add a property and fill in Property name, Value format (Zotero field · Liquid, Fixed text, or Rule · JSON-e), Value, and When the note is updated:
| v1 line | Property name | Value | When the note is updated |
|---|---|---|---|
title: "<%= it.title %>" | title | zt.title | Replace the existing value |
year: "<%= it.date %>" | year | zt.date | date: "%Y" | Replace the existing value |
tags: ... | tags | zt.tags | map: "name" | join: ", " | Add to the existing list |
YAML escaping is handled automatically. For details on property rules, see Property entries and merge rules.
If you see something else
- Your notes look like the v2 defaults, not your templates → The files still start with
zt-; v2 reads onlyzotlit-files. Rename them (step 1). - "The Eta template at … is inactive because JavaScript templates are disabled on this device." → Turn on JavaScript templates on this device (step 4).
- "These frontmatter fields are inactive because JavaScript templates are disabled: …" → Turn on JavaScript templates on this device (step 4).
- Extra blank lines in the note → v1 trimmed one newline after each
%>; v2 keeps all whitespace. Write-%>where you want the old trim behavior. - A year shows as a full date →
it.dateprinted only a year in v1; writezt.date?.year. - Properties updated. This note has no managed region, so its body stayed unchanged. after ZotLit: Update literature note on a v1 note → v1 notes lack managed-region markers. Run ZotLit: Overwrite literature note on the note (step 6).
- Your files are named like
zotlit-note.liquid.md→ Those are 2.1 templates. Follow Migrate from 2.1 templates.
Next
- Refresh v1 notes — The full procedure for rebuilding old notes.
- Migrate from 2.1 templates — What the one-pass conversion does.
- Enable JavaScript templates — What the gate allows and how to turn it off.
Last updated on