Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose valid regex slug property for slugify call. #123

Open
bitsondatadev opened this issue Jan 10, 2024 · 0 comments · May be fixed by #129
Open

Expose valid regex slug property for slugify call. #123

bitsondatadev opened this issue Jan 10, 2024 · 0 comments · May be fixed by #129

Comments

@bitsondatadev
Copy link

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)

Fokko added a commit to Fokko/mkdocs-monorepo-plugin that referenced this issue May 30, 2024
@Fokko Fokko linked a pull request May 30, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant