Skip to content

Commit

Permalink
Allow third-party plugins to override core plugins (#2591)
Browse files Browse the repository at this point in the history
* Allow third-party plugins to override core plugins

* Improve resilience of check for core plugin
  • Loading branch information
squidfunk committed Oct 7, 2021
1 parent 1779c18 commit 4ea78da
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion mkdocs/plugins.py
Expand Up @@ -26,7 +26,15 @@ def get_plugins():

plugins = importlib_metadata.entry_points(group='mkdocs.plugins')

return {plugin.name: plugin for plugin in plugins}
# Allow third-party plugins to override core plugins
pluginmap = {}
for plugin in plugins:
if plugin.name in pluginmap and plugin.value.startswith("mkdocs.contrib."):
continue

pluginmap[plugin.name] = plugin

return pluginmap


class BasePlugin:
Expand Down

0 comments on commit 4ea78da

Please sign in to comment.