HackMD
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Emoji Reply
      • Invitee
      • No invitee
    • Publish Note

      Publish Note

      Everyone on the web can find and read all notes of this public team.
      Once published, notes can be searched and viewed by anyone online.
      See published notes
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Help
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Emoji Reply
Invitee
No invitee
Publish Note

Publish Note

Everyone on the web can find and read all notes of this public team.
Once published, notes can be searched and viewed by anyone online.
See published notes
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
--- robots: index, follow lang: en dir: ltr breaks: true --- # What is YAML metadata and how to use it? :::warning Since 2023-06-20 (GMT+8), HackMD does not accept YAML frontmatter as metadata. All metadata defined in YAML frontmatter has been migrated to HackMD and stored there, after which HackMD ignores all changes in the YAML frontmatter section. This tutorial will close on 2023-08-20. Before then, you may want to review each section to see where the metadata goes. ::: YAML is a human-readable data-serialization language. It is commonly used for configuration files and in applications where data is being stored or transmitted [^from-Wikipedia]. It is a common practice to use YAML to add metadata, such as title, tags, and descriptions, to Markdown documents. [^from-Wikipedia]: https://en.wikipedia.org/wiki/YAML HackMD defines certain properties that you can use for various aims, for example, controlling behaviors in slide mode. First of all, you have to add the following contents at the **first** line of a note. ``` --- YAML metas --- ``` Replace `YAML metas` with the properties below. The source code of this note can be your reference. title --- :::warning Please refer to the tutorial: [How to edit title and tags](/s/osUXHS5sTe21hcecll0d5g). ::: Set the title of the note, overrides the first Header. > Default: not defined. **Example** ```xml title: meta title ``` description --- :::warning Please refer to the tutorial: [How to edit metadata of a note](/s/z9V2N2odTIWfPX5j8Gt4cg) ::: Set description for the note. > Default: not defined. **Example** ```xml description: meta description ``` image --- :::warning Please refer to the tutorial: [How to edit metadata of a note](/s/z9V2N2odTIWfPX5j8Gt4cg) ::: Set the default image for the note, which will be used as preview image for the link. > Default: HackMD default preview image **Example** ```xml image: https://hackmd.io/screenshot.png ``` :::info ### :bulb: Twitter Social Cards Twitter only displays images that meet the ratio of 1200 to 675. ::: tags --- :::warning Please refer to the tutorial: [How to edit title and tags](/s/osUXHS5sTe21hcecll0d5g). ::: Set tags for the note. overrides tags set with `######tags:` > Default: not defined. **Example** ```xml tags: features, cool, updated ``` type --- :::warning Please refer to the tutorial: [How to create a slide deck](https://hackmd.io/@docs/S1wwUhj5E) ::: Set the type of the note. If you'd like to preview slides in Edit Mode, please set this property to `slide`. **Example** ```xml type: slide ``` robots --- :::warning You will be able to set this again soon. ::: By adding this property, HackMD will add the following HTML tag to the `<head>` section: ```xml <meta name="robots" content="your_meta"> ``` You can set the content property to `noindex, nofollow` to prevent search engines from indexing your note. > Default: not set. **Example** ```xml robots: noindex, nofollow ``` lang --- :::warning Please refer to the tutorial: [Edit note metadata](/s/z9V2N2odTIWfPX5j8Gt4cg). ::: Set note language. Please use ISO 639-1 codes: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes > Default: not defined (`en`) **Example** ```xml lang: ja-jp ``` dir --- :::warning Please refer to the tutorial: [Edit note metadata](/s/z9V2N2odTIWfPX5j8Gt4cg). ::: Set the direction of words. Use `rtl` for languages written from right to left, and `ltr` for those written from left to right. Learn more → http://www.w3.org/International/questions/qa-html-dir > Default: not defined (`ltr`) **Example** ```xml dir: rtl ``` breaks --- :::warning Please refer to the tutorial: [Edit note metadata](/s/z9V2N2odTIWfPX5j8Gt4cg). ::: Tells HackMD to translate a new line into a new line or to be ignored. In original Markdown guideline, you have to add two spaces to make a new line. This property can only be set to `true` or `false`. > Default: note defined (`true`) **Example** ```xml breaks: false ``` GA --- :::warning You will be able to set GA again soon ::: Set Google Analytics ID > Default: not set (disabled) **Example** ```xml GA: UA-12345667-8 ``` disqus --- :::warning Please refer to the tutorial: [Edit note metadata](/s/z9V2N2odTIWfPX5j8Gt4cg). HackMD will provide its own way of commenting on the whole note and is sunsetting disqus. ::: Enable Disqus with your shortname. > Default: not set (disabled) **Example** ```xml disqus: hackmd ``` slideOptions --- :::warning Please refer to the tutorial: [How to create a slide deck](https://hackmd.io/@docs/S1wwUhj5E) ::: Configure presentation behaviors in slide mode. For details, please consult: https://revealjs.com/config/#reconfiguring You can set a theme for the slides. Please consult: https://revealjs.com/themes/ :::warning :bulb: Please indent with two spaces in YAML. ::: > Default: not defined **Example** ```xml slideOptions: transition: fade theme: white ``` lintConfig --- :::warning You will be able to configure lint soon. ::: This option is the vaules for [markdownlint](https://github.com/DavidAnson/markdownlint). For details, please consult [.markdownlint.yaml](https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.yaml). :::warning :bulb: Please indent with two spaces in YAML. ::: **Example** ```md --- lintConfig: MD004: style: "consistent" MD006: false --- # Your other markdown content ```

Import from clipboard

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Sign in via SAML

or

Sign in via GitHub

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Tutorials

Book Mode Tutorial

Slide Example

Resources

Releases

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Upgrade to Prime

  • Edit verison name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare with
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Upgrade

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Upgrade

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully