--- template: overrides/main.html --- # Creating your site After you've [installed] Material for MkDocs, you can bootstrap your project documentation using the `mkdocs` executable. Go to the directory where you want your project to be located and enter: ``` mkdocs new . ``` Alternatively, if you're running Material for MkDocs from within Docker, use: === "Unix, Powershell" ``` docker run --rm -it -v ${PWD}:/docs squidfunk/mkdocs-material new . ``` === "Windows" ``` docker run --rm -it -v "%cd%":/docs squidfunk/mkdocs-material new . ``` This will create the following structure: ``` . ├─ docs/ │ └─ index.md └─ mkdocs.yml ``` [installed]: getting-started.md ## Configuration ### Minimal configuration Simply add the following lines to `mkdocs.yml` to enable the theme. Note that since there are several [installation methods], minimal configuration might be slightly different: === ":fontawesome-brands-python: pip" ``` yaml theme: name: material ``` === ":fontawesome-brands-docker: docker" ``` yaml theme: name: material ``` === ":fontawesome-brands-git-alt: git" ``` yaml theme: name: null custom_dir: mkdocs-material/material # 404 page static_templates: - 404.html # Necessary for search to work properly include_search_page: false search_index_only: true # Default values, taken from mkdocs_theme.yml language: en font: text: Roboto code: Roboto Mono favicon: assets/favicon.png icon: logo: logo ``` When you clone from GitHub, you must list all of the themes' defaults explicitly, because [`mkdocs_theme.yml`][mkdocs_theme.yml] is not loaded automatically as described in the [custom theme guide]. [installation methods]: getting-started.md#installation [mkdocs_theme.yml]: https://github.com/squidfunk/mkdocs-material/blob/master/src/mkdocs_theme.yml [custom theme guide]: https://www.mkdocs.org/user-guide/custom-themes/#creating-a-custom-theme ??? tip "Recommended: configuration validation and auto-complete" In order to minimize friction and maximize productivity, Material for MkDocs provides its own [schema.json] for `mkdocs.yml`. If your editor supports YAML schema validation, it's definitely recommdended to set it up: === "Visual Studio Code" 1. Install [`vscode-yaml`][vscode-yaml] for YAML language support. 2. Add the schema under the `yaml.schemas` key in your user or workspace [`settings.json`][settings.json]: ``` json { "yaml.schemas": { "https://squidfunk.github.io/mkdocs-material/schema.json": "mkdocs.yml" } } ``` === "Other" 1. Ensure your editor of choice has support for YAML schema validation. 2. Add the following lines at the top of `mkdocs.yml`: ``` yaml # yaml-language-server: $schema=https://squidfunk.github.io/mkdocs-material/schema.json ``` [schema.json]: schema.json [vscode-yaml]: https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml [settings.json]: https://code.visualstudio.com/docs/getstarted/settings [LSP-yaml]: https://github.com/sublimelsp/LSP-yaml ### Advanced configuration Material for MkDocs comes with many configuration options. The setup section explains in great detail how to configure and customize colors, fonts, icons and much more: