Skip to content

Instantly share code, notes, and snippets.

@0atman
Last active January 20, 2026 15:57
Show Gist options
  • Select an option

  • Save 0atman/29daa5676a39388006e6c2e73e60f479 to your computer and use it in GitHub Desktop.

Select an option

Save 0atman/29daa5676a39388006e6c2e73e60f479 to your computer and use it in GitHub Desktop.

File Name

{{title|replace(',','_')|replace(':','_')|replace('/','_')|replace('\n','_')}}

Page Metadata

{% raw %}
> [!IMPORTANT] Next highlight
> ```tasks
> not done
> 
> path includes {{query.file.path}}
> 
> hide scheduled date
> hide edit button
> hide backlink
> hide postpone button
> LIMIT 1
> ```
{% endraw %}


{% if image_url -%}
![rw-book-cover]({{image_url}})

{% endif -%}

Highlights Header

{% if is_new_page %}
## Highlights
{% elif has_new_highlights -%}
## New highlights added {{date|date('F j, Y')}} at {{time}}
{% endif -%}

Highlights

#### {{ highlight_text | replace('\n', ' ') | truncate(200,false,'') }}
 - [ ] {{ highlight_text }}{% if highlight_location and highlight_location_url %}
 - [{{highlight_location}}]({{highlight_location_url}}){% elif highlight_location %}
 - {{highlight_location}}{% endif %}{% if highlight_tags %}
 - Tags: {% for tag in highlight_tags %}#readwise/{{tag}} {% endfor %}{% endif %}{% if highlight_note %}
     - My note: {{ highlight_note }}{% endif %}

Yaml front Matter

author: {% if author %}"[[{{author}}]]"{% endif %}
title: "{{full_title}}"
category: {{category}}
highlighted_date: {{last_highlighted_date|date('Y-m-d')}}
published_date: {{published_date|date('Y-m-d')}}
cover_image: {{image_url}}
{% if document_note -%}
document_note: "{{document_note}}"
{% endif -%}

tags: [literature/unfiled {% if document_tags -%},{% for tag in document_tags %}{{tag}}, {% endfor %}{% endif -%}]

up: "[[My Commonplace Book]]"

{% if summary -%}

summary: |
    {{summary|replace('\n','\n ')}}
{% endif -%}
{% if url -%}
url: {{url}}
{% endif -%}
@iarwain-forn
Copy link

If the {{summary}} contains a new line character (as the "Getting Started with Reader" article did) the front matter will be broken because the indentation of the new paragraph puts the text outside the expected indentation of the text block. Updating the template to include a replace fixes the issue: {{summary|replace('\n','\n ')}}

@0atman
Copy link
Author

0atman commented Sep 22, 2025

@iarwain-forn nice, thank you! I've updated it

@night-kat
Copy link

The yaml frontmatter caused some errors for me on specific summaries. I have a "fix" i think. I am just not sure if anyone else has that same problem but i can share it if you want. Sometimes with specific characters, the frontmatter would be red and show an error. But after my change which is very minor, it seems to have fixed that problem

@0atman
Copy link
Author

0atman commented Jan 20, 2026

@night-kat comment the fix, I'll integrate it, thanks!

@night-kat
Copy link

night-kat commented Jan 20, 2026

i have removed 3 spaces from this line: {{summary|replace('\n','\n ')}} The summary needs to be indented by one space to form properly. i have checked all other entries i have with readwise and it broke none of them after deleting them and resyncing. But please try it on your own machine first, i am not sure if this is just my computer being weird.

author: {% if author %}"[[{{author}}]]"{% endif %}
title: "{{full_title}}"
category: {{category}}
highlighted_date: {{last_highlighted_date|date('Y-m-d')}}
published_date: {{published_date|date('Y-m-d')}}
cover_image: {{image_url}}
{% if document_note -%}
document_note: "{{document_note}}"
{% endif -%}

tags: [literature/unfiled {% if document_tags -%},{% for tag in document_tags %}{{tag}}, {% endfor %}{% endif -%}]

up: "[[My Commonplace Book]]"

{% if summary -%}

summary: |
 {{summary|replace('\n','\n ')}}
{% endif -%}
{% if url -%}
url: {{url}}
{% endif -%}

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