From 44e1d4a72d6b44cadf27cdb7e5daf30609a3d741 Mon Sep 17 00:00:00 2001 From: Ilya Grigoriev Date: Wed, 7 Feb 2024 14:09:29 -0800 Subject: [PATCH] docs: fix a bug with offline docs generation This is a rather annoying bug. It was revealed because CLI reference stopped working for *offline* docs after the previous commit. Turns out, none of the plugins we enabled for normal docs were turned on in `mkdocs-offline.yml`. Thanks to @mondeja for figuring out what was going on. In the future, we could try a less ugly fix, e.g. turning the `offline` plugin on or off via an environment variable. See also: https://github.com/squidfunk/mkdocs-material/issues/6749 https://github.com/mondeja/mkdocs-include-markdown-plugin/issues/195#issuecomment-1933085478 --- mkdocs-offline.yml | 8 ++++++++ mkdocs.yml | 3 +++ 2 files changed, 11 insertions(+) diff --git a/mkdocs-offline.yml b/mkdocs-offline.yml index 3704e86b60..13cb0b9786 100644 --- a/mkdocs-offline.yml +++ b/mkdocs-offline.yml @@ -4,6 +4,14 @@ INHERIT: 'mkdocs.yml' plugins: - offline + + # For now, *every plugin config* from `mkdocs.yml` has to be repeated here. + # https://github.com/mondeja/mkdocs-include-markdown-plugin/issues/195#issuecomment-1933085478 + # https://github.com/mkdocs/mkdocs/issues/3216 + - include-markdown # For the CLI reference + - search + - redirects: + redirect_maps: # Turns out the `offline` plugin forces the following # option no matter what, and therefore shouldn't be # used in the main config file. diff --git a/mkdocs.yml b/mkdocs.yml index 3e5ef6fd2a..4b2647ecf6 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -31,6 +31,9 @@ theme: extra: version: provider: mike + +# IMPORTANT: any changes to plugins have to be duplicated in +# `mkdocs-offline.yml`. See that file for more details. plugins: - include-markdown # For the CLI reference - search