What I’m trying to do
I have the following template in Obsidian which I use along with the Zotero Integration plugin. There is a YAML preamble to format the paper metadata, followed by two sections where I take notes directly in Obsidian, followed by a section for highlighted text and pictures imported from Zotero. The “Main points” and “Notes” sections are persistent, so that if I take some notes and then re-import, and I don’t lose the notes. I would like to do the same for any tags I have applied to this note in the YAML section (i.e. the last line in the YAML block), but I don’t know how to make the persist blocks work within YAML. Any ideas?
Things I have tried
I tried just naively adding the same kind of persist block I am already using directly within the YAML, but that causes errors since the YAML section is parsed differently than the markdown.
Actual template
title: “{{title}}”
authors: “{{authors}}”
date: ‘{{date | format (“YYYY-MM-DD”)}}’
publication: “{{publicationTitle}}”
doi: “{{DOI}}”
url: “{{url}}”
tags:
Zotero: {{pdfZoteroLink}}
{{abstractNote}}
Main points
{% persist “main points” %}
{% endpersist %}
Notes
{% persist “notes” %}
{% endpersist %}
Figures & Annotations
{% for annotation in annotations -%}
{%- if annotation.annotatedText -%}
> {{annotation.annotatedText | escape}} Page {{annotation.page}}
{%- if annotation.comment %}
- {{annotation.comment}}
{%- endif %}
{{- “\n” -}}
{%- endif %}
{%- if annotation.imageRelativePath -%}
![[{{annotation.imageRelativePath}}]]
{{- “\n” -}}
{%- endif %}
{% endfor %}