-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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(config): Hierarchical site configuration using distributed config files #4660
base: main
Are you sure you want to change the base?
feat(config): Hierarchical site configuration using distributed config files #4660
Conversation
…into feat/hierarchical-theme-config
An obvious downside is we can't use node stuff in configs. What if we glob and load all the configs at plugin-level instead of doing it via import.meta.glob in client code? We can create a virtual module that exports |
Also, the site appears to be broken. There is probably a circular dependency somewhere in generated code. |
/publish |
commit: |
This seems like a better solution. I'll try to adapt this approach. |
Updates:1. Removed
|
…tion overloading
Thanks a lot! 🙌 Overall looks good. I'll test some stuff locally and merge if nothing pops up. |
Summary of update:Code Cleanup
Typing Helper
There is no major change since last review. This PR should be ready to merge. |
Give me a day or two. I'll check everything and merge it by weekend. Got bit busy with day job. |
e9da2e4
to
787b825
Compare
The latest commit relocates config synthesis from |
…clarity." This reverts commit fb8d4e5.
ah it's failing on main too. I'll revert it |
Description
Summary of changes
src/client/app/data.ts:
initData()
to dynamically computesiteData
and apply extra configuration layers based onroute.relativePath
.src/client/app/utils.ts:
stackView()
and supporting utilities to merge multiple layers of objects into a readonly view, without mutating the original objects - this is important because certain layers may be dropped later when user navigates outside its scope.Configuration Files
The configuration files are moved from
.vitepress/config
to their corresponding language subdirectories (e.g.docs/.vitepress/config/en.ts
->docs/en/config.ts
) to demonstrate the benefits of the proposed changes. In addition, a language-specific locale is added for 404 pages under/zh/
directory. It is reflected in the rendered preview.Linked Issues
closes #4659
closes #4654
Additional Context
Please refer to the linked issue for highlights of this PR.
Tip
The author of this PR can publish a preview release by commenting
/publish
below./publish