Skip to content

Slug with explicit .html extension breaks build #8139

@rwwilden

Description

@rwwilden

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn error in the Docusaurus core causing instability or issues with its executiongood first issueIf you are just getting started with Docusaurus, this issue should be a good place to begin.hacktoberfest

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions