Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lguenth/e8a5c4fa0b4a1ed6f8bd0b9ccfc31013 to your computer and use it in GitHub Desktop.
Save lguenth/e8a5c4fa0b4a1ed6f8bd0b9ccfc31013 to your computer and use it in GitHub Desktop.
Zotero Integration Templates
created modified
{"importDate|format(\"YYYY-MM-DD\")"=>nil}
{"importDate|format(\"YYYY-MM-DD\")"=>nil}

{{shortTitle|replace(":", " –")}}

Quelle: [[@{{citekey}}]]

{% if annotations.length > 0 -%} Hinzugefügt am [[{{importDate | format("YYYY-MM")}}#{{importDate | format("YYYY-MM-DD")}}]] {% for annotation in annotations %}{% if annotation.annotatedText %}

{{annotation.annotatedText}} (p. {{annotation.page}}) {% elif annotation.imageRelativePath %} ![[{{annotation.imageRelativePath}}]] {%- endif %} {% if annotation.comment %}- [b] {{annotation.comment}} {% endif %}{% endfor %}{% endif -%}

<%* // This uses Templater and some JavaScript to replace escaped frontmatter and wikilinks because I hate seeing them in the Quick Switcher let content = ` --- created: {{importDate|format("YYYY-MM-DD")}} modified: {{importDate|format("YYYY-MM-DD")}} ---

## {{shortTitle|replace(":", " –")}} Quelle: [[@{{citekey}}]]

{% if annotations.length > 0 -%} Hinzugefügt am [[{{importDate | format("YYYY-MM")}}#{{importDate | format("YYYY-MM-DD")}}]] {% for annotation in annotations %}{% if annotation.annotatedText %}

{{annotation.annotatedText}} ([p. {{annotation.page}}](zotero://open-pdf/library/items/{{annotation.attachment.itemKey}}?page={{annotation.page}}&annotation={{annotation.id}})) {% elif annotation.imageRelativePath %} ![[{{annotation.imageRelativePath}}]] {%- endif %} {% if annotation.comment %}- [b] {{annotation.comment}} {% endif %}{% endfor %}{% endif -%}`

const replaced = content.replace(/\/g, "") tR += replaced; -%>

<% "---" %> tags: {% if itemType == "book" %}📥/📚{% else %}📥/📑{% endif %} alias: "{{title}}" status: in-progress created: {{importDate|format("YYYY-MM-DD")}} modified: {{importDate|format("YYYY-MM-DD")}} <% "---" %>

Zusammenfassung:: Motivation:: Ergebnisse::

Projekte:: Keywords::



[!todo]+

[!meta]+ Metadaten

  • Highlights:: [[Highlights zu {{citekey}}]] {%- for attachment in attachments | filterby("path", "endswith", ".pdf") %}
  • Anhang:: PDF öffnen}}) {% if loop.last %} {% endif %}{%- endfor %}
  • Zotero:: Eintrag öffnen
  • Gelesen am::
@lguenth
Copy link
Author

lguenth commented Apr 20, 2023

If anyone comes across this, the fix for the author section was indeed necessary. I had fixed it locally and forgot to update. Authors are not included in the current version of this template but if you want to include them, use the fix above or a similar solution from this thread: https://forum.obsidian.md/t/zotero-integration-import-templates/36310

@nhan000
Copy link

nhan000 commented Aug 6, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment