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

fix: make MD includes work with rewrites #1898

Merged
merged 5 commits into from Mar 24, 2023
Merged

fix: make MD includes work with rewrites #1898

merged 5 commits into from Mar 24, 2023

Conversation

chgeo
Copy link
Contributor

@chgeo chgeo commented Feb 6, 2023

Fixes #1961

At the moment, any MD inclusion like `<!--@include: ...-->` do not work
within nested packages that are configured with rewrites.

Demo is in https://github.com/chgeo/vitepress-rewrites-demo (fork of your rewrite demo repo).
There, `packages/package-a/src/index.md` cannot resolve the sibling file `include.md` through
 `<!--@include: ./include.md-->`

The fix is simple to not use a rewrite alias here, but to treat include file paths as strict
relative paths.
@brc-dd brc-dd self-assigned this Feb 11, 2023
@brc-dd
Copy link
Member

brc-dd commented Feb 20, 2023

Hey can you run pnpm format and commit changes?

@chgeo
Copy link
Contributor Author

chgeo commented Feb 20, 2023

Hey can you run pnpm format and commit changes?

Done.

@chgeo
Copy link
Contributor Author

chgeo commented Feb 28, 2023

@brc-dd Can we merge this? Anything that is missing?

@brc-dd
Copy link
Member

brc-dd commented Feb 28, 2023

Anything that is missing?

I need to test it. Also, Evan was working on dynamic routes which are sort of linked. So I'm trying to avoid conflicts currently. Let him finish. We can merge this later.

Also, includes work with rewrites. But currently they are being resolved to the final path. Like if you have rewritten foo/a.md to bar/a.md, and you want to include b.md, you need to keep it in bar/.

@chgeo
Copy link
Contributor Author

chgeo commented Feb 28, 2023

Alright, then I'll be patient :)

@brc-dd brc-dd merged commit 3553f01 into vuejs:main Mar 24, 2023
7 checks passed
@chgeo chgeo deleted the patch-1 branch March 25, 2023 19:47
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MD includes do not work with rewrites
2 participants