Skip to content

Commit 8b28e42

Browse files
authored
Merge pull request #53 from radekkozak/fix-multiple-annotation-template-rendering
Fix multiple annotation template rendering
2 parents b74b184 + 8383d8b commit 8b28e42

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

src/assets/defaultTemplate.njk

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,30 @@
1-
{% if is_new_article %}# {{title}}
1+
{% if is_new_article %}
2+
# {{title}}
23

34
## Metadata
45
{% if author %}- Author: [{{author}}]({{authorUrl}}){% endif %}
56
- Title: {{title}}
67
{% if url %}- Reference: {{url}}{% endif %}
7-
- Category: #article{% endif %}
8+
- Category: #article
9+
{% endif %}
810

9-
{% if is_new_article%}## Page Notes
11+
{%- if is_new_article %}
12+
## Page Notes
1013
{% for highlight in page_notes -%}
1114
{{highlight.annotation}}
12-
{% if highlight.tags | length %} Tags: {% for tag in highlight.tags -%} #{{tag | replace(" ", "-")+" "}}{%- endfor %}{%- endif %}
13-
{%- endfor -%}
15+
{%- if highlight.tags | length %}
16+
Tags: {% for tag in highlight.tags -%} #{{tag | replace(" ", "-")+" "}}{%- endfor %}
1417
{% endif %}
18+
{% endfor %}
19+
{%- endif -%}
1520

16-
{% if is_new_article -%}## Highlights{%- endif %}
17-
{% for highlight in highlights -%}- {{highlight.text}} — [Updated on {{highlight.updated}}]({{highlight.incontext}}) {% if 'Private' != highlight.group %} — Group: #{{highlight.group| replace(" ", "-")}}{%- endif %}
18-
{% if highlight.tags | length %} - Tags: {% for tag in highlight.tags -%} #{{tag | replace(" ", "-")+" "}}{%- endfor %}{%- endif %}
19-
{% if highlight.annotation %} - Annotation: {{highlight.annotation}}{%- endif -%}{%- endfor -%}
21+
{%- if is_new_article -%}
22+
## Highlights
23+
{% for highlight in highlights -%}
24+
- {{highlight.text}} — [Updated on {{highlight.updated}}]({{highlight.incontext}})
25+
{%- if 'Private' != highlight.group %} — Group: #{{highlight.group | replace(" ", "-")}}{% endif %}
26+
{% if highlight.tags | length %} - Tags: {% for tag in highlight.tags %} #{{tag | replace(" ", "-")+" "}}{% endfor %}
27+
{% endif -%}
28+
{% if highlight.annotation %} - Annotation: {{highlight.annotation}}{% endif %}
29+
{% endfor %}
30+
{% endif %}

0 commit comments

Comments
 (0)