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

feat(build): support rewrites #1798

Merged
merged 13 commits into from Jan 27, 2023
Merged

feat(build): support rewrites #1798

merged 13 commits into from Jan 27, 2023

Conversation

brc-dd
Copy link
Member

@brc-dd brc-dd commented Jan 15, 2023

TODO (test/fix):

  • links (relative, absolute, fragments)
  • imports (js/vue, snippets, md)
  • fix hmr for */index.md remaps
  • improve perf
  • handle reload when a new file matching a pattern is created
  • (optional) support patterns (glob)
  • (optional) sort rewrites similar to sidebar?

Note: md includes and relative links are resolved relative to final path.

fixes #987
fixes #579
fixes #1160
closes #1429
fixes #280

demo: https://github.com/brc-dd/vitepress-rewrites-demo

@brc-dd brc-dd added enhancement New feature or request build Related to the build system labels Jan 15, 2023
@brc-dd brc-dd self-assigned this Jan 15, 2023
@brc-dd brc-dd marked this pull request as ready for review January 15, 2023 15:04
@brc-dd brc-dd changed the title feat(build): allow remapping pages feat(build): support rewrites Jan 20, 2023
@brc-dd brc-dd mentioned this pull request Jan 21, 2023
4 tasks
@brc-dd brc-dd marked this pull request as draft January 24, 2023 13:56
@brc-dd brc-dd marked this pull request as ready for review January 24, 2023 14:20
@kiaking
Copy link
Member

kiaking commented Jan 27, 2023

@brc-dd I've added the doc! Could you check if I have it correct? If it looks OK, I think we can merge this one 💪

docs/guide/routing.md Outdated Show resolved Hide resolved
docs/guide/routing.md Outdated Show resolved Hide resolved
@brc-dd
Copy link
Member Author

brc-dd commented Jan 27, 2023

Seems fine. I'll create a separate PR to stabilize cleanUrls, gonna drop the with-subfolders option. There is too much complexity because of that. And with rewrites, it will be possible to get results same as with-subfolders in two lines.

@brc-dd brc-dd merged commit 00abac6 into main Jan 27, 2023
@brc-dd brc-dd deleted the remap branch January 27, 2023 10:28
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
build Related to the build system enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Documentation in the same style as dumi feat: changeable entry file
2 participants