@@ -55,29 +55,33 @@ class GitRssPlugin(BasePlugin[RssPluginConfig]):
55
55
# allow to set the plugin multiple times in the same mkdocs config
56
56
supports_multiple_instances = True
57
57
58
- def __init__ (self ):
58
+ def __init__ (self , * args , ** kwargs ):
59
59
"""Instantiation."""
60
60
# pages storage
61
- self .pages_to_filter : List [PageInformation ] = []
62
- # prepare output feeds
63
- self .feed_created : dict = {}
64
- self .feed_updated : dict = {}
65
- # flag used command to disable some actions if serve is used
66
- self .cmd_is_serve : bool = False
61
+ super ().__init__ (* args , ** kwargs )
67
62
68
63
def on_startup (
69
64
self , * , command : Literal ["build" , "gh-deploy" , "serve" ], dirty : bool
70
65
) -> None :
71
66
"""The `startup` event runs once at the very beginning of an `mkdocs` invocation.
67
+ Note that for initializing variables, the __init__ method is still preferred.
68
+ For initializing per-build variables (and whenever in doubt), use the
69
+ on_config event.
72
70
73
71
See: https://www.mkdocs.org/user-guide/plugins/#on_startup
74
72
75
73
Args:
76
74
command: the command that MkDocs was invoked with, e.g. "serve" for `mkdocs serve`.
77
75
dirty: whether `--dirty` flag was passed.
78
76
"""
77
+ # flag used command to disable some actions if serve is used
79
78
self .cmd_is_serve = command == "serve"
80
79
80
+ self .pages_to_filter : List [PageInformation ] = []
81
+ # prepare output feeds
82
+ self .feed_created : dict = {}
83
+ self .feed_updated : dict = {}
84
+
81
85
def on_config (self , config : MkDocsConfig ) -> MkDocsConfig :
82
86
"""The config event is the first event called on build and
83
87
is run immediately after the user configuration is loaded and validated.
0 commit comments