本页有简体中文版。

阅读中文版
ZotLit

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:

  1. Rename each zt- template file to zotlit-; zt-annots.eta.md becomes zotlit-content.eta.md.
  2. In the templates, replace it. with zt..
  3. Turn on JavaScript templates on each device.
  4. 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

  1. Rename the files in your template folder:

    v1 fileRename to
    zt-note.eta.mdzotlit-note.eta.md
    zt-annots.eta.mdzotlit-content.eta.md
    zt-annot.eta.mdzotlit-annotation.eta.md
    zt-cite*.eta.md (two citation files)same zt- → zotlit- rename

    ZotLit loads and renders them under these names once step 4 is done. Renaming files changes nothing in your Zotero library.

  2. Delete two files if you have them in your folder: zt-field.eta.md (properties now live in the profile) and zt-colored.eta.md (colour styling is now handled automatically during note import).

  3. Replace it. with zt. inside template tags, such as it.title → zt.title and it.creators → zt.creators. Leave comment, tags, collections, date, and notes for step 5.

  4. 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.

  5. Fix the fields that changed. The common ones:

    v1v2
    it.citekeyzt.citationKey (zt.citekey also works)
    it.date used as a yearzt.date?.year
    it.abstractNotezt.abstract (zt.abstractNote also works)
    it.textExcerptzt.text
    it.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.

  6. 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.

If you see something else

  • Your notes look like the v2 defaults, not your templates → The files still start with zt-; v2 reads only zotlit- 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.date printed only a year in v1; write zt.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

Last updated on

On this page