specs icon indicating copy to clipboard operation
specs copied to clipboard

Proposal: disallow moving spec pages without corresponding path redirecting

Open sambacha opened this issue 1 year ago • 2 comments

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

someone links me to a doc page, suddenly 404 page missing fml

Describe the solution you'd like A clear and concise description of what you want to happen.

Proposal: disallow moving spec pages without corresponding path redirecting

Describe alternatives you've considered using a different rollup stack

Additional context

Example: https://github.com/ethereum-optimism/optimism/blob/develop/specs/fault-proof.md

sambacha avatar Mar 14 '24 23:03 sambacha

Is there an easy way to do this with mdbook?

tynes avatar Mar 16 '24 00:03 tynes

Is there an easy way to do this with mdbook?

mdbook has this option built in: https://rust-lang.github.io/mdBook/format/configuration/renderers.html#outputhtmlredirect

Generating a sitemap.xml file would be useful in tracking changes regardless if output.redirects is maintained, as it would capture all the links for the site. However large changes would be more difficult to track in a single PR. In those cases just doing some simple search based off of the user inputted URL and the latest sitemap could provide a best-effort approximation of what the user is looking for.

A more Lazy Approach:

The browser should find the valid path that has the shortest edit distance (re: Levenshtein distance) from the path that was requested from the submitted URL based off of the latest sitemap.xml file. Then present the suggestion (the shortest edit distance result based off of the sitemap.xml links) as as suggested link (i.e. the path determined by the levenstein algo) on the 404 page.

Basicaly, "Did you mean < suggested path link > for < users original requested link > ?"

sambacha avatar Mar 19 '24 23:03 sambacha