Open maciejmatczak opened 2 years ago
try to create your template like this instead (inside any page, like [[templates]] for instance):
- tags:: test
keyword:: test
template:: frontmatter
then invoke it in the first block of a new page
or this if you need the # note section
- template
template:: frontmatter2
template-including-parent:: false
- tags:: test
keyword:: test
- # note
the resulting page should work (the query on
page-tags
shows it picked up the properties as page-properties
update: actually this is not working , see later comments
@cannibalox, did you try to replicate my issue?
I added your proposed template, it does differ a bit, but it's structure doesn't have an influence over my issue. Pasted on the bottom of my templates container:
And used it, same problem persists:
Are you sure you didn't actually "enter through" (move cursor to the incorrect frontmatter, hit enter while on the last property, proceed to hitting enter)? This should actually make Logseq understood you edited frontmatter, which fires some additional markdown cleanup, frontmatter no longer is under a bullet point:
actually you're right, I should have double checked it sry for the trouble. updating the previous comment
I confirm this is still unsolved as of Logseq 0.10.9. It would be great to see YAML Frontmatter in templates supported, for 'backwards' compatibility with other markdown tools like Zettlr etc.
Describe the bug
I am using template to fill new empty page,
template-include-parent: false
guarantees me that everything is placed on a root level on a page. I do want to fill the new page's frontmatter as well, so I do have one as a children for the template.After using the template it is placed as any other block, though. Looks like it's not possible to use template to generate new page's frontmatter if
template-include-parent: false
is used.To Reproduce
Create such template:
Then, create new page and use
/Template
, picktesttemplate
, you get:Expected behavior
While not explicit and obvious, I believe an additional action "check if first block is not frontmatter" should be performed (I believe such step happens if we type in frontmatter manually):
I can workaround it moderately easy with going back to the formatter, pretend I edit it, ESC.
Desktop (please complete the following information):