mirror of https://github.com/YunYouJun/valaxy
docs: update title icon for some code example
This commit is contained in:
parent
2e48f5461f
commit
b1d77e7a65
|
@ -78,12 +78,12 @@ useScriptTag('//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js')
|
|||
|
||||
:::
|
||||
|
||||
```txt
|
||||
```bash
|
||||
posts
|
||||
├─ your-post
|
||||
│ ├─ a.png
|
||||
| ├─ b.png
|
||||
│ └─ index.md
|
||||
└── your-post
|
||||
├── a.png
|
||||
├── b.png
|
||||
└── index.md
|
||||
```
|
||||
|
||||
```md [posts/your-post/index.md]
|
||||
|
|
|
@ -132,7 +132,7 @@ Built-in components are not available temporarily, public components are current
|
|||
|
||||
:::
|
||||
|
||||
```bash
|
||||
```bash [pnpm]
|
||||
pnpm add valaxy-addon-components
|
||||
```
|
||||
|
||||
|
@ -152,7 +152,7 @@ pnpm add valaxy-addon-components
|
|||
|
||||
:::
|
||||
|
||||
```md
|
||||
```md [pages/posts/your-post.md]
|
||||
My Blog Content
|
||||
|
||||
<CodePen class="h-300px" name="Margin Collapse" id="WqXGpo" user="YunYouJun" tab="html,result" />
|
||||
|
|
|
@ -34,8 +34,25 @@ See [UnoCSS | Markdown](/guide/markdown#unocss).
|
|||
|
||||
## unocss
|
||||
|
||||
您可以在主题 theme 目录的 `uno.config.ts` 或 `unocss.config.ts` 文件中编写 UnoCSS 配置。
|
||||
|
||||
```ts [uno.config.ts]
|
||||
import { defineConfig } from 'unocss'
|
||||
|
||||
export default defineConfig({
|
||||
shortcuts: [
|
||||
[
|
||||
'custom-uno-btn',
|
||||
'px-4 py-1 rounded inline-block bg-teal-700 text-white cursor-pointer !outline-none hover:bg-teal-800 disabled:cursor-default disabled:bg-gray-600 disabled:opacity-50'
|
||||
],
|
||||
]
|
||||
safelist: ['bg-red-500'],
|
||||
})
|
||||
|
||||
```
|
||||
|
||||
::: zh-CN
|
||||
您可以在主题 theme 目录的 `uno.config.ts` 或 `unocss.config.ts` 文件中编写 UnoCSS 配置,也可以在 `valaxy.config.ts` 文件的 `unocss` 配置项中进行配置。以下是 `valaxy.config.ts` 中 `unocss` 配置项的示例:
|
||||
也可以在 `valaxy.config.ts` 文件的 `unocss` 配置项中进行配置。以下是 `valaxy.config.ts` 中 `unocss` 配置项的示例:
|
||||
:::
|
||||
|
||||
::: en
|
||||
|
@ -62,7 +79,9 @@ export default defineValaxyConfig<ThemeConfig>({
|
|||
```
|
||||
|
||||
::: zh-CN
|
||||
在 `unocss` 配置项中直接配置 `presets` 会覆盖主题和 Valaxy 默认的 `presets`。如果想扩展这些预设,请使用 [unocssPresets](#unocsspresets)
|
||||
在 `unocss` 配置项中直接配置 `presets` 会覆盖主题和 Valaxy 默认的 `presets`。
|
||||
|
||||
如果想扩展这些预设,请使用 [unocssPresets](#unocsspresets)。
|
||||
:::
|
||||
|
||||
::: en
|
||||
|
|
|
@ -142,7 +142,7 @@ When you use `pnpm create valaxy` to create a template project, it contains the
|
|||
|
||||
对于已有的 Valaxy 博客,在开始部署之前,您需要先对您博客的 `vercel.json` 进行修改以便[启用 `cleanUrls` 支持](https://vercel.com/docs/projects/project-configuration#cleanurls):
|
||||
|
||||
```json
|
||||
```json [vercel.json]
|
||||
{
|
||||
"cleanUrls": true
|
||||
}
|
||||
|
@ -210,7 +210,7 @@ Here is an example of an Nginx server block configuration `nginx.conf`. This con
|
|||
|
||||
::: details nginx.conf
|
||||
|
||||
```nginx
|
||||
```nginx [nginx.conf]
|
||||
server {
|
||||
gzip on;
|
||||
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
||||
|
@ -279,7 +279,7 @@ Refer to the Nginx section for the `nginx.conf` configuration and place it in th
|
|||
|
||||
::: details Dockerfile
|
||||
|
||||
```Dockerfile
|
||||
```Dockerfile [Dockerfile]
|
||||
FROM node:20-alpine as build-stage
|
||||
|
||||
WORKDIR /app
|
||||
|
|
|
@ -99,7 +99,7 @@ export default defineSiteConfig({
|
|||
- Add fuse generation script in your `package.json`
|
||||
:::
|
||||
|
||||
```json {7,9}
|
||||
```json {7,9} [package.json]
|
||||
{
|
||||
"name": "yun-demo",
|
||||
"valaxy": {
|
||||
|
|
|
@ -53,7 +53,7 @@ Valaxy 默认集成了 [`@vitejs/plugin-vue`](https://github.com/vitejs/vite-plu
|
|||
|
||||
譬如使用 Element Plus,你可以在 `setup/main.ts` 中添加以下配置:
|
||||
|
||||
```ts
|
||||
```ts [setup/main.ts]
|
||||
import ElementPlus from 'element-plus'
|
||||
|
||||
import { defineAppSetup } from 'valaxy'
|
||||
|
|
|
@ -552,9 +552,15 @@ const { headers, handleClick } = useOutline()
|
|||
|
||||
譬如 `assets` 与 `components` 处于同一目录下时:
|
||||
|
||||
```vue
|
||||
<!-- assets/images/valaxy-logo.png -->
|
||||
<!-- components/ValaxyLogo.vue -->
|
||||
```bash
|
||||
├── components
|
||||
│ └── ValaxyLogo.vue
|
||||
└── assets
|
||||
└── images
|
||||
└── valaxy-logo.png
|
||||
```
|
||||
|
||||
```vue [components/ValaxyLogo.vue]
|
||||
<script lang="ts" setup>
|
||||
import valaxyLogoPng from '../assets/images/valaxy-logo.png'
|
||||
</script>
|
||||
|
|
|
@ -229,6 +229,9 @@ export default defineValaxyConfig<PressTheme.Config>({
|
|||
groupIcons: {
|
||||
customIcon: {
|
||||
valaxy: localIconLoader(import.meta.url, './public/favicon.svg'),
|
||||
docker: 'vscode-icons:file-type-docker',
|
||||
nginx: 'vscode-icons:file-type-nginx',
|
||||
toml: 'vscode-icons:file-type-toml',
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue