Skip to content

feat: URLs with no index.html suffix #3047

Open
jhult wants to merge 12 commits intorust-lang:masterfrom
jhult:feat/no-html-ext
Open

feat: URLs with no index.html suffix #3047
jhult wants to merge 12 commits intorust-lang:masterfrom
jhult:feat/no-html-ext

Conversation

@jhult
Copy link
Contributor

@jhult jhult commented Mar 8, 2026

Fixes #1251

[output.html]
no-html-extension=true
**no-html-extension:** When set to `true`, generates clean URLs without `.html` extensions. All pages are written to directory-based paths (e.g., `chapter/index.html` instead of `chapter.html`).

Special pages are placed in `_print/`, `_toc/`, and `_404/` directories.

All internal links use trailing-slash format (`chapter/` instead of `chapter.html`).

Works with all major static hosting providers (GitHub Pages, Netlify, Cloudflare Pages) and the built-in `mdbook serve` command.

**Note:** Chapter paths starting with `_print`, `_toc`, or `_404` will cause a build error.

Defaults to `false`.

Vaguely related PRs: #2570, #2993, #3028, #3034, #3038

@rustbot rustbot added the S-waiting-on-review Status: waiting on a review label Mar 8, 2026
The preprocessor now handles {{#if}}...{{else}}...{{/if}} blocks by keeping only the first branch and stripping trailing whitespace. Also adds required meta object for ESLint 10 compatibility.
@bens-schreiber
Copy link

Certainly fixes my issue #3028 . Would love to get this in.

@jhult
Copy link
Contributor Author

jhult commented Mar 9, 2026

@ehuss or @Dylan-DPC, I think many people would appreciate this being merged. I'd love any feedback you have to share.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: waiting on a review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove index.html suffix

3 participants