Expose valid regex slug property for slugify call.
bitsondatadev opened this issue · 0 comments
bitsondatadev commented
Could you consider exposing a valid_slug_regex
Mkdocs config, to address the issue brought up in #116. This way we default to the existing hardcoded value.
Something like:
mkdocs.yml
plugins:
- monorepo
valid_slug_regex: '^[a-zA-Z0-9_\.\-/]+$'
plugin.py
class MonorepoPluginConfig(mkdocs.config.base.Config):
valid_slug_regex = mkdocs.config.config_options.Type(str, default='^[a-zA-Z0-9_\-/]+$') # noqa: W605
class MonorepoPlugin(MonorepoPlugin[MonorepoPluginConfig]):
parser.py
def getAlias(self):
alias = self.navYaml["site_name"]
regex = self.valid_slug_regex
Originally posted by @bitsondatadev in #116 (comment)