Auto-Discovery

Let Slash find links already on the page instead of hand-listing them.

Rather than maintaining a JSON file by hand, Slash can scan the current page's DOM for navigable links and use them as searchable items automatically. This keeps results in sync with whatever navigation already exists in your app, with no separate data file to maintain.

With discover="auto", Slash walks the rendered page for anchor tags and extracts a label, url, and category for each one. It prefers, in order: an explicit data-slash-label attribute, the link's aria-label, then its visible text content. Links inside an element marked data-slash-ignore are skipped.

PropTypeDescription
data-slash-labelstringOverrides the auto-detected label.
data-slash-categorystringGroups the link under a heading in results.
data-slash-keywordsstringSpace-separated extra search terms.
data-slash-ignoreboolean attributeExcludes the link from discovery entirely.

Auto-Discovery re-scans on route changes in single-page apps, so newly rendered links are picked up without a manual refresh. It can be combined with a JSON config or the Sitemap source — Slash merges items from every active source and de-duplicates by url.