Hide "Metadata" when front matter is shown

If I am not mistaken, When we choose to show frontmatter, we display the same batch of information twice:

  1. On top of the page within the “Frontmatter box”
  2. Right below within the “Matedata” box.

I believe it will be a much cleaner display of the note if only one of the existing YAML content is shown.

5 Likes

i totally agree. Are there any fixes to this yet? It would be cool if the “metadata” box (with clickable tags etc) could display while hiding the “frontmatter” box.

You can define a css class in YMF of your file, for example

---
cssclass: HideYMF 
---

And hide it with a css-snippet …

.HideYMF pre.frontmatter {
  display: none;
}
1 Like

thanks! I actually realized the “editor” section in options has a build-it “show frontmatter” toggle for the YAML.

then, if i want to hide the metadata box, i can use a snippet with:

.frontmatter-container {
display: none;
}

…but what would be REALLY cool, is to be able to put the metadata box at the bottom of every note, instead of up top. I’m guessing that’s probably a bad idea lol.

question: i notice your css refers to “pre.frontmatter” and mine is “.frontmatter” …if you have time, could you explain the difference?

I didn’t know, that must be new :slight_smile:

Thanks, I didn’t know that either :slight_smile:

“pre” is a HTML-Element and serves as wrapper for YMF.

“.frontmatter” is a css-class, which is used for the pre-elements which contains the frontmatter.

“pre.frontmatter” is more precise than just “.frontmatter” but in practice there will be no difference because the “.frontmatter” class is only used (I asume) for this specific purpose.

I think it’s possible with CSS. You can place every element wherever you want.

1 Like

Thanks!