Skip to content

Instantly share code, notes, and snippets.

@cutterkom
Created November 7, 2022 13:20
Show Gist options
  • Save cutterkom/30d65436c82473f37d6f82bcbdb2118f to your computer and use it in GitHub Desktop.
Save cutterkom/30d65436c82473f37d6f82bcbdb2118f to your computer and use it in GitHub Desktop.
Obsidian Hypothes.is Export Template
{% if is_new_article %}
# {{title}} - hypothes.is
## Metadata
{% if author %}{{author}}{% endif %}, {{title}}, {% if url %}{{url}}{% endif %}
{% endif %}
{%- if is_new_article %}
{% if page_notes|length %}
## Page Notes
{% for highlight in page_notes -%}
{{highlight.annotation}}
{%- if highlight.tags | length %}
Tags: {% for tag in highlight.tags -%} #{{tag | replace(" ", "-")+" "}}{%- endfor %}
{% endif %}
{% endfor %}
{%- endif -%}
{% endif %}
{%- if is_new_article -%}
## Highlights
{% for highlight in highlights -%}
{{highlight.text}} — [Updated on {{highlight.updated}}]({{highlight.incontext}})
{% if highlight.tags | length %} - Tags: {% for tag in highlight.tags %} #{{tag | replace(" ", "-")+" "}}{% endfor %}
{% endif -%}
{% if highlight.annotation %} - Annotation: {{highlight.annotation}}{% endif %}
{% endfor %}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment