Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't seem to get index.md to reliably reroute to readme.md #4335

Open
14 of 19 tasks
DexrnZacAttack opened this issue Nov 3, 2024 · 1 comment
Open
14 of 19 tasks

Can't seem to get index.md to reliably reroute to readme.md #4335

DexrnZacAttack opened this issue Nov 3, 2024 · 1 comment
Labels
bug: pending triage Maybe a bug, waiting for confirmation

Comments

@DexrnZacAttack
Copy link

DexrnZacAttack commented Nov 3, 2024

Describe the bug

Tried these:

rewrites: {
    ':c0/readme.md': ':c0/index.md',
    ':c0/:c1/readme.md': ':c0/:c1/index.md',
    ':c0/:c1/:c2/readme.md': ':c0/:c1/:c2/index.md',
    ':c0/:c1/:c2/:c3/readme.md': ':c0/:c1/:c2/:c3/index.md',
    ':c0/:c1/:c2/:c3/:c4/readme.md': ':c0/:c1/:c2/:c3/:c4/index.md',
    ':c0/:c1/:c2/:c3/:c4/:c5/readme.md': ':c0/:c1/:c2/:c3/:c4/:c5/index.md',
    ':c0/:c1/:c2/:c3/:c4/:c5/:c6/readme.md': ':c0/:c1/:c2/:c3/:c4/:c5/:c6/index.md',
    ':c0/:c1/:c2/:c3/:c4/:c5/:c6/:c7/readme.md': ':c0/:c1/:c2/:c3/:c4/:c5/:c6/:c7/index.md',
    ':c0/:c1/:c2/:c3/:c4/:c5/:c6/:c7/:c8/readme.md': ':c0/:c1/:c2/:c3/:c4/:c5/:c6/:c7/:c8/index.md',
}
  • /folder/index.html
  • /folder/readme.html
  • /folder/
  rewrites: {
    ':c0/readme.html': ':c0/index.html',
    ':c0/:c1/readme.html': ':c0/:c1/index.html',
    ':c0/:c1/:c2/readme.html': ':c0/:c1/:c2/index.html',
    ':c0/:c1/:c2/:c3/readme.html': ':c0/:c1/:c2/:c3/index.html',
    ':c0/:c1/:c2/:c3/:c4/readme.html': ':c0/:c1/:c2/:c3/:c4/index.html',
    ':c0/:c1/:c2/:c3/:c4/:c5/readme.html': ':c0/:c1/:c2/:c3/:c4/:c5/index.html',
    ':c0/:c1/:c2/:c3/:c4/:c5/:c6/readme.html': ':c0/:c1/:c2/:c3/:c4/:c5/:c6/index.html',
    ':c0/:c1/:c2/:c3/:c4/:c5/:c6/:c7/readme.html': ':c0/:c1/:c2/:c3/:c4/:c5/:c6/:c7/index.html',
    ':c0/:c1/:c2/:c3/:c4/:c5/:c6/:c7/:c8/readme.html': ':c0/:c1/:c2/:c3/:c4/:c5/:c6/:c7/:c8/index.html',
  },
  • /folder/index.html
  • /folder/readme.html
  • /folder/
  rewrites: {
    '(.*)/readme.md': '(.*)/index.md'
  }
  • /folder/index.html
  • /folder/readme.html
  • /folder/
  rewrites: {
    '(.*)/readme.html': '(.*)/index.html'
  }
  • /folder/index.html
  • /folder/readme.html
  • /folder/
  rewrites: {
    '(.*)/readme': '(.*)/index'
  }
  • /folder/index.html
  • /folder/readme.html
  • /folder/

Some work in docs:dev, but not when built.

Reproduction

Add the rewrites to the config.mts
Create a folder named folder, add readme.md to it, and try to go to all 3 of these URLs:

  • localhost:5173/folder/
  • localhost:5173/folder/index.html
  • localhost:5173/folder/readme.html

Expected behavior

for /folder/index.md, /folder/readme.md, and /folder/ to lead to the same place.

System Info

╭─ cmd   Lodestone    main ≡  ~3   1m 44s 857ms⠀                  22.9.0   Zach@zPc-i1    3,00:55 
╰─ npx envinfo --system --npmPackages vitepress --binaries --browsers
Need to install the following packages:
[email protected]
Ok to proceed? (y) y


  System:
    OS: Windows 10 10.0.19044
    CPU: (12) x64 AMD Ryzen 5 3600 6-Core Processor
    Memory: 4.64 GB / 31.93 GB
  Binaries:
    Node: 22.9.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.8.3 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0)
    Internet Explorer: 11.0.19041.1202
  npmPackages:
    vitepress: ^1.4.2 => 1.4.2

Additional context

To me this seems like a bug but if it is not, and I'm doing it wrong, please redirect me to the correct place to get this answered/fixed.
Additionally I'm using vitepress-sidebar, which shows the Readme file and links to readme.html.

Validations

@DexrnZacAttack DexrnZacAttack added the bug: pending triage Maybe a bug, waiting for confirmation label Nov 3, 2024
@DexrnZacAttack
Copy link
Author

Apparently I wasn't on 1.4.3, but this does still happen after upgrading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: pending triage Maybe a bug, waiting for confirmation
Projects
None yet
Development

No branches or pull requests

1 participant