Skip to main content

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:

  1. title

    • Description: The title of the document.
    • Example: title: "Introduction"
  2. description

    • Description: A brief description of the document.
    • Example: description: "This is an introductory document."
  3. id

    • Description: The unique identifier for the document.
    • Example: id: "introduction"
  4. slug

    • Description: The URL path for the document.
    • Example: slug: "/docs/intro"
  5. sidebar_label

    • Description: The label to use in the sidebar for this document.
    • Example: sidebar_label: "Introduction"
  6. hide_title

    • Description: Whether to hide the document's title.
    • Example: hide_title: true
  7. hide_table_of_contents

    • Description: Whether to hide the table of contents for the document.
    • Example: hide_table_of_contents: true
  8. keywords

    • Description: An array of keywords for the document.
    • Example: keywords: ["docusaurus", "documentation"]
  9. 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"
  10. sidebar_position

    • Description: The position of the document in the sidebar.
    • Example: sidebar_position: 1
  11. tags

    • Description: An array of tags for the document.
    • Example: tags: ["getting started", "intro"]
  12. image

    • Description: The image associated with the document.
    • Example: image: "/img/logo.png"
  13. authors

    • Description: The authors of the document.
    • Example: authors: ["author1", "author2"]
  14. draft

    • Description: Whether the document is a draft.
    • Example: draft: true
  15. 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.