Skip to content

Automate docs redirects between underscored and hyphenated page names #541

Description

@james-garner-canonical

Library names can be validly spelled with hyphens and underscores in different contexts -- the canonical distribution package name is hyphenated (per PyPI behaviour), while underscores are required when importing a package. In the docs, we made the decision to always use hyphenated URLs, matching PyPI, but page titles often use the import name, and it's a common 'mistake' to write 'reference/charmlibs/foo_bar' in URL. Ideally these would just redirect to the canonical URL.

Interface name are different -- the hyphen vs underscore distinction is meaningful to Juju.The canonical library path in the monorepo and URL in the documentation uses the actual interface name, preserving hyphens and underscores as-is. However, we wouldn't permit adding an interface whose name only differed in punctuation from an existing interface. So a query for (e.g.) the non-existent tls_certificates interface should really redirect to tls-certificates.

Metadata

Metadata

Labels

docsImprovements or additions to documentationinfraIssues with the repository infrastructure specifically.rainy daySmall items done in ~10% of each week's timeteam-charmlibs-maintainersMaintained by the canonical/charmlibs-maintainers team.

Fields

No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions