question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Slug with explicit .html extension breaks build

See original GitHub issue

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I’m using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn 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

  1. Set a slug in a blog post frontmatter: /a/b.html
  2. 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:closed
  • Created a year ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Pranav2612000commented, Oct 1, 2022

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 )

1reaction
Josh-Cenacommented, Sep 27, 2022

Could you try setting trailingSlash: false?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found