Skip to content
Search

Material for MkDocs

lastmod 2025-11-24created 2023-07-133 edits

Write your documentation in Markdown and create a professional static site for your Open Source or commercial project in minutes – searchable, customizable, more than 60 languages, for all devices.

Quick start

Material for MkDocs can be installed with pip:

pip install mkdocs-material

Add the following lines to mkdocs.yml:

theme:
  name: material

Template Page

If you're using theme extension and created a new page template in the overrides directory, you can enable it for a specific page. Add the following lines at the top of a Markdown file:

---
template: custom.html
---

# Page title
...

Creating a Redirect Page using a Template

Add custom_dir to the mkdocs.yml file as follows:

theme:
  name: material
  custom_dir: overrides

The overrides/redirect.html file:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <link rel="canonical" href="{{ page.meta.redirect }}">
  <title>{{ page.meta.title }}</title>
  <meta http-equiv="refresh" content="0; url={{ page.meta.redirect }}" />
  <script>
    var anchor = window.location.hash.substr(1);
    location.href = "{{ page.meta.redirect }}" + (anchor ? "#" + anchor : "");
  </script>
</head>
<body>
  <p>You're being redirected to a <a href="{{ page.meta.redirect }}">new destination</a>.</p>
</body>
</html>

The Markdown file you want to redirect:

---
date: '2023-02-01'
redirect: /Linear_equation
template: redirect.html
title: "1차방정식"
---

# ...

Note that the redirect address does not get its path reassigned by mkdocs. So you must enter the exact address yourself.

See also

Favorite site

author Zer0 sitemap