Slug with explicit .html extension breaks build
See original GitHub issueHave you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
Prerequisites
- I’m using the latest version of Docusaurus.
- I have tried the
npm run clear
oryarn clear
command. - I have tried
rm -rf node_modules yarn.lock package-lock.json
and re-installing packages. - I have tried creating a repro with https://new.docusaurus.io.
- I have read the console error message carefully (if applicable).
Description
I’m migrating a blog from Jekyll. It is necessary for me to keep the exact same url structure because there’s external refs to these posts. So I have a
slug: a/b.html
in every blog post frontmatter. On build, this fails with the following error:
[ERROR] Unable to build website for locale en.
[ERROR] Error: Expected output HTML file to be found at /home/projects/kkviyzpmp.github/build/blog/a/b.html/index.html.
Running the site works fine, error only happens on build.
Reproducible demo
https://stackblitz.com/edit/github-iuz7vq?file=blog/2021-08-26-welcome/index.md
Steps to reproduce
- Set a slug in a blog post frontmatter:
/a/b.html
- Run
yarn build
Expected behavior
Build should succeed, especially since running the site poses no problems.
Actual behavior
Build fails with the following error message:
[ERROR] Unable to build website for locale en.
[ERROR] Error: Expected output HTML file to be found at /home/projects/kkviyzpmp.github/build/blog/a/b.html/index.html.
Your environment
On stackblitz playground.
Self-service
- I’d be willing to fix this bug myself.
Issue Analytics
- State:
- Created a year ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
TYPO3 9.x and slug history - Stack Overflow
1 Answer 1 · Think about updating to 10. There are not quite so many breaking changes and you might find the update...
Read more >What Is a Slug in WordPress? - Web Design
This means you can create a slug for your post that includes all your keywords for SEO, and also create a short slug...
Read more >Tabbed - PyMdown Extensions Documentation - GitHub Pages
Particularly, a user should be mindful of the ID to keep from explicitly using a conflicting ID. Auto-generated slugs shouldn't conflict though.
Read more >Remove Slug and add .html extension to URL - Toolset
I am trying to: remove the custom post type slug from the url, and add a .html extension to the end of the...
Read more >Build and Submit HTML Forms With Django – Part 4
In this tutorial, you'll learn how to create HTML forms using a Django form. ... Therefore, you don't need to explicitly pass which...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @slorber I’ll like to work on this. I’ve read the disclaimer and don’t expect the PR to be assigned but just wanted to give up a heads up to prevent some one else from working on the same task.
( I’ll try create a PR quickly, but if you don’t see a message in the next 12 hours, feel free to pick this up )
Could you try setting
trailingSlash: false
?