Skip to content
Discussion options

You must be logged in to vote

The subject of navigation comes back often (see #198, #267).

The key fact to know about MkDocs-Macros is that, by design choice, the environment variables are copied at the time of the on_config event.

def on_config(self, config):

You get the config with what's in there at the time of the on_page event.

The program does a shallow copy, so you might have a mix of states.

from copy import copy

However the navigation and files variables are defined at the time of the on_nav:

def on_nav(self, nav, config, files):

In truth, MkDocs…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by angeld-jr2
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants