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

docs #11

Merged
merged 2 commits into from
Jul 5, 2024
Merged

docs #11

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 52 additions & 19 deletions docs/pages/config/site.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,39 @@ categories:
- config
---

## 站点配置
## 站点配置 {lang="zh-CN"}

## site config {lang="en"}

:::zh-CN
站点配置是任何主题都通用的,详情请见 [Valaxy 站点配置](https://valaxy.site/guide/config/#站点配置)
:::

:::en
Site configuration is applicable to any theme. For more details, see [Valaxy Site Configuration](https://valaxy.site/guide/config/#siteconfig).
:::

```ts
/**
* @zh 社交链接
* @en social links
*/
export interface SocialLink {
/**
* The title of your link
*@zh 您的链接的标题
*@en The title of your link
*/
name: string
link: string
/**
* 图标名称
*@zh 图标名称
*@en Icon name
* https://icones.js.org/
*/
icon: string
/**
* @zh 图标颜色
* @en locn color
*/
color: string
}
Expand All @@ -41,16 +53,21 @@ export interface RedirectItem {
to: string
}

// shared with valaxy node and client
// @en shared with valaxy node and client
// @zh 与 valaxy 节点和客户端共享
export interface SiteConfig {
/**
* enable auto (light/dark mode)
* @en enable auto (light/dark mode)
* @zh 启用自动(明/暗模式)
* @default 'auto'
*/
mode: 'light' | 'dark' | 'auto'
/**
* Default language
* @zh 默认语言
* @en Default language
*
* @description 默认语言,设置 `zh-CN` 以改变默认语言为中文
* @description Default language, set `zh-CN` to change the default language to Chinese.
* @default 'en'
*/
lang: string
Expand Down Expand Up @@ -81,11 +98,13 @@ export interface SiteConfig {
*/
title: string
/**
* 副标题
* @en subtitle
* @zh 副标题
*/
subtitle: string
/**
* 站点描述
* @en site description
* @zh 站点描述
*/
description: string
/**
Expand Down Expand Up @@ -116,12 +135,14 @@ export interface SiteConfig {
}

/**
* show last updated time by git/mtime
* @en show last updated time by git/mtime
* @zh 通过 git/mtime 显示上次更新时间
*/
lastUpdated: boolean

/**
* icon for your website
* @en icon for your website
* @zh 您网站的图标
*/
favicon: string

Expand All @@ -135,17 +156,20 @@ export interface SiteConfig {
}

/**
* 社交链接
*@en social links
*@zh 社交链接
*/
social: SocialLink[]

/**
* search
*@en search
*@zh 搜索
*/
search: {
enable: boolean
/**
* Search Type
* @en Search Type
* @zh 搜索类型
* - algolia: Algolia Search
* - engine: Engine Search, like Google/Baidu
* - fuse: Local Search by fuse.js
Expand Down Expand Up @@ -254,11 +278,13 @@ export interface SiteConfig {
}

/**
* image preview by medium-zoom
* @en image preview by medium-zoom\
* @zh 通过 medium-zoom进行图片预览
* @url https://github.com/francoischalifour/medium-zoom
*/
mediumZoom: {
/**
* @en Enable image preview
* @zh 启用图片预览
*/
enable: boolean
Expand All @@ -268,15 +294,19 @@ export interface SiteConfig {
*/
selector: string | HTMLElement | HTMLElement[]
/**
* @en config items
* @zh 配置项
* @see https://github.com/francoischalifour/medium-zoom#options
*/
options: ZoomOptions
}

/**
* lazyload by vanilla-lazyload and markdown-it-image-figures
* when vanillaLazyLoad.enable is true, imageFigures removeSrc is true, classes is 'lazy'
*@en lazyload by vanilla-lazyload and markdown-it-image-figures
*@zh markdown通过 vanilla-lazyload 和 markdown-it-image-figures 实现图片懒加载
*
*@en when vanillaLazyLoad.enable is true, imageFigures removeSrc is true, classes is 'lazy'
*@zh 当 vanillaLazyLoad.enable 为 true 时,imageFigures.removeSrc 为 true,classes 为 'lazy'。
* @see https://github.com/verlok/vanilla-lazyload
*/
vanillaLazyload: {
Expand All @@ -285,7 +315,8 @@ export interface SiteConfig {
}

/**
* displayed posts length in every page
*@en displayed posts length in every page
*@zh 每页显示的帖子长度
* @default 7
*/
pageSize: number
Expand Down Expand Up @@ -355,7 +386,8 @@ export type PartialDeep<T> = {
}

/**
* config generated by runtime
*@en config generated by runtime
*@zh 运行时生成的配置
*/
export interface RuntimeConfig {
addons: Record<string, ValaxyAddon>
Expand Down Expand Up @@ -387,7 +419,8 @@ export interface ValaxyConfig<ThemeConfig = DefaultTheme.Config> {
pkg: Pkg
}
/**
* generated by runtime
* @en generated by runtime
* @zh 由运行时生成
*/
runtimeConfig: RuntimeConfig
}
Expand Down
Loading