The frontmatter YAML now show all field (and it should not)

Hello folks,

Happy Obsidian users since about a month. With the v1.1 release (Obsidian Release v1.1 - Announcements - Obsidian Forum), there is this new behavior:

The frontmatter YAML will now always be hidden in reading mode. The “Show frontmatter” toggle now toggles the metadata section.

Before v1.1

Before the update, only the alias and tags were showing. It was perfect!

After v1.1

But now this is how it looks :

EDIT MODE (all good here)

VEW MODE (see the red rectangle)

All fields from the frontmatter is showing :frowning: I think it’s very ugly in the view mode.


My Suggestion

My suggestion is the let the user choose which field show be displayed in view mode

PREFERENCE PANE

I personally need this to ensure my tags are well organized.

Thank you very much!

In the answer below I show how to show either the tags, and/or aliases, and/or all the rest, it might be a little helpful.

I also comment upon the fact, that currently we don’t have any option to select which of the other fields should or should not show. If that is what you’re after, then you should possible post a feature request (and follow the template for that).

The CSS snippet shown should also be helpful related to doing some more changes if you’re inclined to do so.

Lastly, why do use '#area/map', when it’s enough to do area/map? In most cases, I would think it’s actually wrong to include the quotes and the hashtag when defining a tag in the frontmatter.

Thank you very much @holroy. The CSS solution works perfectly!

About

Lastly, why do use '#area/map' , when it’s enough to do area/map ? In most cases, I would think it’s actually wrong to include the quotes and the hashtag when defining a tag in the frontmatter.

I do this as I started to use obsidian wihtout frontmatter. It looked like :

tags:: #area/log 

I then converted all my notes using to frontmatter. The tool (Markdown Janitor) automatically re-wrote all my tags as shown in the screenshots above. Do you see an issue with the formatting on the long run ?

As a coder, I don’t see any issue using quotes in a YAML file.

Cheers!

1 Like

It’s good you liked it, and it solves your need.

I still think it’s better to write either of the following:

Tags: area/map, something/anything
Tags:
  - area/map
  - something/anything

But personal preferences are just that; personal. :smiley:

The main issue as I saw it, was that I got a little confused, and if you actually write Tags: '#area/map', you’ll end up with a first level tag of '#area, and a second level tag of map'. And I like to have consistent markup in my documents, like in the code block above. Having to remember when to add or remove the quotes to get the correct tag, is just something I would rather not need to think about.

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.