Zotero Template with Ordered Persistent notes

Things I have tried

Here is my current section for exporting annotations from Zotero and importing them into Obsidian. It works fine and pulls in all annotations in the correct order

Exported: {{exportDate | format(“YYYY-MM-DD h:mm a”)}}

{% for a in annotations %}
{% if a.annotatedText %}

Highlight Category: {{a.colorCategory}}
Page: {{a.page}}
{% endif %}
{% if a.comment %}
{% endif %}
{% endfor %}

What I’m trying to do

I wondered how I could amend the code to do the following:

  • Make annotations persistent so I can write notes in between each annotation that are retained every time I recreate the file
  • Importantly, when the file is recreated any new annotations that imported to the file are put in ascending page order. Currently, if I wrap the annotations with {% persist “annotations” %} {% endpersist %} the new annotations are always put at the end of the list and are therefore not in page order
  • When new annotations are added they should be appended to the existing list, not put into a separate lists of new annotations under a new import date

You may want to share this post in the #academia channel of Obsidian’s Discord.

thanks will do