valaxy 0.6.2 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/components/PostCard.vue +26 -29
- package/client/config.ts +1 -1
- package/client/index.ts +5 -0
- package/client/locales/en.yml +18 -17
- package/client/locales/zh-CN.yml +5 -4
- package/client/main.ts +3 -0
- package/client/setup/main.ts +11 -0
- package/client/setups.ts +16 -0
- package/client/styles/common/custom-blocks.scss +7 -0
- package/client/styles/common/markdown.scss +0 -4
- package/dist/chunk-35O5DRGK.mjs +2270 -0
- package/dist/chunk-4VSND5ZW.mjs +1 -0
- package/dist/chunk-CDIW2WTI.js +1 -0
- package/dist/chunk-RGBLPQZ2.js +2270 -0
- package/dist/{index.d.ts → client/index.d.ts} +16 -160
- package/dist/client/index.js +1 -0
- package/dist/client/index.mjs +1 -0
- package/dist/index-a6b0a69b.d.ts +16 -0
- package/dist/{config-112ac884.d.ts → index-afca77df.d.ts} +223 -6
- package/dist/node/cli.js +13 -8
- package/dist/node/cli.mjs +13 -8
- package/dist/node/index.d.ts +13 -35
- package/dist/node/index.js +1 -1
- package/dist/node/index.mjs +1 -1
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.js +1 -0
- package/dist/types/index.mjs +0 -0
- package/package.json +27 -22
- package/shared/index.ts +19 -0
- package/config/index.ts +0 -18
- package/dist/chunk-23IW567G.mjs +0 -40
- package/dist/chunk-EAN2KU6W.mjs +0 -1
- package/dist/chunk-U5OMNIOK.js +0 -1
- package/dist/chunk-YUC5WP5Y.js +0 -40
- package/dist/index.js +0 -1
- package/dist/index.mjs +0 -1
- package/index.ts +0 -3
- package/node/build.ts +0 -31
- package/node/cli.ts +0 -192
- package/node/config.ts +0 -156
- package/node/index.ts +0 -1
- package/node/markdown/check.ts +0 -14
- package/node/markdown/highlight.ts +0 -38
- package/node/markdown/index.ts +0 -109
- package/node/markdown/markdown-it/container.ts +0 -61
- package/node/markdown/markdown-it/headings.ts +0 -32
- package/node/markdown/markdown-it/highlightLines.ts +0 -96
- package/node/markdown/markdown-it/katex.ts +0 -210
- package/node/markdown/markdown-it/parseHeader.ts +0 -72
- package/node/markdown/markdownToVue.ts +0 -275
- package/node/markdown/slugify.ts +0 -24
- package/node/options.ts +0 -108
- package/node/plugins/extendConfig.ts +0 -46
- package/node/plugins/index.ts +0 -224
- package/node/plugins/preset.ts +0 -186
- package/node/plugins/unocss.ts +0 -110
- package/node/plugins/valaxy.ts +0 -1
- package/node/rss.ts +0 -127
- package/node/server.ts +0 -23
- package/node/shims.d.ts +0 -33
- package/node/utils/cli.ts +0 -103
- package/node/utils/getGitTimestamp.ts +0 -13
- package/node/utils/index.ts +0 -59
- package/node/utils/net.ts +0 -20
- package/node/vite.ts +0 -52
- package/tsup.config.ts +0 -25
- package/types/config.ts +0 -217
- package/types/data.ts +0 -31
- package/types/index.ts +0 -3
- package/types/posts.ts +0 -122
package/node/server.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { InlineConfig } from 'vite'
|
|
2
|
-
import { createServer as createViteServer, mergeConfig } from 'vite'
|
|
3
|
-
|
|
4
|
-
import type { ResolvedValaxyOptions, ValaxyServerOptions } from './options'
|
|
5
|
-
import { createViteConfig } from './vite'
|
|
6
|
-
|
|
7
|
-
export async function createServer(
|
|
8
|
-
options: ResolvedValaxyOptions,
|
|
9
|
-
viteConfig: InlineConfig = {},
|
|
10
|
-
serverOptions: ValaxyServerOptions = {},
|
|
11
|
-
) {
|
|
12
|
-
// default editor vscode
|
|
13
|
-
process.env.EDITOR = process.env.EDITOR || 'code'
|
|
14
|
-
|
|
15
|
-
const server = await createViteServer(
|
|
16
|
-
mergeConfig(
|
|
17
|
-
viteConfig,
|
|
18
|
-
await createViteConfig(options, serverOptions),
|
|
19
|
-
),
|
|
20
|
-
)
|
|
21
|
-
|
|
22
|
-
return server
|
|
23
|
-
}
|
package/node/shims.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
declare module 'escape-html' {
|
|
2
|
-
const def: (str: string) => string
|
|
3
|
-
export default def
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
declare module 'markdown-it-attrs' {
|
|
7
|
-
const def: any
|
|
8
|
-
export default def
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
declare module 'markdown-it-emoji' {
|
|
12
|
-
const def: any
|
|
13
|
-
export default def
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
declare module 'markdown-it-table-of-contents' {
|
|
17
|
-
const def: any
|
|
18
|
-
export default def
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
declare module 'markdown-it-container' {
|
|
22
|
-
const def: any
|
|
23
|
-
export default def
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
declare module 'markdown-it-task-lists' {
|
|
27
|
-
const def: any
|
|
28
|
-
export default def
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
declare module 'diacritics' {
|
|
32
|
-
export const remove: (str: string) => string
|
|
33
|
-
}
|
package/node/utils/cli.ts
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import * as readline from 'readline'
|
|
2
|
-
import path from 'path'
|
|
3
|
-
import os from 'os'
|
|
4
|
-
|
|
5
|
-
import { blue, bold, cyan, dim, gray, green, underline } from 'kolorist'
|
|
6
|
-
import consola from 'consola'
|
|
7
|
-
import type { InlineConfig, ViteDevServer } from 'vite'
|
|
8
|
-
import { createServer } from '../server'
|
|
9
|
-
import type { ResolvedValaxyOptions } from '../options'
|
|
10
|
-
import { version } from '../../package.json'
|
|
11
|
-
import { createSafelist } from '../plugins/unocss'
|
|
12
|
-
|
|
13
|
-
let server: ViteDevServer | undefined
|
|
14
|
-
|
|
15
|
-
export function printInfo(options: ResolvedValaxyOptions, port?: number, remote?: string | boolean) {
|
|
16
|
-
console.log()
|
|
17
|
-
console.log(` ${bold('🌌 Valaxy')} ${blue(`v${version}`)}`)
|
|
18
|
-
console.log()
|
|
19
|
-
console.log(`${dim(' 🪐 theme ')} > ${(options.theme ? green(options.theme) : gray('none'))}`)
|
|
20
|
-
console.log(` ${dim('📁')} ${dim(path.resolve(options.userRoot))}`)
|
|
21
|
-
if (port) {
|
|
22
|
-
console.log()
|
|
23
|
-
console.log(`${dim(' Preview ')} > ${cyan(`http://localhost:${bold(port)}/`)}`)
|
|
24
|
-
|
|
25
|
-
if (remote) {
|
|
26
|
-
Object.values(os.networkInterfaces())
|
|
27
|
-
.forEach(v => (v || [])
|
|
28
|
-
.filter(details => details.family === 'IPv4' && !details.address.includes('127.0.0.1'))
|
|
29
|
-
.forEach(({ address }) => {
|
|
30
|
-
console.log(`${dim(' Network ')} > ${blue(`http://${address}:${bold(port)}/`)}`)
|
|
31
|
-
}),
|
|
32
|
-
)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
console.log()
|
|
36
|
-
console.log(`${dim(' shortcuts ')} > ${underline('r')}${dim('estart | ')}${underline('o')}${dim('pen | ')}${underline('e')}${dim('dit')}`)
|
|
37
|
-
}
|
|
38
|
-
console.log()
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export async function initServer(options: ResolvedValaxyOptions, viteConfig: InlineConfig) {
|
|
42
|
-
if (server)
|
|
43
|
-
await server.close()
|
|
44
|
-
|
|
45
|
-
try {
|
|
46
|
-
const safelist = (await createSafelist(options.config)).concat(options.config.unocss.safelist || [])
|
|
47
|
-
|
|
48
|
-
server = await createServer(options, viteConfig, {
|
|
49
|
-
onConfigReload(newConfig, config) {
|
|
50
|
-
let reload = false
|
|
51
|
-
|
|
52
|
-
const iconChanged = newConfig.social.some((item, i) => {
|
|
53
|
-
return !safelist.includes(item.icon) && item.icon !== config.social[i].icon
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
if (iconChanged) {
|
|
57
|
-
consola.info('Find new icon, reload server...')
|
|
58
|
-
consola.info(`If you do not want to reload it, write icon name in ${green('config.unocss.safelist')}.`)
|
|
59
|
-
consola.info('For example: ["i-ri-cloud-line"]')
|
|
60
|
-
console.log()
|
|
61
|
-
reload = true
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
if (reload)
|
|
65
|
-
initServer(options, viteConfig)
|
|
66
|
-
},
|
|
67
|
-
})
|
|
68
|
-
await server.listen()
|
|
69
|
-
}
|
|
70
|
-
catch (e) {
|
|
71
|
-
consola.error('failed to start server. error:\n')
|
|
72
|
-
console.error(e)
|
|
73
|
-
process.exit(1)
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* bind shortcut for terminal
|
|
79
|
-
*/
|
|
80
|
-
export function bindShortcut(SHORTCUTS: { name: string; fullName: string; action: () => void }[]) {
|
|
81
|
-
process.stdin.resume()
|
|
82
|
-
process.stdin.setEncoding('utf8')
|
|
83
|
-
readline.emitKeypressEvents(process.stdin)
|
|
84
|
-
if (process.stdin.isTTY)
|
|
85
|
-
process.stdin.setRawMode(true)
|
|
86
|
-
|
|
87
|
-
process.stdin.on('keypress', (str, key) => {
|
|
88
|
-
if (key.ctrl && key.name === 'c') {
|
|
89
|
-
process.exit()
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
const [sh] = SHORTCUTS.filter(item => item.name === str)
|
|
93
|
-
if (sh) {
|
|
94
|
-
try {
|
|
95
|
-
sh.action()
|
|
96
|
-
}
|
|
97
|
-
catch (err) {
|
|
98
|
-
console.error(`Failed to execute shortcut ${sh.fullName}`, err)
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
})
|
|
103
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { spawn } from 'cross-spawn'
|
|
2
|
-
|
|
3
|
-
export function getGitTimestamp(file: string) {
|
|
4
|
-
return new Promise<number>((resolve, reject) => {
|
|
5
|
-
const child = spawn('git', ['log', '-1', '--pretty="%ci"', file])
|
|
6
|
-
let output = ''
|
|
7
|
-
child.stdout.on('data', d => (output += String(d)))
|
|
8
|
-
child.on('close', () => {
|
|
9
|
-
resolve(+new Date(output))
|
|
10
|
-
})
|
|
11
|
-
child.on('error', reject)
|
|
12
|
-
})
|
|
13
|
-
}
|
package/node/utils/index.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { join } from 'path'
|
|
2
|
-
import isInstalledGlobally from 'is-installed-globally'
|
|
3
|
-
import globalDirs from 'global-dirs'
|
|
4
|
-
import { sync as resolve } from 'resolve'
|
|
5
|
-
import consola from 'consola'
|
|
6
|
-
|
|
7
|
-
export * from './getGitTimestamp'
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* transform obj for vite cde
|
|
11
|
-
* @param obj
|
|
12
|
-
* @returns
|
|
13
|
-
*/
|
|
14
|
-
export const transformObject = (obj: any) => {
|
|
15
|
-
return `JSON.parse(${JSON.stringify(JSON.stringify(obj))})`
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function slash(str: string) {
|
|
19
|
-
return str.replace(/\\/g, '/')
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export function ensurePrefix(prefix: string, str: string) {
|
|
23
|
-
if (!str.startsWith(prefix))
|
|
24
|
-
return prefix + str
|
|
25
|
-
return str
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function toAtFS(path: string) {
|
|
29
|
-
return `/@fs${ensurePrefix('/', slash(path))}`
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export function resolveImportPath(importName: string, ensure: true): string
|
|
33
|
-
export function resolveImportPath(importName: string, ensure?: boolean): string | undefined
|
|
34
|
-
export function resolveImportPath(importName: string, ensure = false) {
|
|
35
|
-
try {
|
|
36
|
-
return resolve(importName, {
|
|
37
|
-
preserveSymlinks: false,
|
|
38
|
-
})
|
|
39
|
-
}
|
|
40
|
-
catch {}
|
|
41
|
-
|
|
42
|
-
if (isInstalledGlobally) {
|
|
43
|
-
try {
|
|
44
|
-
return require.resolve(join(globalDirs.yarn.packages, importName))
|
|
45
|
-
}
|
|
46
|
-
catch {}
|
|
47
|
-
|
|
48
|
-
try {
|
|
49
|
-
return require.resolve(join(globalDirs.npm.packages, importName))
|
|
50
|
-
}
|
|
51
|
-
catch {}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (ensure)
|
|
55
|
-
throw new Error(`Failed to resolve package ${importName}`)
|
|
56
|
-
|
|
57
|
-
consola.error(`Failed to resolve package ${importName}`)
|
|
58
|
-
return undefined
|
|
59
|
-
}
|
package/node/utils/net.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import net from 'net'
|
|
2
|
-
|
|
3
|
-
export async function findFreePort(start: number): Promise<number> {
|
|
4
|
-
if (await isPortFree(start))
|
|
5
|
-
return start
|
|
6
|
-
return await findFreePort(start + 1)
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
function isPortFree(port: number): Promise<boolean> {
|
|
10
|
-
return new Promise((resolve) => {
|
|
11
|
-
const server = net.createServer()
|
|
12
|
-
.listen(port, () => {
|
|
13
|
-
server.close()
|
|
14
|
-
resolve(true)
|
|
15
|
-
})
|
|
16
|
-
.on('error', () => {
|
|
17
|
-
resolve(false)
|
|
18
|
-
})
|
|
19
|
-
})
|
|
20
|
-
}
|
package/node/vite.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { dirname, join } from 'path'
|
|
2
|
-
import type { InlineConfig } from 'vite'
|
|
3
|
-
import { splitVendorChunkPlugin } from 'vite'
|
|
4
|
-
import type { ResolvedValaxyOptions, ValaxyServerOptions } from './options'
|
|
5
|
-
|
|
6
|
-
import { ViteValaxyPlugins } from './plugins/preset'
|
|
7
|
-
import { resolveImportPath } from './utils'
|
|
8
|
-
|
|
9
|
-
export type Mode = 'dev' | 'build'
|
|
10
|
-
|
|
11
|
-
export async function createViteConfig(options: ResolvedValaxyOptions, serverOptions: ValaxyServerOptions = {}): Promise<InlineConfig> {
|
|
12
|
-
const viteConfig: InlineConfig = {
|
|
13
|
-
// remove vue-i18n warnings
|
|
14
|
-
// https://vue-i18n.intlify.dev/guide/advanced/optimization.html#reduce-bundle-size-with-feature-build-flags
|
|
15
|
-
// https://github.com/antfu/vitesse/issues/131
|
|
16
|
-
// https://github.com/intlify/vue-i18n-next/blob/dab6db19a1ef917425939275a41dfde9b6c61fe9/packages/vue-i18n-core/src/misc.ts#L20
|
|
17
|
-
// I create a issue https://github.com/intlify/vue-i18n-next/issues/961
|
|
18
|
-
// define: {
|
|
19
|
-
// __FEATURE_FULL_INSTALL__: 'false',
|
|
20
|
-
// __FEATURE_LEGACY_API__: 'false',
|
|
21
|
-
// __VUE_I18N_FULL_INSTALL__: 'false',
|
|
22
|
-
// __VUE_I18N_LEGACY_API__: 'false',
|
|
23
|
-
// },
|
|
24
|
-
|
|
25
|
-
// always string
|
|
26
|
-
define: {
|
|
27
|
-
__DEV__: options.mode === 'dev' ? 'true' : 'false',
|
|
28
|
-
|
|
29
|
-
__ALGOLIA__: !!options.config.search.algolia.enable,
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
root: options.clientRoot,
|
|
33
|
-
publicDir: join(options.userRoot, 'public'),
|
|
34
|
-
|
|
35
|
-
// https://vitejs.dev/guide/build.html#chunking-strategy
|
|
36
|
-
plugins: [await ViteValaxyPlugins(options, serverOptions, {}), splitVendorChunkPlugin()],
|
|
37
|
-
|
|
38
|
-
server: {
|
|
39
|
-
fs: {
|
|
40
|
-
allow: [
|
|
41
|
-
// not need to search workspace root
|
|
42
|
-
options.clientRoot,
|
|
43
|
-
options.themeRoot,
|
|
44
|
-
options.userRoot,
|
|
45
|
-
dirname(resolveImportPath('katex/package.json', true)),
|
|
46
|
-
],
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
return viteConfig
|
|
52
|
-
}
|
package/tsup.config.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'tsup'
|
|
2
|
-
|
|
3
|
-
export default defineConfig((options) => {
|
|
4
|
-
return {
|
|
5
|
-
entry: [
|
|
6
|
-
'index.ts',
|
|
7
|
-
// 'client/index.ts',
|
|
8
|
-
'node/index.ts',
|
|
9
|
-
'node/cli.ts',
|
|
10
|
-
// 'types/index.ts',
|
|
11
|
-
],
|
|
12
|
-
// https://tsup.egoist.sh/#code-splitting
|
|
13
|
-
// Code splitting currently only works with the esm output format, and it's enabled by default. If you want code splitting for cjs output format as well, try using --splitting flag which is an experimental feature to get rid of the limitation in esbuild.
|
|
14
|
-
// splitting: true,
|
|
15
|
-
clean: true,
|
|
16
|
-
dts: true,
|
|
17
|
-
format: ['cjs', 'esm'],
|
|
18
|
-
minify: !options.watch,
|
|
19
|
-
external: [
|
|
20
|
-
'@valaxyjs/config',
|
|
21
|
-
'@valaxyjs/context',
|
|
22
|
-
'valaxy-theme-yun',
|
|
23
|
-
],
|
|
24
|
-
}
|
|
25
|
-
})
|
package/types/config.ts
DELETED
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
import type { PartialDeep } from 'type-fest'
|
|
2
|
-
import type { VitePluginConfig } from 'unocss/vite'
|
|
3
|
-
import type { MarkdownOptions } from '../node/markdown'
|
|
4
|
-
|
|
5
|
-
export type ValaxyThemeConfig = Record<string, any>
|
|
6
|
-
|
|
7
|
-
export interface SocialLink {
|
|
8
|
-
/**
|
|
9
|
-
* The title of your link
|
|
10
|
-
*/
|
|
11
|
-
name: string
|
|
12
|
-
link: string
|
|
13
|
-
/**
|
|
14
|
-
* 图标名称
|
|
15
|
-
* https://icones.js.org/
|
|
16
|
-
*/
|
|
17
|
-
icon: string
|
|
18
|
-
color: string
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface AlgoliaSearchOptions {
|
|
22
|
-
enable: boolean
|
|
23
|
-
appId: string
|
|
24
|
-
apiKey: string
|
|
25
|
-
indexName: string
|
|
26
|
-
placeholder?: string
|
|
27
|
-
searchParameters?: any
|
|
28
|
-
disableUserPersonalization?: boolean
|
|
29
|
-
initialQuery?: string
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// packages/valaxy/node/config.ts
|
|
33
|
-
export interface ValaxyConfig<T = ValaxyThemeConfig> {
|
|
34
|
-
/**
|
|
35
|
-
* Default language
|
|
36
|
-
* @description 默认语言
|
|
37
|
-
* @default 'en'
|
|
38
|
-
*/
|
|
39
|
-
lang: string
|
|
40
|
-
/**
|
|
41
|
-
* You site url in web, required for ssg & rss
|
|
42
|
-
* @description 站点的 URL,SSG & RSS 需要(譬如生成版权处文章永久链接)
|
|
43
|
-
* @default '/'
|
|
44
|
-
*/
|
|
45
|
-
url: string
|
|
46
|
-
/**
|
|
47
|
-
* Site title
|
|
48
|
-
* @description 站点标题
|
|
49
|
-
*/
|
|
50
|
-
title: string
|
|
51
|
-
/**
|
|
52
|
-
* 副标题
|
|
53
|
-
*/
|
|
54
|
-
subtitle: string
|
|
55
|
-
/**
|
|
56
|
-
* 站点描述
|
|
57
|
-
*/
|
|
58
|
-
description: string
|
|
59
|
-
/**
|
|
60
|
-
* The owner of this blog
|
|
61
|
-
* @description 博客作者
|
|
62
|
-
*/
|
|
63
|
-
author: {
|
|
64
|
-
/**
|
|
65
|
-
* Your name
|
|
66
|
-
* @description 你的名字
|
|
67
|
-
*/
|
|
68
|
-
name: string
|
|
69
|
-
email: string
|
|
70
|
-
link: string
|
|
71
|
-
avatar: string
|
|
72
|
-
/**
|
|
73
|
-
* The status of you
|
|
74
|
-
* @description 状态
|
|
75
|
-
*/
|
|
76
|
-
status: {
|
|
77
|
-
emoji: string
|
|
78
|
-
/**
|
|
79
|
-
* show when hover emoji
|
|
80
|
-
* @description 当鼠标悬浮在图标上时显示
|
|
81
|
-
*/
|
|
82
|
-
message: string
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* show last updated time by git
|
|
88
|
-
*/
|
|
89
|
-
lastUpdated: boolean
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* icon for your website
|
|
93
|
-
*/
|
|
94
|
-
favicon: string
|
|
95
|
-
|
|
96
|
-
feed: {
|
|
97
|
-
/**
|
|
98
|
-
* name: feed -> feed.xml / feed.atom / feed.json
|
|
99
|
-
* @default '' -> feed.xml / atom.xml / feed.json
|
|
100
|
-
*/
|
|
101
|
-
name: string
|
|
102
|
-
favicon: string
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* 社交链接
|
|
107
|
-
*/
|
|
108
|
-
social: SocialLink[]
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* search
|
|
112
|
-
*/
|
|
113
|
-
search: {
|
|
114
|
-
enable: boolean
|
|
115
|
-
algolia: AlgoliaSearchOptions
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* comment: waline/...
|
|
120
|
-
*/
|
|
121
|
-
comment: {
|
|
122
|
-
waline: {
|
|
123
|
-
enable: boolean
|
|
124
|
-
serverURL: string
|
|
125
|
-
}
|
|
126
|
-
twikoo: {
|
|
127
|
-
enable: boolean
|
|
128
|
-
envId: string
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Markdown Feature
|
|
134
|
-
*/
|
|
135
|
-
features: {
|
|
136
|
-
/**
|
|
137
|
-
* enable katex for global
|
|
138
|
-
*/
|
|
139
|
-
katex: boolean
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* The name of theme
|
|
144
|
-
* @description 主题名称
|
|
145
|
-
*/
|
|
146
|
-
theme: string
|
|
147
|
-
/**
|
|
148
|
-
* The config of theme
|
|
149
|
-
* @description 主题配置
|
|
150
|
-
*/
|
|
151
|
-
themeConfig: T & {
|
|
152
|
-
pkg: {
|
|
153
|
-
name: string
|
|
154
|
-
version: string
|
|
155
|
-
homepage?: string
|
|
156
|
-
[key: string]: any
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Unocss Config
|
|
162
|
-
*/
|
|
163
|
-
unocss: VitePluginConfig
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* The license of your posts
|
|
167
|
-
* @description 文章所使用的协议,默认使用 Creative Commons
|
|
168
|
-
* @default https://creativecommons.org/licenses/
|
|
169
|
-
*/
|
|
170
|
-
license: {
|
|
171
|
-
/**
|
|
172
|
-
* Whether to show at the bottom of the article
|
|
173
|
-
* @description 是否显示在文章底部
|
|
174
|
-
* @default true
|
|
175
|
-
*/
|
|
176
|
-
enabled: boolean
|
|
177
|
-
/**
|
|
178
|
-
* Creative License Language, same with your config.lang
|
|
179
|
-
* when lang === 'zh-CN', use 'zh'
|
|
180
|
-
* @description 默认与站点语言相同
|
|
181
|
-
* @default 'en'
|
|
182
|
-
*/
|
|
183
|
-
language: string
|
|
184
|
-
/**
|
|
185
|
-
* Type of license
|
|
186
|
-
* @description 证书类型
|
|
187
|
-
* @default 'by-nc-sa'
|
|
188
|
-
*/
|
|
189
|
-
type: 'zero' | 'by-sa' | 'by-nd' | 'by-nc' | 'by-nc-sa' | 'by-nc-nd'
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* donate for author
|
|
194
|
-
* @description 打赏/赞助
|
|
195
|
-
*/
|
|
196
|
-
sponsor: {
|
|
197
|
-
enable: boolean
|
|
198
|
-
title: string
|
|
199
|
-
methods: {
|
|
200
|
-
name: string
|
|
201
|
-
url: string
|
|
202
|
-
color: string
|
|
203
|
-
icon: string
|
|
204
|
-
}[]
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* for markdown
|
|
209
|
-
*/
|
|
210
|
-
markdownIt: MarkdownOptions
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Valaxy User Config
|
|
215
|
-
* @description Valaxy 用户配置
|
|
216
|
-
*/
|
|
217
|
-
export type UserConfig<ThemeConfig = ValaxyThemeConfig> = PartialDeep<ValaxyConfig<ThemeConfig>>
|
package/types/data.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { Post } from './posts'
|
|
2
|
-
|
|
3
|
-
export interface Header {
|
|
4
|
-
level: number
|
|
5
|
-
title: string
|
|
6
|
-
slug: string
|
|
7
|
-
/**
|
|
8
|
-
* i18n
|
|
9
|
-
*/
|
|
10
|
-
lang?: string
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface PageData {
|
|
14
|
-
path: string
|
|
15
|
-
relativePath: string
|
|
16
|
-
title: string
|
|
17
|
-
titleTemplate?: string
|
|
18
|
-
description: string
|
|
19
|
-
headers: Header[]
|
|
20
|
-
frontmatter: Post
|
|
21
|
-
lastUpdated?: number
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export interface PageDataPayload {
|
|
25
|
-
path: string
|
|
26
|
-
pageData: PageData
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export type HeadConfig =
|
|
30
|
-
| [string, Record<string, string>]
|
|
31
|
-
| [string, Record<string, string>, string]
|
package/types/index.ts
DELETED
package/types/posts.ts
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
export interface Post extends Record<string, any> {
|
|
2
|
-
/**
|
|
3
|
-
* Path of post
|
|
4
|
-
* route.path
|
|
5
|
-
* @description 路径
|
|
6
|
-
*/
|
|
7
|
-
path?: string
|
|
8
|
-
/**
|
|
9
|
-
* Title
|
|
10
|
-
* @description 文章标题
|
|
11
|
-
*/
|
|
12
|
-
title?: string
|
|
13
|
-
date?: string | number | Date
|
|
14
|
-
/**
|
|
15
|
-
* Updated Time
|
|
16
|
-
*/
|
|
17
|
-
updated?: string | number | Date
|
|
18
|
-
lang?: string
|
|
19
|
-
/**
|
|
20
|
-
* TODO
|
|
21
|
-
* Read Time
|
|
22
|
-
* @description 阅读时长
|
|
23
|
-
*/
|
|
24
|
-
duration?: string
|
|
25
|
-
/**
|
|
26
|
-
* post card type, can be bilibili/yuque/...
|
|
27
|
-
*/
|
|
28
|
-
type?: string
|
|
29
|
-
/**
|
|
30
|
-
* override url, and jump directly
|
|
31
|
-
*/
|
|
32
|
-
url?: string
|
|
33
|
-
/**
|
|
34
|
-
* @description 摘要
|
|
35
|
-
*/
|
|
36
|
-
excerpt?: string
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Display sponsor info
|
|
40
|
-
* @description 是否开启赞助
|
|
41
|
-
*/
|
|
42
|
-
sponsor?: boolean
|
|
43
|
-
/**
|
|
44
|
-
* Copyright
|
|
45
|
-
* @description 是否显示文章底部版权信息
|
|
46
|
-
*/
|
|
47
|
-
copyright?: boolean
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Category
|
|
51
|
-
* @description 分类,若为数组,则按顺序代表多层文件夹
|
|
52
|
-
*/
|
|
53
|
-
categories?: string | string[]
|
|
54
|
-
/**
|
|
55
|
-
* Tags
|
|
56
|
-
* @description 标签,可以有多个
|
|
57
|
-
*/
|
|
58
|
-
tags?: string[]
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* display prev next
|
|
62
|
-
* @description 是否显示前一篇、后一篇导航
|
|
63
|
-
*/
|
|
64
|
-
nav?: boolean
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* icon before title
|
|
68
|
-
*/
|
|
69
|
-
icon?: string
|
|
70
|
-
/**
|
|
71
|
-
* title color
|
|
72
|
-
*/
|
|
73
|
-
color?: string
|
|
74
|
-
/**
|
|
75
|
-
* display comment
|
|
76
|
-
*/
|
|
77
|
-
comment?: boolean
|
|
78
|
-
/**
|
|
79
|
-
* post is end
|
|
80
|
-
* @description 是否完结,将在末尾添加衬线字体 Q.E.D.
|
|
81
|
-
*/
|
|
82
|
-
end?: boolean
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* use aplayer
|
|
86
|
-
*/
|
|
87
|
-
aplayer?: boolean
|
|
88
|
-
/**
|
|
89
|
-
* use katex
|
|
90
|
-
*/
|
|
91
|
-
katex?: boolean
|
|
92
|
-
/**
|
|
93
|
-
* use codepen
|
|
94
|
-
*/
|
|
95
|
-
codepen?: boolean
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* 置顶
|
|
99
|
-
*/
|
|
100
|
-
top?: number
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* display toc
|
|
104
|
-
* @description 是否显示目录
|
|
105
|
-
*/
|
|
106
|
-
toc?: boolean
|
|
107
|
-
/**
|
|
108
|
-
* is draft
|
|
109
|
-
* @description 是否为草稿
|
|
110
|
-
*/
|
|
111
|
-
draft?: boolean
|
|
112
|
-
/**
|
|
113
|
-
* cover
|
|
114
|
-
* @description 封面图片
|
|
115
|
-
*/
|
|
116
|
-
cover?: string
|
|
117
|
-
/**
|
|
118
|
-
* enable markdown-body class
|
|
119
|
-
* @description 是否启用默认的 markdown 样式
|
|
120
|
-
*/
|
|
121
|
-
markdown?: boolean
|
|
122
|
-
}
|