Skip to content

Commit

Permalink
Documentation (#7103)
Browse files Browse the repository at this point in the history
* added note on importance of site_url

this was in response to
#4678 (comment)

* re-wording to say why site_url is always needed
  • Loading branch information
alexvoss committed Apr 28, 2024
1 parent 9d901a3 commit c427e1c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions docs/creating-your-site.md
Expand Up @@ -37,13 +37,22 @@ This will create the following structure:

### 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:
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

???+ tip "Recommended: [configuration validation and auto-complete]"
Expand Down

0 comments on commit c427e1c

Please sign in to comment.