mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed info plugin terminating on subsequent reload when serving
This commit is contained in:
parent
99eed0e810
commit
ad6c47ddb6
@ -57,19 +57,18 @@ class InfoPlugin(BasePlugin[InfoPluginConfig]):
|
||||
|
||||
# Determine whether we're serving
|
||||
def on_startup(self, *, command, dirty):
|
||||
self.is_serve = (command == "serve")
|
||||
|
||||
# Initialize plugin (run earliest)
|
||||
@event_priority(100)
|
||||
def on_config(self, config):
|
||||
if not self.config.enabled:
|
||||
return
|
||||
|
||||
# By default, the plugin is disabled when the documentation is served,
|
||||
# but not when it is built. This should nicely align with the expected
|
||||
# user experience when creating reproductions.
|
||||
if not self.config.enabled_on_serve:
|
||||
self.config.enabled = command != "serve"
|
||||
|
||||
# Initialize plugin (run earliest)
|
||||
@event_priority(100)
|
||||
def on_config(self, config):
|
||||
if not self.config.enabled:
|
||||
if not self.config.enabled_on_serve and self.is_serve:
|
||||
return
|
||||
|
||||
# Resolve latest version
|
||||
|
@ -57,19 +57,18 @@ class InfoPlugin(BasePlugin[InfoPluginConfig]):
|
||||
|
||||
# Determine whether we're serving
|
||||
def on_startup(self, *, command, dirty):
|
||||
self.is_serve = (command == "serve")
|
||||
|
||||
# Initialize plugin (run earliest)
|
||||
@event_priority(100)
|
||||
def on_config(self, config):
|
||||
if not self.config.enabled:
|
||||
return
|
||||
|
||||
# By default, the plugin is disabled when the documentation is served,
|
||||
# but not when it is built. This should nicely align with the expected
|
||||
# user experience when creating reproductions.
|
||||
if not self.config.enabled_on_serve:
|
||||
self.config.enabled = command != "serve"
|
||||
|
||||
# Initialize plugin (run earliest)
|
||||
@event_priority(100)
|
||||
def on_config(self, config):
|
||||
if not self.config.enabled:
|
||||
if not self.config.enabled_on_serve and self.is_serve:
|
||||
return
|
||||
|
||||
# Resolve latest version
|
||||
|
Loading…
Reference in New Issue
Block a user