Skip to content

Commit

Permalink
docs: fix a bug with offline docs generation
Browse files Browse the repository at this point in the history
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:
squidfunk/mkdocs-material#6749
mondeja/mkdocs-include-markdown-plugin#195 (comment)
  • Loading branch information
ilyagr committed Feb 12, 2024
1 parent 16ec185 commit 44e1d4a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mkdocs-offline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 44e1d4a

Please sign in to comment.