Skip to content

resolveDocLink doesn't handle extensionless links #30

@alsiola

Description

@alsiola

Bug

Internal links in MDX/MD files that omit the file extension (e.g. [Members](members) instead of [Members](members.mdx)) are not resolved as hash routes. They fall through as plain relative URLs, resulting in broken links (404s).

Root cause

resolveDocLink in src/app/src/lib/doc-links.ts requires the .md/.mdx extension to match:

if (!href.match(/\.mdx?(#.*)?$/i)) return null;

Extensionless hrefs return null, so the link is rendered as a plain <a href="members"> which resolves against the page's base URL instead of becoming #/doc/docs/admin/members.

Reproduction

Doxla's own docs have the same issue — docs/configuration.mdx links to (custom-components) and docs/custom-components.mdx links to (configuration), both without extensions. These links are broken on the live site.

The README.md link [Why Doxla?](RATIONALE.md) works because it includes the .md extension.

Expected behaviour

Extensionless relative links should be resolved against the manifest to check if they match a known doc slug, and rewritten as hash routes if so.

Workaround

Include the .md/.mdx extension explicitly in all internal links.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions