mirror of
https://github.com/pengzhanbo/vuepress-theme-plume.git
synced 2026-04-23 10:58:13 +08:00
feat(cli): optimize template (#765)
This commit is contained in:
parent
bba98984d6
commit
c97a5af473
@ -56,13 +56,13 @@ export default defineUserConfig({
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 编译缓存,加快编译速度
|
* 编译缓存,加快编译速度
|
||||||
* @see https://theme-plume.vuejs.press/config/basic/#cache
|
* @see https://theme-plume.vuejs.press/config/theme/#cache
|
||||||
*/
|
*/
|
||||||
cache: 'filesystem',
|
cache: 'filesystem',
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 为 markdown 文件自动添加 frontmatter 配置
|
* 为 markdown 文件自动添加 frontmatter 配置
|
||||||
* @see https://theme-plume.vuejs.press/config/basic/#autofrontmatter
|
* @see https://theme-plume.vuejs.press/config/theme/#autofrontmatter
|
||||||
*/
|
*/
|
||||||
// autoFrontmatter: {
|
// autoFrontmatter: {
|
||||||
// permalink: true, // 是否生成永久链接
|
// permalink: true, // 是否生成永久链接
|
||||||
@ -120,6 +120,7 @@ export default defineUserConfig({
|
|||||||
// jsfiddle: true, // 启用嵌入 jsfiddle 语法 @[jsfiddle](user/id)
|
// jsfiddle: true, // 启用嵌入 jsfiddle 语法 @[jsfiddle](user/id)
|
||||||
// npmTo: true, // 启用 npm-to 容器 ::: npm-to
|
// npmTo: true, // 启用 npm-to 容器 ::: npm-to
|
||||||
// demo: true, // 启用 demo 容器 ::: demo
|
// demo: true, // 启用 demo 容器 ::: demo
|
||||||
|
// collapse: true, // 启用折叠容器 ::: collapse
|
||||||
// repl: { // 启用 代码演示容器
|
// repl: { // 启用 代码演示容器
|
||||||
// go: true, // ::: go-repl
|
// go: true, // ::: go-repl
|
||||||
// rust: true, // ::: rust-repl
|
// rust: true, // ::: rust-repl
|
||||||
@ -176,5 +177,18 @@ export default defineUserConfig({
|
|||||||
* @see https://theme-plume.vuejs.press/guide/features/encryption/
|
* @see https://theme-plume.vuejs.press/guide/features/encryption/
|
||||||
*/
|
*/
|
||||||
// encrypt: {},
|
// encrypt: {},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启用 llmstxt 插件,用于为大语言模型提供更友好的内容
|
||||||
|
* @see https://theme-plume.vuejs.press/guide/features/llmstxt/
|
||||||
|
*/
|
||||||
|
// llmstxt: {
|
||||||
|
{{#if multiLanguage}}
|
||||||
|
// locale: '/', // 默认仅为主语言生成 llms 友好内容
|
||||||
|
// locale: 'all', // 为所有语言生成 llms 友好内容
|
||||||
|
{{else}}
|
||||||
|
// locale: '/', // 默认仅为主语言生成 llms 友好内容
|
||||||
|
{{/if}}
|
||||||
|
// }
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
|||||||
@ -20,7 +20,7 @@ import collections from './collections'
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see https://theme-plume.vuejs.press/config/basic/
|
* @see https://theme-plume.vuejs.press/config/theme/
|
||||||
*/
|
*/
|
||||||
export default defineThemeConfig({
|
export default defineThemeConfig({
|
||||||
logo: 'https://theme-plume.vuejs.press/plume.png',
|
logo: 'https://theme-plume.vuejs.press/plume.png',
|
||||||
@ -52,7 +52,7 @@ export default defineThemeConfig({
|
|||||||
|
|
||||||
{{#unless multiLanguage}}
|
{{#unless multiLanguage}}
|
||||||
/**
|
/**
|
||||||
* @see https://theme-plume.vuejs.press/config/basic/#profile
|
* @see https://theme-plume.vuejs.press/config/theme/#profile
|
||||||
*/
|
*/
|
||||||
profile: {
|
profile: {
|
||||||
avatar: 'https://theme-plume.vuejs.press/plume.png',
|
avatar: 'https://theme-plume.vuejs.press/plume.png',
|
||||||
@ -78,7 +78,7 @@ export default defineThemeConfig({
|
|||||||
// },
|
// },
|
||||||
|
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
/* 过渡动画 @see https://theme-plume.vuejs.press/config/basic/#transition */
|
/* 过渡动画 @see https://theme-plume.vuejs.press/config/theme/#transition */
|
||||||
// transition: {
|
// transition: {
|
||||||
// page: true, // 启用 页面间跳转过渡动画
|
// page: true, // 启用 页面间跳转过渡动画
|
||||||
// postList: true, // 启用 博客文章列表过渡动画
|
// postList: true, // 启用 博客文章列表过渡动画
|
||||||
@ -90,7 +90,7 @@ export default defineThemeConfig({
|
|||||||
{{#each locales}}
|
{{#each locales}}
|
||||||
'{{ path }}': {
|
'{{ path }}': {
|
||||||
/**
|
/**
|
||||||
* @see https://theme-plume.vuejs.press/config/basic/#profile
|
* @see https://theme-plume.vuejs.press/config/theme/#profile
|
||||||
*/
|
*/
|
||||||
profile: {
|
profile: {
|
||||||
avatar: 'https://theme-plume.vuejs.press/plume.png',
|
avatar: 'https://theme-plume.vuejs.press/plume.png',
|
||||||
|
|||||||
@ -137,68 +137,6 @@ const obj = {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
**Code Blocks TwoSlash:**
|
|
||||||
|
|
||||||
```ts twoslash
|
|
||||||
// @errors: 2339
|
|
||||||
const welcome = 'Tudo bem gente?'
|
|
||||||
const words = welcome.contains(' ')
|
|
||||||
```
|
|
||||||
|
|
||||||
```ts twoslash
|
|
||||||
import express from 'express'
|
|
||||||
const app = express()
|
|
||||||
app.get('/', (req, res) => {
|
|
||||||
res.send
|
|
||||||
})
|
|
||||||
app.listen(3000)
|
|
||||||
```
|
|
||||||
|
|
||||||
```ts twoslash
|
|
||||||
import { createHighlighter } from 'shiki'
|
|
||||||
|
|
||||||
const highlighter = await createHighlighter({ themes: ['nord'], langs: ['javascript'] })
|
|
||||||
// @log: Custom log message
|
|
||||||
const a = 1
|
|
||||||
// @error: Custom error message
|
|
||||||
const b = 1
|
|
||||||
// @warn: Custom warning message
|
|
||||||
const c = 1
|
|
||||||
// @annotate: Custom annotation message
|
|
||||||
```
|
|
||||||
|
|
||||||
```ts twoslash
|
|
||||||
// @errors: 2540
|
|
||||||
interface Todo {
|
|
||||||
title: string
|
|
||||||
}
|
|
||||||
|
|
||||||
const todo: Readonly<Todo> = {
|
|
||||||
title: 'Delete inactive users'.toUpperCase(),
|
|
||||||
// ^?
|
|
||||||
}
|
|
||||||
|
|
||||||
todo.title = 'Hello'
|
|
||||||
|
|
||||||
Number.parseInt('123', 10)
|
|
||||||
// ^|
|
|
||||||
|
|
||||||
//
|
|
||||||
//
|
|
||||||
```
|
|
||||||
|
|
||||||
```vue twoslash
|
|
||||||
<script setup lang="ts">
|
|
||||||
import { ref } from 'vue'
|
|
||||||
|
|
||||||
const count = ref(0)
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<p>{{ count }}</p>
|
|
||||||
</template>
|
|
||||||
```
|
|
||||||
|
|
||||||
**代码分组:**
|
**代码分组:**
|
||||||
|
|
||||||
::: code-tabs
|
::: code-tabs
|
||||||
|
|||||||
@ -6,6 +6,8 @@
|
|||||||
*.jpeg binary
|
*.jpeg binary
|
||||||
*.ico binary
|
*.ico binary
|
||||||
*.gif binary
|
*.gif binary
|
||||||
|
*.webp binary
|
||||||
*.tff binary
|
*.tff binary
|
||||||
*.woff binary
|
*.woff binary
|
||||||
*.woff2 binary
|
*.woff2 binary
|
||||||
|
*.pdf binary
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user