VuePress 1.x: Use Permalink to Remove .html File Extension

May 21, 2019

By default, if you created a file at docs/privacy.md, the page shall be accessible via /privacy.html.

To remove the .html extension, you can specify permalink in docs/privacy.md to access the page as /privacy/.

---title: Privacypermalink: /privacy---# Privacy

NOTE: As of v1.0.0-alpha.48, a trailing slash is required (e.g. /privacy/) to access the page, currently there is no reliable way to remove trailing slash (e.g. /privacy). Luckily, /privacy is redirected to /privacy/ (for development server, at least; haven't try production yet).

Caveats

As of v1.0.0-alpha.48, refering to permalink page in markdown via [Privacy](/privacy.md) will generated link to /privacy.html, but /privacy.html will redirect to /privacy/.

[/privacy](/privacy) -> `/privacy`[/privacy/](/privacy/) -> `/privacy/`[/privacy.md](/privacy.md) -> `/privacy.html`

NOTE: Source code for fileToPath.ts.

References:

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.