%%
date:: [[2023-06-11]], [[2023-06-11]]
parent::
%%
# [[YAML Frontmatter]]
YAML amusingly stands for "YAML Ain't Markup Language". In the tech world, it's often used for configuration files. Markdown typically allows "frontmatter" to be written in YAML format, so the two can be used together in the same file.
You can use YAML frontmatter in Obsidian by adding this *to the very top* of your note:
```
---
key: value
---
```
YAML keys are like the names of settings, and their values change depending on what each key requires. Sometimes, keys are called "parameters".
YAML frontmatter doesn't appear in [[Views in Obsidian#Reading view|Reading view]] by default, so they can be a way to hide metadata that you don't always need to see when you're viewing a note.
## Frontmatter in Obsidian
Obsidian accepts these keys by default:
- tags
- aliases
- cssclass
- publish (true or false)
Other community plugins, such as [[Dataview plugin]], rely on frontmatter as well.
## tags
You can set [[Tags]] in frontmatter like this:
```
---
tags: inbox
---
```
The YAML frontmatter above applies the tag `#inbox` to the note.
## aliases
An [[Aliases|alias]] is another name that you might refer to a note by. You can set them in frontmatter like this:
```
---
aliases: Joe
---
```
In the file [[Joseph]], an alias is set to `Joe`. When creating a link, you can type the two brackets as usual (`[[`) and then select either `Joseph` or `Joe`.
If you select `Joseph`, the link will be inserted like thi:
`[[Joseph]]`
and it will look like this: [[Joseph]].
If you select `Joe`, the link will be inserted like this:
`[[Joseph|Joe]]`
and it will look like this: [[Joseph|Joe]].
You can use aliases to set nicknames for people but also shorthand for other types of notes. You might have a note called [[Personal Knowledge Management]], for example, that has an alias [[Personal Knowledge Management|PKM]].
## cssclass
This YAML key is used for choosing which [[A note on CSS and appearance|CSS]] elements to use in a particular note. CSS is used for setting themes in Obsidian, and they can also be controlled and displayed on a per-note basis.
## publish
This YAML key lets you set whether a note should be published using [[Obsidian Publish]] or not.
```
---
publish: true
---
```
A value of `true` means that the note should always be included in the list to publish, and a value of `false` means that the note should never be included.
## Related
- [Obsidian docs on frontmatter](https://help.obsidian.md/Advanced+topics/YAML+front+matter)
- [[Metadata in frontmatter vs comments in Obsidian]]