The requested path, normalized by stripping leading slashes and replacing -, _, and / with spaces before matching.
Smart 404
1 min readStableIntermediate
When a reader lands on a missing path, OwnDocs runs the requested slug against the static search index using Fuse.js and surfaces the top five likely pages.
Quick Start
Visit a non-existent path to see the suggestion list.
Adding Options
Each suggestion shows the page title and its URL. When no page clears the relevance threshold, the suggestion block is hidden and only the "Back to home" and "Go back" buttons remain.
Advanced
Fuse.js runs with ignoreLocation: true and a 0.5 threshold, searching the title, slug, url, and content keys. Results are sorted by score and trimmed to five, which recovers typos, missing segments, and renamed pages.
Options
missing slugstringRelated pages
Was this page helpful?