This is my little code for Zotero integration.
Certainly not perfect, but it works.
Speaking of which, it’s not perfect: in the callout of the images there is a distance between the headline and the actual image (it just looks better with text). Maybe someone can give me a hint for improvement.
---
created: 2025-01-17 18:44
updated: 2025-01-17 18:44
title: "{{title | escape}}"
authors: {% if authors %} {% for author in authors.split(', ') %}
- "[[{{ author }}]]" {% endfor %} {% endif %}
editors: {% if editors %} {% for editor in editors.split(', ') %}
- "[[{{ editor }}]]" {% endfor %} {% endif %}
seriesEditors: {% if seriesEditors %} {% for seriesEditor in seriesEditors.split(', ') %}
- "[[{{ seriesEditor }}]]" {% endfor %} {% endif %}
translators: {% if translators %} {% for translator in translators.split(', ') %}
- "[[{{ translator }}]]" {% endfor %} {% endif %}
contributors: {% if contributors %} {% for contributor in contributors.split(', ') %}
- "[[{{ contributor }}]]" {% endfor %} {% endif %}
publisher: {% if publisher %} "[[{{publisher | escape}}]]" {% endif %}
year: {{date | format("YYYY")}}
aliases: {% if shortTitle %}
- {{shortTitle | escape}} {% endif %}
up:
related: {% for relation in relations %}
- "[[{{ relation.citekey }}|{{ relation.title }}]]" {% endfor %}
tags:
- "#type/margin-note"
- "#type/margin-note/{{itemType}}" {% if allTags %} {% for tag in allTags.split(', ') %}
- "#on/{{ tag }}" {% endfor %} {% endif %}
summary: "{{abstractNote}}"
---
# {{title}}
##### {{authors}} ({{date | format("YYYY")}})
Zotero PDF Link: {{pdfZoteroLink}}
>[!abstract]- Abstract
>{{abstractNote}}
## Beständige Notizen
{% persist "notes" %} {% if isFirstImport %}
_Write notes here!_
{% endif %} {% endpersist %}
## Anmerkungen im Text
{% for annotation in annotations -%}
{% if annotation.annotatedText %}
> [!cite] Zitat
> <mark class="hltr-{{ annotation.colorCategory | lower }}">{{ annotation.annotatedText | safe }}</mark> {% elif annotation.imagePath %}
> [!cite] Bild
>  {% endif %}
> [Seite {{ annotation.pageLabel }}](zotero://open-pdf/library/items/{{ annotation.attachment.itemKey }}?page={{ annotation.pageLabel }}&annotation={{ annotation.id }})
>
> {% if annotation.allTags %} {% set tags = annotation.allTags.split(', ') %} {% for tag in tags %} #on/{{ tag }} {% endfor %}
> {% endif %}
> {% if annotation.comment %}
> > [!note] Anmerkung
> > {{ annotation.comment | safe }}
> {% endif %}
^{{ annotation.id }}
{% endfor %}
Best regards
Feedback