docs: support custom component VT

This commit is contained in:
YunYouJun 2025-07-15 00:38:34 +08:00
parent 95cc709d19
commit 4ec6057386
4 changed files with 110 additions and 48 deletions

View File

@ -55,18 +55,18 @@ Built for theme developers (common users usually do not need to use them directl
</div>
::: zh-CN
### 布局与渲染 {lang="zh-CN"}
### 布局与渲染
::: zh-CN
- [`ValaxyMain.vue`](https://github.com/YunYouJun/valaxy/blob/main/packages/valaxy/client/components/ValaxyMain.vue): 页面基础布局
- [`ValaxyMd.vue`](https://github.com/YunYouJun/valaxy/blob/main/packages/valaxy/client/components/ValaxyMd.vue): Markdown 渲染内容
:::
::: en
### Layout and Rendering {lang="en"}
### Layout and Rendering
::: en
- [`ValaxyMain.vue`](https://github.com/YunYouJun/valaxy/blob/main/packages/valaxy/client/components/ValaxyMain.vue): Basic page layout
- [`ValaxyMd.vue`](https://github.com/YunYouJun/valaxy/blob/main/packages/valaxy/client/components/ValaxyMd.vue): Rendered Markdown content
@ -117,11 +117,13 @@ Built for theme developers (common users usually do not need to use them directl
## Helper Components {lang="en"}
### 内置组件
::: zh-CN
> 面向用户,可直接使用
内置组件暂无,目前通过 [valaxy-addon-components](https://github.com/YunYouJun/valaxy/tree/main/packages/valaxy-addon-components) 扩展公共组件。
你也可以通过 [valaxy-addon-components](https://github.com/YunYouJun/valaxy/tree/main/packages/valaxy-addon-components) 扩展公共组件。
:::
@ -129,10 +131,33 @@ Built for theme developers (common users usually do not need to use them directl
> For users, can be used directly.
Built-in components are not available temporarily, public components are currently extended through [valaxy-addon-components](https://github.com/YunYouJun/valaxy/tree/main/packages/valaxy-addon-components).
You can also extend public components by [valaxy-addon-components](https://github.com/YunYouJun/valaxy/tree/main/packages/valaxy-addon-components).
:::
#### 国际化组件 `<VT />` {lang="zh-CN"}
#### Internationalization Component `<VT />` {lang="en"}
```yaml [locales/zh-CN.yml]
menu:
posts: 博客文章
```
```yaml [locales/en.yml]
menu:
posts: Posts
```
```md
<!-- auto follow locale -->
<VT content="menu.posts" />
```
<VT content="menu.posts" />
### 扩展公共组件
```bash [pnpm]
pnpm add valaxy-addon-components
```

View File

@ -66,7 +66,7 @@
"@clack/prompts": "^0.11.0",
"@iconify-json/ri": "catalog:build",
"@intlify/unplugin-vue-i18n": "^6.0.8",
"@shikijs/transformers": "^3.7.0",
"@shikijs/transformers": "^3.8.0",
"@types/katex": "^0.16.7",
"@unhead/addons": "catalog:build",
"@unhead/schema-org": "catalog:build",
@ -122,7 +122,7 @@
"qrcode": "^1.5.4",
"resolve-global": "^2.0.0",
"sass": "^1.89.2",
"shiki": "^3.7.0",
"shiki": "^3.8.0",
"star-markdown-css": "^0.5.3",
"table": "^6.9.0",
"unhead": "catalog:build",

View File

@ -19,8 +19,8 @@ catalogs:
specifier: ^1.2.5
version: 1.2.5
'@iconify-json/simple-icons':
specifier: ^1.2.42
version: 1.2.42
specifier: ^1.2.43
version: 1.2.43
'@iconify-json/vscode-icons':
specifier: ^1.2.23
version: 1.2.23
@ -52,8 +52,8 @@ catalogs:
specifier: ^11.1.9
version: 11.1.9
zx:
specifier: ^8.7.0
version: 8.7.0
specifier: ^8.7.1
version: 8.7.1
frontend:
'@primevue/themes':
specifier: ^4.3.6
@ -198,7 +198,7 @@ importers:
version: 2.2.0(typescript@5.8.3)
zx:
specifier: catalog:build
version: 8.7.0
version: 8.7.1
api:
devDependencies:
@ -235,7 +235,7 @@ importers:
version: 1.2.5
'@iconify-json/simple-icons':
specifier: catalog:build
version: 1.2.42
version: 1.2.43
demo/yun:
dependencies:
@ -303,7 +303,7 @@ importers:
version: 1.2.10
'@iconify-json/simple-icons':
specifier: catalog:build
version: 1.2.42
version: 1.2.43
nodemon:
specifier: ^3.1.10
version: 3.1.10
@ -429,8 +429,8 @@ importers:
specifier: ^6.0.8
version: 6.0.8(@vue/compiler-dom@3.5.17)(eslint@9.31.0(jiti@2.4.2))(rollup@4.45.0)(typescript@5.8.3)(vue-i18n@11.1.9(vue@3.5.17(typescript@5.8.3)))(vue@3.5.17(typescript@5.8.3))
'@shikijs/transformers':
specifier: ^3.7.0
version: 3.7.0
specifier: ^3.8.0
version: 3.8.0
'@types/katex':
specifier: ^0.16.7
version: 0.16.7
@ -597,8 +597,8 @@ importers:
specifier: ^1.89.2
version: 1.89.2
shiki:
specifier: ^3.7.0
version: 3.7.0
specifier: ^3.8.0
version: 3.8.0
star-markdown-css:
specifier: ^0.5.3
version: 0.5.3
@ -817,7 +817,7 @@ importers:
version: 1.2.5
'@iconify-json/simple-icons':
specifier: catalog:build
version: 1.2.42
version: 1.2.43
'@vueuse/motion':
specifier: ^3.0.3
version: 3.0.3(vue@3.5.17(typescript@5.8.3))
@ -845,7 +845,7 @@ importers:
devDependencies:
zx:
specifier: catalog:build
version: 8.7.0
version: 8.7.1
packages:
@ -1568,6 +1568,9 @@ packages:
'@iconify-json/simple-icons@1.2.42':
resolution: {integrity: sha512-G/EED0hUV1wMNUsWaFdQYLibm6SO7rP2GZP1+CvhszB5WAFYYibD3zoWp3X96xSIWpYQFvccvE17ewpd0Q1hWQ==}
'@iconify-json/simple-icons@1.2.43':
resolution: {integrity: sha512-JERgKGFRfZdyjGyTvVBVW5rftahy9tNUX+P+0QUnbaAEWvEMexXHE9863YVMVrIRhoj/HybGsibg8ZWieo/NDg==}
'@iconify-json/vscode-icons@1.2.23':
resolution: {integrity: sha512-gFTcKecKra2/b5SbGDgHGI/l8CuikHyBPmqGlK+YCmS8AK72dtDQbUekdoACsju/3TYS37QvdPoOQwnyx2LdYg==}
@ -2130,8 +2133,8 @@ packages:
'@shikijs/core@2.5.0':
resolution: {integrity: sha512-uu/8RExTKtavlpH7XqnVYBrfBkUc20ngXiX9NSrBhOVZYv/7XQRKUyhtkeflY5QsxC0GbJThCerruZfsUaSldg==}
'@shikijs/core@3.7.0':
resolution: {integrity: sha512-yilc0S9HvTPyahHpcum8eonYrQtmGTU0lbtwxhA6jHv4Bm1cAdlPFRCJX4AHebkCm75aKTjjRAW+DezqD1b/cg==}
'@shikijs/core@3.8.0':
resolution: {integrity: sha512-gWt8NNZFurL6FMESO4lEsmspDh0H1fyUibhx1NnEH/S3kOXgYiWa6ZFqy+dcjBLhZqCXsepuUaL1QFXk6PrpsQ==}
'@shikijs/engine-javascript@1.29.2':
resolution: {integrity: sha512-iNEZv4IrLYPv64Q6k7EPpOCE/nuvGiKl7zxdq0WFuRPF5PAE9PRo2JGq/d8crLusM59BRemJ4eOqrFrC4wiQ+A==}
@ -2139,8 +2142,8 @@ packages:
'@shikijs/engine-javascript@2.5.0':
resolution: {integrity: sha512-VjnOpnQf8WuCEZtNUdjjwGUbtAVKuZkVQ/5cHy/tojVVRIRtlWMYVjyWhxOmIq05AlSOv72z7hRNRGVBgQOl0w==}
'@shikijs/engine-javascript@3.7.0':
resolution: {integrity: sha512-0t17s03Cbv+ZcUvv+y33GtX75WBLQELgNdVghnsdhTgU3hVcWcMsoP6Lb0nDTl95ZJfbP1mVMO0p3byVh3uuzA==}
'@shikijs/engine-javascript@3.8.0':
resolution: {integrity: sha512-IBULFFpQ1N5Cg/C7jPCGnjIKz72CcRtD0BIbNhSuXPUOxLG0bF1URsP/uLfxQFQ9ORfunCQwL7UuSX1RSRBwUQ==}
'@shikijs/engine-oniguruma@1.29.2':
resolution: {integrity: sha512-7iiOx3SG8+g1MnlzZVDYiaeHe7Ez2Kf2HrJzdmGwkRisT7r4rak0e655AcM/tF9JG/kg5fMNYlLLKglbN7gBqA==}
@ -2151,6 +2154,9 @@ packages:
'@shikijs/engine-oniguruma@3.7.0':
resolution: {integrity: sha512-5BxcD6LjVWsGu4xyaBC5bu8LdNgPCVBnAkWTtOCs/CZxcB22L8rcoWfv7Hh/3WooVjBZmFtyxhgvkQFedPGnFw==}
'@shikijs/engine-oniguruma@3.8.0':
resolution: {integrity: sha512-Tx7kR0oFzqa+rY7t80LjN8ZVtHO3a4+33EUnBVx2qYP3fGxoI9H0bvnln5ySelz9SIUTsS0/Qn+9dg5zcUMsUw==}
'@shikijs/langs@1.29.2':
resolution: {integrity: sha512-FIBA7N3LZ+223U7cJDUYd5shmciFQlYkFXlkKVaHsCPgfVLiO+e12FmQE6Tf9vuyEsFe3dIl8qGWKXgEHL9wmQ==}
@ -2160,6 +2166,9 @@ packages:
'@shikijs/langs@3.7.0':
resolution: {integrity: sha512-1zYtdfXLr9xDKLTGy5kb7O0zDQsxXiIsw1iIBcNOO8Yi5/Y1qDbJ+0VsFoqTlzdmneO8Ij35g7QKF8kcLyznCQ==}
'@shikijs/langs@3.8.0':
resolution: {integrity: sha512-mfGYuUgjQ5GgXinB5spjGlBVhG2crKRpKkfADlp8r9k/XvZhtNXxyOToSnCEnF0QNiZnJjlt5MmU9PmhRdwAbg==}
'@shikijs/themes@1.29.2':
resolution: {integrity: sha512-i9TNZlsq4uoyqSbluIcZkmPL9Bfi3djVxRnofUHwvx/h6SRW3cwgBC5SML7vsDcWyukY0eCzVN980rqP6qNl9g==}
@ -2169,14 +2178,17 @@ packages:
'@shikijs/themes@3.7.0':
resolution: {integrity: sha512-VJx8497iZPy5zLiiCTSIaOChIcKQwR0FebwE9S3rcN0+J/GTWwQ1v/bqhTbpbY3zybPKeO8wdammqkpXc4NVjQ==}
'@shikijs/themes@3.8.0':
resolution: {integrity: sha512-yaZiLuyO23sXe16JFU76KyUMTZCJi4EMQKIrdQt7okoTzI4yAaJhVXT2Uy4k8yBIEFRiia5dtD7gC1t8m6y3oQ==}
'@shikijs/transformers@1.29.2':
resolution: {integrity: sha512-NHQuA+gM7zGuxGWP9/Ub4vpbwrYCrho9nQCLcCPfOe3Yc7LOYwmSuhElI688oiqIXk9dlZwDiyAG9vPBTuPJMA==}
'@shikijs/transformers@2.5.0':
resolution: {integrity: sha512-SI494W5X60CaUwgi8u4q4m4s3YAFSxln3tzNjOSYqq54wlVgz0/NbbXEb3mdLbqMBztcmS7bVTaEd2w0qMmfeg==}
'@shikijs/transformers@3.7.0':
resolution: {integrity: sha512-VplaqIMRNsNOorCXJHkbF5S0pT6xm8Z/s7w7OPZLohf8tR93XH0krvUafpNy/ozEylrWuShJF0+ftEB+wFRwGA==}
'@shikijs/transformers@3.8.0':
resolution: {integrity: sha512-EleKVjNH5Me8yhTtnYD5QGFtY7Acu2HJAWNmDjuOC/Egwt7n31p2nbyBhBqGz5cpdwa1wZkLdVgj/LsZ3ReyAQ==}
'@shikijs/types@1.29.2':
resolution: {integrity: sha512-VJjK0eIijTZf0QSTODEXCqinjBn0joAHQ+aPSBzrv4O2d/QSbsMw+ZeSRx03kV34Hy7NzUvV/7NqfYGRLrASmw==}
@ -2187,6 +2199,9 @@ packages:
'@shikijs/types@3.7.0':
resolution: {integrity: sha512-MGaLeaRlSWpnP0XSAum3kP3a8vtcTsITqoEPYdt3lQG3YCdQH4DnEhodkYcNMcU0uW0RffhoD1O3e0vG5eSBBg==}
'@shikijs/types@3.8.0':
resolution: {integrity: sha512-I/b/aNg0rP+kznVDo7s3UK8jMcqEGTtoPDdQ+JlQ2bcJIyu/e2iRvl42GLIDMK03/W1YOHOuhlhQ7aM+XbKUeg==}
'@shikijs/vscode-textmate@10.0.2':
resolution: {integrity: sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==}
@ -6540,8 +6555,8 @@ packages:
shiki@2.5.0:
resolution: {integrity: sha512-mI//trrsaiCIPsja5CNfsyNOqgAZUb6VpJA+340toL42UpzQlXpwRV9nch69X6gaUxrr9kaOOa6e3y3uAkGFxQ==}
shiki@3.7.0:
resolution: {integrity: sha512-ZcI4UT9n6N2pDuM2n3Jbk0sR4Swzq43nLPgS/4h0E3B/NrFn2HKElrDtceSf8Zx/OWYOo7G1SAtBLypCp+YXqg==}
shiki@3.8.0:
resolution: {integrity: sha512-yPqK0y68t20aakv+3aMTpUMJZd6UHaBY2/SBUDowh9M70gVUwqT0bf7Kz5CWG0AXfHtFvXCHhBBHVAzdp0ILoQ==}
side-channel-list@1.0.0:
resolution: {integrity: sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==}
@ -7667,8 +7682,8 @@ packages:
zwitch@2.0.4:
resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==}
zx@8.7.0:
resolution: {integrity: sha512-pArftqj5JV/er8p+czFZwF+k6SbCldl7kcfCR+rIiDIh3gUsLB0F3Xh05diP8PzToZ39D/GWeFoVFimjHQkbAg==}
zx@8.7.1:
resolution: {integrity: sha512-28u1w2LlIfvyvJvYe6pmCipesk8oL5AFMVp+P/U445LcaPgzrU5lNDtAPd6nJvWmoCNyXZz37R/xKOGokccjsw==}
engines: {node: '>= 12.17.0'}
hasBin: true
@ -8449,6 +8464,10 @@ snapshots:
dependencies:
'@iconify/types': 2.0.0
'@iconify-json/simple-icons@1.2.43':
dependencies:
'@iconify/types': 2.0.0
'@iconify-json/vscode-icons@1.2.23':
dependencies:
'@iconify/types': 2.0.0
@ -9073,9 +9092,9 @@ snapshots:
'@types/hast': 3.0.4
hast-util-to-html: 9.0.5
'@shikijs/core@3.7.0':
'@shikijs/core@3.8.0':
dependencies:
'@shikijs/types': 3.7.0
'@shikijs/types': 3.8.0
'@shikijs/vscode-textmate': 10.0.2
'@types/hast': 3.0.4
hast-util-to-html: 9.0.5
@ -9092,9 +9111,9 @@ snapshots:
'@shikijs/vscode-textmate': 10.0.2
oniguruma-to-es: 3.1.1
'@shikijs/engine-javascript@3.7.0':
'@shikijs/engine-javascript@3.8.0':
dependencies:
'@shikijs/types': 3.7.0
'@shikijs/types': 3.8.0
'@shikijs/vscode-textmate': 10.0.2
oniguruma-to-es: 4.3.3
@ -9113,6 +9132,11 @@ snapshots:
'@shikijs/types': 3.7.0
'@shikijs/vscode-textmate': 10.0.2
'@shikijs/engine-oniguruma@3.8.0':
dependencies:
'@shikijs/types': 3.8.0
'@shikijs/vscode-textmate': 10.0.2
'@shikijs/langs@1.29.2':
dependencies:
'@shikijs/types': 1.29.2
@ -9125,6 +9149,10 @@ snapshots:
dependencies:
'@shikijs/types': 3.7.0
'@shikijs/langs@3.8.0':
dependencies:
'@shikijs/types': 3.8.0
'@shikijs/themes@1.29.2':
dependencies:
'@shikijs/types': 1.29.2
@ -9137,6 +9165,10 @@ snapshots:
dependencies:
'@shikijs/types': 3.7.0
'@shikijs/themes@3.8.0':
dependencies:
'@shikijs/types': 3.8.0
'@shikijs/transformers@1.29.2':
dependencies:
'@shikijs/core': 1.29.2
@ -9147,10 +9179,10 @@ snapshots:
'@shikijs/core': 2.5.0
'@shikijs/types': 2.5.0
'@shikijs/transformers@3.7.0':
'@shikijs/transformers@3.8.0':
dependencies:
'@shikijs/core': 3.7.0
'@shikijs/types': 3.7.0
'@shikijs/core': 3.8.0
'@shikijs/types': 3.8.0
'@shikijs/types@1.29.2':
dependencies:
@ -9167,6 +9199,11 @@ snapshots:
'@shikijs/vscode-textmate': 10.0.2
'@types/hast': 3.0.4
'@shikijs/types@3.8.0':
dependencies:
'@shikijs/vscode-textmate': 10.0.2
'@types/hast': 3.0.4
'@shikijs/vscode-textmate@10.0.2': {}
'@sindresorhus/merge-streams@4.0.0': {}
@ -14185,14 +14222,14 @@ snapshots:
'@shikijs/vscode-textmate': 10.0.2
'@types/hast': 3.0.4
shiki@3.7.0:
shiki@3.8.0:
dependencies:
'@shikijs/core': 3.7.0
'@shikijs/engine-javascript': 3.7.0
'@shikijs/engine-oniguruma': 3.7.0
'@shikijs/langs': 3.7.0
'@shikijs/themes': 3.7.0
'@shikijs/types': 3.7.0
'@shikijs/core': 3.8.0
'@shikijs/engine-javascript': 3.8.0
'@shikijs/engine-oniguruma': 3.8.0
'@shikijs/langs': 3.8.0
'@shikijs/themes': 3.8.0
'@shikijs/types': 3.8.0
'@shikijs/vscode-textmate': 10.0.2
'@types/hast': 3.0.4
@ -15655,4 +15692,4 @@ snapshots:
zwitch@2.0.4: {}
zx@8.7.0: {}
zx@8.7.1: {}

View File

@ -13,7 +13,7 @@ catalogs:
'@iconify-json/carbon': ^1.2.10
'@iconify-json/logos': ^1.2.4
'@iconify-json/ri': ^1.2.5
'@iconify-json/simple-icons': ^1.2.42
'@iconify-json/simple-icons': ^1.2.43
'@iconify-json/vscode-icons': ^1.2.23
'@unhead/addons': ^2.0.12
'@unhead/schema-org': ^2.0.12
@ -25,7 +25,7 @@ catalogs:
unplugin-vue-router: ^0.14.0
vite: ^7.0.4
vue-i18n: ^11.1.9
zx: ^8.7.0
zx: ^8.7.1
frontend:
'@primevue/themes': ^4.3.6
primevue: ^4.3.6