mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Documentation (#7103)
* added note on importance of site_url this was in response to https://github.com/squidfunk/mkdocs-material/issues/4678#issuecomment-1327681673 * re-wording to say why site_url is always needed
This commit is contained in:
parent
9d901a3caf
commit
c427e1cb9f
@ -37,13 +37,22 @@ This will create the following structure:
|
|||||||
|
|
||||||
### Minimal configuration
|
### Minimal configuration
|
||||||
|
|
||||||
Simply add the following lines to `mkdocs.yml` to enable the theme:
|
Simply set the `site_name` and add the following lines to `mkdocs.yml` to enable the theme:
|
||||||
|
|
||||||
``` yaml
|
``` yaml hl_lines="2-5"
|
||||||
|
site_name: My site
|
||||||
|
site_url: https://mydomain.org/mysite
|
||||||
theme:
|
theme:
|
||||||
name: material
|
name: material
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The `site_url` setting is important for a number of reasons.
|
||||||
|
By default, MkDocs will assume that your site is hosted at the root of
|
||||||
|
your domain. This is not the case, for example, when [publishing to GitHub
|
||||||
|
pages] - unless you use a custom domain. Another reason is that some of the
|
||||||
|
plugins require the `site_url` to be set, so you should always do this.
|
||||||
|
|
||||||
|
[publishing to GitHub pages]: publishing-your-site.md#github-pages
|
||||||
[installation methods]: getting-started.md#installation
|
[installation methods]: getting-started.md#installation
|
||||||
|
|
||||||
???+ tip "Recommended: [configuration validation and auto-complete]"
|
???+ tip "Recommended: [configuration validation and auto-complete]"
|
||||||
|
Loading…
Reference in New Issue
Block a user