Skip to content

MkDocs

Sources:


Python

Check if Python is installed:

python --version

or

python3 --version

If it’s missing or outdated, install it:

sudo pacman -S python

Pip

Check if pip is installed:

pip --version

If not, install it (Python should already be installed):

sudo pacman -S python-pip

Setting up MkDocs

Install MkDocs

pip install mkdocs

Verify installation:

mkdocs --version

Install Material for MkDocs

pip install mkdocs-material

Create a new project

mkdocs new my_project && cd my_project

Configure mkdocs.yml

Example configuration:

site_name: My Docs
site_url: https://example-docs.docs
nav:
  - Home: index.md
  - Arch: 
    - Installation: arch/arch-installation.md
  - Site Deployment:
    - MkDocs: site-deployment/mkdocs.md
    - Netlify: site-deployment/netlify.md
  - Gaming: 
    - Overview: gaming/gaming.md
    - Steam: gaming/steam.md
    - Heroic Games Launcher: gaming/heroic.md
    - PoE: gaming/poe.md
theme:
  name: material
  language: en
  icon:
    logo: simple/linux
  palette:
    - scheme: slate
      toggle:
        icon: material/weather-sunny
        name: Dark mode
      primary: deep purple
      accent: deep purple
    - scheme: default
      toggle:
        icon: material/weather-night
        name: Light mode
      primary: blue
      accent: deep orange

Local Preview

Run MkDocs locally:

cd my_project && mkdocs serve

Open in browser:

http://127.0.0.1:800

Preparing for Deployment

Build the static site

cd my_project && mkdocs build

This should create the site/ directory.


Requirements file

Create a requirements.txt file for Netlify (or any CI/CD) and add:

mkdocs
mkdocs-material

Netlify configuration file

To deploy MkDocs on Netlify, create a netlify.toml file and edit it:

Replace PYTHON_VERSION with your Python version.

[build]
command = "mkdocs build"
publish = "site"
environment = { PYTHON_VERSION = "3.13" }