Skip to content

Expose list of (heading) IDs found on each page at build time #9848

@janosh

Description

@janosh

Describe the problem

I'd like to have a nav palette with fuzzy search for all headings with ids anywhere in the app. Here's my current setup listing only pages but not their sections.

Screenshot 2023-05-04 at 16 32 34

Thanks to handleMissingId = 'fail', the build fails when I link to a non-existent id on an existing page:

<a href="existing-page#but-missing-id">will raise at build time</a>

So at least at build time, a list of all IDs on a page must already exist in kit's internals.

Describe the proposed solution

Would be great if that data could be made available for building a better "jump to section" experience on docs pages.

Alternatives considered

No response

Importance

nice to have

Additional Information

No response

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