Skip to content

Commit

Permalink
docs: update configuration example
Browse files Browse the repository at this point in the history
  • Loading branch information
WRXinYue committed Aug 30, 2024
1 parent 3e44dd0 commit 9e685aa
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 239 deletions.
91 changes: 7 additions & 84 deletions demo/pages/posts/theme-sakura.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ date: 2024-12-31

**安装主题:**

~~~bash
```bash
# pnpm (推荐)
pnpm create valaxy

Expand All @@ -19,104 +19,27 @@ pnpm create valaxy
# yarn
# yarn create valaxy
pnpm add valaxy-theme-sakura
~~~
```

**启用主题:**

~~~ts
```ts
// valaxy.config.ts
import { defineConfig } from 'valaxy'
import type { ThemeUserConfig } from 'valaxy-theme-sakura'

export default defineValaxyConfig<ThemeUserConfig>({
theme: 'sakura'
})
~~~
```

**配置示例:**

~~~ts
// valaxy.config.ts
import { defineValaxyConfig } from 'valaxy'
import type { ThemeUserConfig } from 'valaxy-theme-sakura'

/**
* User Config
*/
export default defineValaxyConfig<ThemeUserConfig>({
// site config see site.config.ts

theme: 'sakura',

themeConfig: {
// colors: {
// primary: '#e67474',
// },

prefixName: 'かなしいの',
siteName: '心悦',

homeTitle: 'Hello, sakura',
homeMotto: 'You got to put the past behind you before you can move on.',

favicon: false, // 导航栏图标

banner: {
// 壁纸支持图片及视频
urls: [
'https://wrxinyue-images.s3.bitiful.net/wallpaper/Genshin Impact - Yae Miko (4) Cybust PC.mp4',
'https://wrxinyue-images.s3.bitiful.net/pc-wallpaper/wallhaven-yxwy7k.jpg'
],
// 背景样式选项:
// - '': 无特效,显示原图
// - 'filter-dim': 阴影效果
// - 'filter-grid': 横条效果
// - 'filter-dot': 点点效果
backgroundStyle: 'filter-dot',
},

// 导航栏
nav: [
{
text: 'GitHub',
icon: 'i-ri-github-fill',
link: 'https://github.com/WRXinYue/valaxy-theme-sakura',
},
{
text: 'RSS',
icon: 'i-ri-rss-fill',
link: '/atom.xml',
},
{
text: 'Discord',
icon: 'i-ri-discord-fill',
link: 'https://discord.gg/sGe4U4p4CK',
},
{
text: 'Valaxy →',
icon: 'i-ri-cloud-fill',
link: 'https://github.com/YunYouJun/valaxy',
},
],

// 页脚配置
footer: {
since: 2024,

icon: {
img: '/favicon.ico',
animated: true,
url: 'https://wrxinyue.org',
title: 'WRXinYue',
},
},
},
})
~~~
<<< @/valaxy.config.ts

**更新主题:**

~~~bash
```bash
pnpm up valaxy-theme-sakura --latest
# npm update valaxy-theme-sakura --latest
~~~
```
154 changes: 1 addition & 153 deletions docs/pages/examples/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,156 +11,4 @@ codeHeightLimit: 300

<https://github.com/WRXinYue/valaxy-theme-sakura/blob/main/demo/valaxy.config.ts>

~~~ts
// valaxy.config.ts
import { defineValaxyConfig } from 'valaxy'
import type { ThemeUserConfig } from 'valaxy-theme-sakura'

/**
* User Config
*/
export default defineValaxyConfig<ThemeUserConfig>({
// site config see site.config.ts

theme: 'sakura',

themeConfig: {
// colors: {
// primary: '#e67474', // 主题色
// },

navbarTitle: ['かなしい', '', '心悦'],

favicon: false, // 导航栏图标

banner: {
// 壁纸支持图片及视频
title: 'Hello, sakura',
motto: 'You got to put the past behind you before you can move on.',
urls: [
'https://wrxinyue-images.s3.bitiful.net/wallpaper/Genshin Impact - Yae Miko (4) Cybust PC.mp4',
'https://wrxinyue-images.s3.bitiful.net/pc-wallpaper/wallhaven-yxwy7k.jpg'
],
// 背景样式选项:
// - '': 无特效,显示原图
// - 'filter-dim': 阴影效果
// - 'filter-grid': 横条效果
// - 'filter-dot': 点点效果
style: '',
},

articlePinned: [
{
title: 'Valaxy Theme Sakura',
desc: '本站使用的 valaxy sakura 主题',
img: 'https://wrxinyue-images.s3.bitiful.net/pc-wallpaper/wallhaven-d6mryl.jpg',
link: 'https://github.com/WRXinYue/valaxy-theme-sakura',
},
{
title: 'Valaxy sakura theme docs',
desc: '主题文档',
img: 'https://wrxinyue-images.s3.bitiful.net/pc-wallpaper/wallhaven-gpxyed.jpg',
link: 'https://sakura.valaxy.site/',
},
{
title: '示例站点',
desc: 'https://sakura.wrxinyue.org/',
img: 'https://wrxinyue-images.s3.bitiful.net/pc-wallpaper/wallhaven-jxqgjw.jpg',
link: 'https://sakura.wrxinyue.org/',
},
],

pagination: {
animation: true,
infiniteScrollOptions: {
preload: true,
},
},

article: {
navigationMerge: true,
},

// 导航栏
navbar: [
{
text: '🌈 首页',
link: '/',
},
{
text: '📁 分类',
link: '/categories',
},
{
text: '🏷️ 标签',
link: '/tags',
},
{
text: '🔦 时光轴',
link: '/archives',
},
{
text: '🍻 友情链接',
link: '/links',
submenu: [
{
text: 'GitHub',
icon: 'i-ri-github-fill',
link: 'https://github.com/WRXinYue/valaxy-theme-sakura',
},
{
text: 'Discord',
icon: 'i-ri-discord-fill',
link: 'https://discord.gg/sGe4U4p4CK',
},
{
text: 'Valaxy →',
icon: 'i-ri-cloud-fill',
link: 'https://github.com/YunYouJun/valaxy',
},
],
},
{
text: 'RSS',
icon: 'i-ri-rss-fill',
link: 'https://sakura.wrxinyue.org/atom.xml',
},
],

sidebar: [
{
text: '首页',
icon: 'i-ri-home-4-line',
link: '/',
},
{
locale: 'menu.archives',
icon: 'i-ri-archive-line',
link: '/archives/',
},
{
locale: 'menu.categories',
icon: 'i-ri-folder-2-line',
link: '/categories/',
},
{
locale: 'menu.tags',
icon: 'i-ri-price-tag-3-line',
link: '/tags/',
},
],

// 页脚配置
footer: {
since: 2024,

icon: {
img: '/favicon-16x16.ico',
animated: true,
url: 'https://wrxinyue.org',
title: 'WRXinYue',
},
},
},
})
~~~
<<< @/../demo/valaxy.config.ts
2 changes: 0 additions & 2 deletions docs/pages/guide/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ end: true
top: 100
---

<TsdocTable />

## 安装{lang="zh-CN"}

## installation {lang="en"}
Expand Down

0 comments on commit 9e685aa

Please sign in to comment.