Skip to content

Commit 6d4f964

Browse files
authored
Add tag rendering template to Query Templates (#1517)
1 parent a4df713 commit 6d4f964

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Library/Std/Query Templates.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ templates.itemItem = template.new([==[
2727
templates.paragraphItem = template.new([==[
2828
* [[${ref}]] ${text}
2929
]==])
30+
31+
-- Renders a tag object
32+
templates.tagItem = template.new([==[
33+
* [[tag:${name}|#${name}]]
34+
]==])
3035
```
3136

3237

@@ -45,3 +50,10 @@ ${template.each(query[[from index.tag "task" where page == _CTX.currentPage.name
4550
* Item 2
4651

4752
${template.each(query[[from index.tag "item" where page == _CTX.currentPage.name]], templates.itemItem)}
53+
54+
`template.tagItem`:
55+
* #tag1
56+
* #tag2
57+
* #tag3
58+
59+
${template.each(query[[from index.tag "tag" where page == _CTX.currentPage.name]], templates.tagItem)}

0 commit comments

Comments
 (0)