front-matter attributes used in Docusaurus
In Docusaurus, front-matter attributes are used to define metadata for your Markdown files. Here are the common front-matter attributes used in Docusaurus:
-
title
- Description: The title of the document.
- Example:
title: "Introduction"
-
description
- Description: A brief description of the document.
- Example:
description: "This is an introductory document."
-
id
- Description: The unique identifier for the document.
- Example:
id: "introduction"
-
slug
- Description: The URL path for the document.
- Example:
slug: "/docs/intro"
-
sidebar_label
- Description: The label to use in the sidebar for this document.
- Example:
sidebar_label: "Introduction"
-
hide_title
- Description: Whether to hide the document's title.
- Example:
hide_title: true
-
hide_table_of_contents
- Description: Whether to hide the table of contents for the document.
- Example:
hide_table_of_contents: true
-
keywords
- Description: An array of keywords for the document.
- Example:
keywords: ["docusaurus", "documentation"]
-
custom_edit_url
- Description: A custom URL for the "Edit this page" link.
- Example:
custom_edit_url: "https://github.com/facebook/docusaurus/edit/main/docs/intro.md"
-
sidebar_position
- Description: The position of the document in the sidebar.
- Example:
sidebar_position: 1
-
tags
- Description: An array of tags for the document.
- Example:
tags: ["getting started", "intro"]
-
image
- Description: The image associated with the document.
- Example:
image: "/img/logo.png"
-
authors
- Description: The authors of the document.
- Example:
authors: ["author1", "author2"]
-
draft
- Description: Whether the document is a draft.
- Example:
draft: true
-
date
- Description: The publication date of the document.
- Example:
date: "2024-10-04"
Here is an example of how the front-matter might look in a Docusaurus Markdown file:
---
title: "Introduction"
description: "This is an introductory document."
id: "introduction"
slug: "/docs/intro"
sidebar_label: "Introduction"
hide_title: true
hide_table_of_contents: true
keywords: ["docusaurus", "documentation"]
custom_edit_url: "https://github.com/facebook/docusaurus/edit/main/docs/intro.md"
sidebar_position: 1
tags: ["getting started", "intro"]
image: "/img/logo.png"
authors: ["author1", "author2"]
draft: true
date: "2024-10-04"
---
These attributes help Docusaurus to organize and display your documentation in a structured and user-friendly manner.