Skip to content

feature request: export src/shared/shared's normalize() #4401

@olets

Description

@olets

Is your feature request related to a problem? Please describe.

I use page hrefs in dynamic <meta> tags, for example in og:url. It'd be great if VitePress provided a way to reliably reference the page's pathname, to ensure that that part of the dynamic meta content is correct.

Describe the solution you'd like

Export this function:

function normalize(path: string): string {

Describe alternatives you've considered

Currently, I copy normalize, HASH_OR_QUERY_RE, and INDEX_OR_EXT_RE from src/shared/shared.ts to my VitePress config. That's brittle and inelegant.

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions