From 6b690e9acdf2b4ae10f2299309de231f6796ba30 Mon Sep 17 00:00:00 2001 From: Alexander Voss Date: Thu, 21 Dec 2023 03:37:24 -0500 Subject: [PATCH] Documentation (#6549) This is in response to https://github.com/squidfunk/mkdocs-material/discussions/6542 to add a section on setting up navigation for a blog so that the archive and category pages appear in the right place. --- docs/plugins/blog.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/docs/plugins/blog.md b/docs/plugins/blog.md index 121c779fa..19ab40cd7 100644 --- a/docs/plugins/blog.md +++ b/docs/plugins/blog.md @@ -153,6 +153,35 @@ installed. [blog]: blog.md [built-in plugins]: index.md +### Navigation + +If you do not have site navigation configured in your `mkdocs.yml` then there is +nothing more to do. The blog [archive] and [category] pages will automatically +appear underneath the automatically generated navigation. + +If you do have a navigation structure defined then you will need to specify +where the blog should appear in this. Create a [navigation section with an index +page] for the blog: + +```yaml +theme: + name: material + features: + - navigation.indexes +nav: + - ... + - Blog: + - blog/index.md +``` + +The [archive] and [category] pages will appear within that section as +subsections beneath pages in the blog section. In this case, they would appear +after `index.md`. The path to the `index.md` file must match +[blog_dir][config.blog_dir]. This means that you can name the blog navigation +entry anything you like: 'Blog' or 'News' or perhaps 'Tips'. + +[navigation section with an index page]: ../setup/setting-up-navigation.md#section-index-pages + ### General The following settings are available: