@sugarat/theme 0.2.24 → 0.2.26
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/node.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { DefaultTheme, UserConfig } from 'vitepress';
|
|
|
2
2
|
import { ElButton } from 'element-plus';
|
|
3
3
|
import { RSSOptions } from 'vitepress-plugin-rss';
|
|
4
4
|
import { Repo, Mapping } from '@giscus/vue';
|
|
5
|
+
import { Options } from 'oh-my-live2d';
|
|
5
6
|
export { tabsMarkdownPlugin } from 'vitepress-plugin-tabs';
|
|
6
7
|
|
|
7
8
|
type RSSPluginOptions = RSSOptions;
|
|
@@ -384,6 +385,11 @@ declare namespace Theme {
|
|
|
384
385
|
* @default true
|
|
385
386
|
*/
|
|
386
387
|
backToTop?: boolean | BackToTop;
|
|
388
|
+
/**
|
|
389
|
+
* oh-my-live2d 的 loadOml2d 方法的配置选项
|
|
390
|
+
* 详见 https://oml2d.com/options/Options.html
|
|
391
|
+
*/
|
|
392
|
+
oml2d?: Options;
|
|
387
393
|
}
|
|
388
394
|
interface BackToTop {
|
|
389
395
|
/**
|
|
@@ -408,7 +414,7 @@ declare namespace Theme {
|
|
|
408
414
|
type RSSOptions = RSSPluginOptions;
|
|
409
415
|
interface Footer {
|
|
410
416
|
/**
|
|
411
|
-
*
|
|
417
|
+
* 自定义补充信息(支持配置为HTML)
|
|
412
418
|
*/
|
|
413
419
|
message?: string | string[];
|
|
414
420
|
/**
|
package/node.js
CHANGED
|
@@ -39,7 +39,7 @@ module.exports = __toCommonJS(node_exports);
|
|
|
39
39
|
// src/utils/node/mdPlugins.ts
|
|
40
40
|
var import_module = require("module");
|
|
41
41
|
|
|
42
|
-
// ../../node_modules/.pnpm/vitepress-plugin-tabs@0.2.0_vitepress@1.0.0-rc.
|
|
42
|
+
// ../../node_modules/.pnpm/vitepress-plugin-tabs@0.2.0_vitepress@1.0.0-rc.45_vue@3.4.21/node_modules/vitepress-plugin-tabs/dist/index.js
|
|
43
43
|
var tabsMarker = "=tabs";
|
|
44
44
|
var tabsMarkerLen = tabsMarker.length;
|
|
45
45
|
var ruleBlockTabs = (state, startLine, endLine, silent) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sugarat/theme",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.26",
|
|
4
4
|
"description": "简约风的 Vitepress 博客主题,sugarat vitepress blog theme",
|
|
5
5
|
"author": "sugar",
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,10 +42,11 @@
|
|
|
42
42
|
"gray-matter": "^4.0.3",
|
|
43
43
|
"markdown-it-task-checkbox": "^1.0.6",
|
|
44
44
|
"mermaid": "^10.2.4",
|
|
45
|
+
"oh-my-live2d": "^0.9.0",
|
|
45
46
|
"swiper": "^11.0.5",
|
|
46
47
|
"vitepress-markdown-timeline": "^1.2.1",
|
|
47
48
|
"vitepress-plugin-mermaid": "2.0.13",
|
|
48
|
-
"vitepress-plugin-pagefind": "0.2.
|
|
49
|
+
"vitepress-plugin-pagefind": "0.2.13",
|
|
49
50
|
"vitepress-plugin-rss": "0.2.2",
|
|
50
51
|
"vitepress-plugin-tabs": "0.2.0"
|
|
51
52
|
},
|
|
@@ -56,8 +57,8 @@
|
|
|
56
57
|
"pagefind": "1.0.3",
|
|
57
58
|
"sass": "^1.56.1",
|
|
58
59
|
"typescript": "^4.8.2",
|
|
59
|
-
"vitepress": "1.0.0-rc.
|
|
60
|
-
"vue": "^3.
|
|
60
|
+
"vitepress": "1.0.0-rc.45",
|
|
61
|
+
"vue": "^3.4.21"
|
|
61
62
|
},
|
|
62
63
|
"scripts": {
|
|
63
64
|
"dev": "npm run build:node && npm run dev:docs",
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import Theme from 'vitepress/theme'
|
|
3
3
|
import { useData } from 'vitepress'
|
|
4
4
|
import { computed } from 'vue'
|
|
5
|
+
import { useOml2d } from '../hooks/useOml2d'
|
|
5
6
|
import { useBlogThemeMode } from '../composables/config/blog'
|
|
6
7
|
import BlogHomeInfo from './BlogHomeInfo.vue'
|
|
7
8
|
import BlogHomeBanner from './BlogHomeBanner.vue'
|
|
@@ -22,6 +23,9 @@ const { frontmatter } = useData()
|
|
|
22
23
|
const layout = computed(() => frontmatter.value.layout)
|
|
23
24
|
const isBlogTheme = useBlogThemeMode()
|
|
24
25
|
const { Layout } = Theme
|
|
26
|
+
|
|
27
|
+
// oh-my-live2d 扩展
|
|
28
|
+
useOml2d()
|
|
25
29
|
</script>
|
|
26
30
|
|
|
27
31
|
<template>
|
|
@@ -140,6 +140,8 @@ const showChangeBtn = computed(() => {
|
|
|
140
140
|
onMounted(() => {
|
|
141
141
|
// 更新当前页,确保访问页面在列表中
|
|
142
142
|
const currentPageIndex = recommendList.value.findIndex(v => isCurrentDoc(v.route))
|
|
143
|
+
if (currentPageIndex === -1)
|
|
144
|
+
return
|
|
143
145
|
const currentPageNum = Math.floor(currentPageIndex / pageSize.value) + 1
|
|
144
146
|
currentPage.value = currentPageNum
|
|
145
147
|
})
|
|
@@ -76,7 +76,6 @@ export function withConfigProvider(App: Component) {
|
|
|
76
76
|
}
|
|
77
77
|
})
|
|
78
78
|
}
|
|
79
|
-
|
|
80
79
|
export function useDocMetaInsertSelector() {
|
|
81
80
|
const blogConfig = useConfig()
|
|
82
81
|
const { frontmatter } = useData()
|
|
@@ -98,6 +97,12 @@ export function useConfig() {
|
|
|
98
97
|
export function useBlogConfig() {
|
|
99
98
|
return inject(configSymbol)!.value.blog!
|
|
100
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* 获取 oh-my-live2d的配置选项
|
|
102
|
+
*/
|
|
103
|
+
export function useOml2dOptions() {
|
|
104
|
+
return inject(configSymbol)!.value.blog?.oml2d
|
|
105
|
+
}
|
|
101
106
|
|
|
102
107
|
export function useBlogThemeMode() {
|
|
103
108
|
return inject(configSymbol)!.value?.blog?.blog ?? true
|
|
@@ -3,6 +3,7 @@ import type { ElButton } from 'element-plus'
|
|
|
3
3
|
import type { DefaultTheme } from 'vitepress'
|
|
4
4
|
import type { RSSOptions } from 'vitepress-plugin-rss'
|
|
5
5
|
import type { Mapping, Repo } from '@giscus/vue'
|
|
6
|
+
import type { Options as Oml2dOptions } from 'oh-my-live2d'
|
|
6
7
|
|
|
7
8
|
type RSSPluginOptions = RSSOptions
|
|
8
9
|
|
|
@@ -416,6 +417,12 @@ export namespace Theme {
|
|
|
416
417
|
* @default true
|
|
417
418
|
*/
|
|
418
419
|
backToTop?: boolean | BackToTop
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* oh-my-live2d 的 loadOml2d 方法的配置选项
|
|
423
|
+
* 详见 https://oml2d.com/options/Options.html
|
|
424
|
+
*/
|
|
425
|
+
oml2d?: Oml2dOptions
|
|
419
426
|
}
|
|
420
427
|
|
|
421
428
|
export interface BackToTop {
|
|
@@ -445,7 +452,7 @@ export namespace Theme {
|
|
|
445
452
|
|
|
446
453
|
export interface Footer {
|
|
447
454
|
/**
|
|
448
|
-
*
|
|
455
|
+
* 自定义补充信息(支持配置为HTML)
|
|
449
456
|
*/
|
|
450
457
|
message?: string | string[]
|
|
451
458
|
/**
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { onMounted } from 'vue'
|
|
2
|
+
import { useOml2dOptions } from '../composables/config/blog'
|
|
3
|
+
|
|
4
|
+
export function useOml2d() {
|
|
5
|
+
const oml2dOptions = useOml2dOptions()
|
|
6
|
+
onMounted(async () => {
|
|
7
|
+
if (oml2dOptions) {
|
|
8
|
+
const { loadOml2d } = await import('oh-my-live2d')
|
|
9
|
+
loadOml2d(oml2dOptions)
|
|
10
|
+
}
|
|
11
|
+
})
|
|
12
|
+
}
|