Skip to content

Commit

Permalink
add option to enable/disable integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Guts committed Dec 13, 2023
1 parent aa736bf commit 2aacffc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions mkdocs_rss_plugin/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ class RssPluginConfig(Config):
pretty_print = config_options.Type(bool, default=False)
url_parameters = config_options.Optional(config_options.Type(dict))
use_git = config_options.Type(bool, default=True)
use_material_social_cards = config_options.Type(bool, default=True)
15 changes: 11 additions & 4 deletions mkdocs_rss_plugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,21 @@ def on_config(self, config: config_options.Config) -> dict:
return config

# integrations - check if theme is Material and if social cards are enabled
self.integration_material_social_cards_enabled = (
is_social_plugin_enabled_mkdocs(mkdocs_config=config)
)
if self.config.use_material_social_cards:
self.integration_material_social_cards_enabled = (
is_social_plugin_enabled_mkdocs(mkdocs_config=config)
)
else:
logger.debug(
"[rss-plugin] Integration with Social Cards (Material theme) is "
"disabled by option in Mkdocs configuration."
)
self.integration_material_social_cards_enabled = False

# instanciate plugin tooling
self.util = Util(
use_git=self.config.use_git,
integration_material=self.integration_material_social_cards_enabled,
integration_material_social_cards=self.integration_material_social_cards_enabled,
)

# check template dirs
Expand Down

0 comments on commit 2aacffc

Please sign in to comment.