yarle
yarle copied to clipboard
Tag handling in templates
This is, I think, more of an enhancement than an issue. But tag handling in templates needs to be improved for true compatibility with Obsidian.
The problem is that Obsidian accepts tags in two forms
-
in the body of the note, when they are prefixed with "#" and there is no space immediately following. Yarle handles that case fine
-
in the metadata block. That has to be right at the top of the note, and delimited with
---
above and below. Inside that block you can have an entry forTags:
followed either by a comma-delimited list inside square brackets or a markdown-style list where each successive tag is on a new, indented line, starting with-
see the reference here
The default template in v.4.0 ignores this convention and puts the title above a triple-dashed section, which Obsidian won't recognise as a proper metadata block. That should be fixed.
But it would also be helpful if multiple tags could be output separated either by commas or by indented dashes. That's easy enough to fix after the fact but it would be classy if Yarle could do it for me :-)
Tag formatting would be a nice feature, but there is workaround for anyone running into a problem with tags in front-matter. Obsidian does recognize multi-line YAML syntax. You can output your tags like so in your template and still use hashtag syntax:
---
{tags-block}tags: >
{tags}{end-tags-block}
---
Note that it is important to use the correct YAML format of 2 (and only 2) spaces before the {tags}
on the second line, otherwise Obsidian won't recognize them.
Hi all, @seatrout , @montemartin , Thanks for raising this up, I'll try to implement/fix it asap.
Hello there. Thanks for all the hard work @akosbalasko. I'm wondering if there has been any progress on the tag handling in the front matter? According to the documents linked below, while obsidian will recognize tags in front matter that are listed as such:
tags: one, two, three
it is recommended to use the standard front matter syntax for maximum compatibility with other tools. Two forms are recommended:
tags: [one, two, three]
and
tags:
- one
- two
- three
https://github.com/arnau/obsidian-metatable/blob/main/docs/sections/tags.md
hi @TrustTepee , I'm sorry, but still had no time to implement it. But I'll do it around this weekend. Thank you, and sorry for the long delay.
Fantastic. Thank you for making this tool. I spent a full day trying different options and yours is the only one that works properly!
Hi @TrustTepee , I released the solution, you need to add tags-arrays block in your template, I detailed it here: https://github.com/akosbalasko/yarle/blob/master/Templates.md#example-tags-array-template And set useHashTags config parameter to 'false' in order to prevent adding hashmarks before the tags.
I close this ticket, but don't hesitate to create a new issue if something still doesn't work.
Thank you!