From 2986aca6298c143dcdf9ff780cdc4aa9ed4f81d3 Mon Sep 17 00:00:00 2001 From: squidfunk Date: Mon, 19 Feb 2024 12:48:18 +0700 Subject: [PATCH] Documentation --- docs/setup/setting-up-navigation.md | 20 ++++++++++++++++++++ includes/mkdocs.md | 1 + 2 files changed, 21 insertions(+) diff --git a/docs/setup/setting-up-navigation.md b/docs/setup/setting-up-navigation.md index f9ab4dc78..bce44b516 100644 --- a/docs/setup/setting-up-navigation.md +++ b/docs/setup/setting-up-navigation.md @@ -31,6 +31,16 @@ are rebound automatically, i.e., __Material for MkDocs now behaves like a Single Page Application__. Now, the search index survives navigation, which is especially useful for large documentation sites. +!!! info "The [`site_url`][mkdocs.site_url] setting must be set" + + Note that you must set [`site_url`][mkdocs.site_url] when using instant + navigation, as instant navigation relies on the generated `sitemap.xml` + which will be empty if this setting is omitted. Example: + + ``` yaml + site_url: https://example.com + ``` + [XHR]: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest #### Instant prefetching @@ -108,6 +118,16 @@ theme: - navigation.instant.preview ``` +!!! info "The [`site_url`][mkdocs.site_url] setting must be set" + + Note that you must set [`site_url`][mkdocs.site_url] when using instant + previews, as instant previews rely on the generated `sitemap.xml` + which will be empty if this setting is omitted. Example: + + ``` yaml + site_url: https://example.com + ``` + ### Anchor tracking diff --git a/includes/mkdocs.md b/includes/mkdocs.md index fc3629eae..fd8eb483a 100644 --- a/includes/mkdocs.md +++ b/includes/mkdocs.md @@ -4,6 +4,7 @@ [mkdocs.env]: https://www.mkdocs.org/user-guide/configuration/#environment-variables [mkdocs.docs_dir]: https://www.mkdocs.org/user-guide/configuration/#docs_dir [mkdocs.site_dir]: https://www.mkdocs.org/user-guide/configuration/#site_dir + [mkdocs.site_url]: https://www.mkdocs.org/user-guide/configuration/#site_url [mkdocs.site_description]: https://www.mkdocs.org/user-guide/configuration/#site_description [mkdocs.nav]: https://www.mkdocs.org/user-guide/configuration/#nav [mkdocs.plugins]: https://www.mkdocs.org/user-guide/configuration/#plugins