From c427e1cb9fdf7c12b1604966d282397347690d86 Mon Sep 17 00:00:00 2001 From: Alexander Voss Date: Sun, 28 Apr 2024 04:43:24 +0200 Subject: [PATCH] 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 --- docs/creating-your-site.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/creating-your-site.md b/docs/creating-your-site.md index 1f2e2ef63..e8c4f3848 100644 --- a/docs/creating-your-site.md +++ b/docs/creating-your-site.md @@ -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]"