Skip to content

cleanUrls does not check for nested index.md #1770

Closed
@MarkusKeck

Description

Describe the bug

Vitepress should check for a nested index.md if no file for the current url exists

Reproduction

  1. Create a folder test
  2. Create a index.md file inside the test folder

Call the URL http://localhost:5173/test

http://localhost:5173/test -> 404 page not found
http://localhost:5173/test/ -> index.md gets found

This behavior makes sense from a file and folder perspective, but not from an url perspective.
URLs should point to the same resource regardless of using a trailing slash or not

I thought this gets handled with the cleanUrls setting
https://vitepress.vuejs.org/config/app-configs#cleanurls-experimental

In my opinion with-subfolders should check for an index.md file and without-subfolders should not.

Expected behavior

If no file gets found for the currently called url vitepress should check if the called folder contains an index file

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (32) x64 AMD Ryzen 9 3950X 16-Core Processor
    Memory: 44.27 GB / 63.91 GB
  Binaries:
    Node: 16.14.2 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.7.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (108.0.1462.76)
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    vitepress: ^1.0.0-alpha.13 => 1.0.0-alpha.35

Additional context

No response

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

Metadata

Assignees

No one assigned

    Labels

    buildRelated to the build system

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions