valaxy-theme-yun 0.7.5 → 0.7.8
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/components/YunToggleLocale.vue +3 -15
- package/components/YunWaline.vue +1 -1
- package/config/index.ts +9 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/layouts/404.vue +2 -2
- package/layouts/archives.vue +2 -2
- package/layouts/categories.vue +2 -2
- package/layouts/default.vue +2 -2
- package/layouts/{base.vue → layout.vue} +0 -0
- package/layouts/post.vue +2 -2
- package/layouts/tags.vue +2 -2
- package/node/index.ts +4 -0
- package/package.json +4 -5
- package/styles/vars.scss +37 -23
- package/tsconfig.json +27 -0
@@ -1,21 +1,9 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
|
-
import { isClient, useStorage } from '@vueuse/core'
|
3
2
|
import { useI18n } from 'vue-i18n'
|
4
|
-
|
3
|
+
import { useLocale } from 'valaxy'
|
5
4
|
|
6
|
-
const
|
7
|
-
|
8
|
-
const toggleLocales = () => {
|
9
|
-
// change to some real logic
|
10
|
-
const locales = availableLocales
|
11
|
-
|
12
|
-
locale.value = locales[(locales.indexOf(locale.value) + 1) % locales.length]
|
13
|
-
// for localStorage
|
14
|
-
lang.value = locale.value
|
15
|
-
|
16
|
-
if (isClient)
|
17
|
-
document.documentElement.setAttribute('lang', locale.value)
|
18
|
-
}
|
5
|
+
const { t, locale } = useI18n()
|
6
|
+
const { toggleLocales } = useLocale()
|
19
7
|
</script>
|
20
8
|
|
21
9
|
<template>
|
package/components/YunWaline.vue
CHANGED
package/config/index.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { ThemeConfig, ThemeUserConfig } from '../types'
|
2
2
|
|
3
|
-
export const anonymousImage = 'https://cdn.
|
3
|
+
export const anonymousImage = 'https://cdn.yunyoujun.cn/img/avatar/none.jpg'
|
4
4
|
|
5
5
|
/**
|
6
6
|
* Default Config
|
@@ -17,8 +17,8 @@ export const defaultThemeConfig: ThemeConfig = {
|
|
17
17
|
|
18
18
|
bg_image: {
|
19
19
|
enable: true,
|
20
|
-
url: 'https://cdn.
|
21
|
-
dark: 'https://cdn.
|
20
|
+
url: 'https://cdn.yunyoujun.cn/img/bg/stars-timing-0-blur-30px.jpg',
|
21
|
+
dark: 'https://cdn.yunyoujun.cn/img/bg/galaxy.jpg',
|
22
22
|
},
|
23
23
|
|
24
24
|
say: {
|
@@ -129,5 +129,11 @@ export function generateSafelist(themeConfig: ThemeUserConfig) {
|
|
129
129
|
if (themeConfig.menu?.custom?.icon)
|
130
130
|
safelist.push(themeConfig.menu?.custom?.icon)
|
131
131
|
|
132
|
+
if (themeConfig.pages) {
|
133
|
+
themeConfig.pages?.forEach((item) => {
|
134
|
+
item.icon && safelist.push(item.icon)
|
135
|
+
})
|
136
|
+
}
|
137
|
+
|
132
138
|
return safelist
|
133
139
|
}
|
package/dist/index.d.ts
CHANGED
@@ -114,7 +114,7 @@ interface ThemeConfig {
|
|
114
114
|
}
|
115
115
|
declare type ThemeUserConfig = Partial<ThemeConfig>;
|
116
116
|
|
117
|
-
declare const anonymousImage = "https://cdn.
|
117
|
+
declare const anonymousImage = "https://cdn.yunyoujun.cn/img/avatar/none.jpg";
|
118
118
|
/**
|
119
119
|
* Default Config
|
120
120
|
*/
|
package/dist/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";var
|
1
|
+
"use strict";var a=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var v=(o,i)=>{for(var e in i)a(o,e,{get:i[e],enumerable:!0})},T=(o,i,e,t)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of h(i))!x.call(o,n)&&n!==e&&a(o,n,{get:()=>i[n],enumerable:!(t=d(i,n))||t.enumerable});return o};var j=o=>T(a({},"__esModule",{value:!0}),o);var E={};v(E,{anonymousImage:()=>w,default:()=>D,defaultThemeConfig:()=>c,generateSafelist:()=>k,yunPlugin:()=>b});module.exports=j(E);var w="https://cdn.yunyoujun.cn/img/avatar/none.jpg",c={outlineTitle:"On this page",colors:{primary:"#0078E7"},banner:{enable:!0,title:"\u4E91\u6E38\u541B\u7684\u5C0F\u7AD9"},bg_image:{enable:!0,url:"https://cdn.yunyoujun.cn/img/bg/stars-timing-0-blur-30px.jpg",dark:"https://cdn.yunyoujun.cn/img/bg/galaxy.jpg"},say:{enable:!0,api:"https://el-bot-api.vercel.app/api/words/young",hitokoto:{enable:!1,api:"https://v1.hitokoto.cn"}},pages:[],sidebar:null,footer:{since:2022,icon:{name:"i-ri-cloud-line",animated:!0,color:"var(--va-c-primary)",url:"https://sponsors.yunyoujun.cn",title:"Sponsor YunYouJun"},powered:!0,beian:{enable:!1,icp:""}},types:{link:{color:"var(--va-c-primary)",icon:"i-ri-external-link-line"},bilibili:{color:"#FF8EB3",icon:"i-ri-bilibili-line"},douban:{color:"#007722",icon:"i-ri-douban-line"},github:{color:"var(--va-c-text)",icon:"i-ri-github-line"},"netease-cloud-music":{color:"#C10D0C",icon:"i-ri-netease-cloud-music-line"},notion:{color:"var(--va-c-text)",icon:"i-simple-icons-notion"},twitter:{color:"#1da1f2",icon:"i-ri-twitter-line"},wechat:{color:"#1AAD19",icon:"i-ri-wechat-2-line"},weibo:{color:"#E6162D",icon:"i-ri-weibo-line"},yuque:{color:"#25b864",icon:"i-ant-design-yuque-outlined"},zhihu:{color:"#0084FF",icon:"i-ri-zhihu-line"}},menu:{custom:{title:"button.about",icon:"i-ri-clipboard-line",url:"/about"}}};function k(o){var t,n,l,u,s,p,m,f,y,g;let i=[],e=o.types;if(e)for(let r in e)i.push((t=e[r])==null?void 0:t.icon);return(l=(n=o.footer)==null?void 0:n.icon)!=null&&l.name&&i.push((s=(u=o.footer)==null?void 0:u.icon)==null?void 0:s.name),(m=(p=o.menu)==null?void 0:p.custom)!=null&&m.icon&&i.push((y=(f=o.menu)==null?void 0:f.custom)==null?void 0:y.icon),o.pages&&((g=o.pages)==null||g.forEach(r=>{r.icon&&i.push(r.icon)})),i}function b(o=c){return{name:"valaxy-theme-yun",enforce:"pre",config(){var i;return{css:{preprocessorOptions:{scss:{additionalData:`$c-primary: ${((i=o.colors)==null?void 0:i.primary)||"#0078E7"} !default;`}}},optimizeDeps:{exclude:["@docsearch/js"]}}}}}var D=b;0&&(module.exports={anonymousImage,defaultThemeConfig,generateSafelist,yunPlugin});
|
package/dist/index.mjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var
|
1
|
+
var b="https://cdn.yunyoujun.cn/img/avatar/none.jpg",y={outlineTitle:"On this page",colors:{primary:"#0078E7"},banner:{enable:!0,title:"\u4E91\u6E38\u541B\u7684\u5C0F\u7AD9"},bg_image:{enable:!0,url:"https://cdn.yunyoujun.cn/img/bg/stars-timing-0-blur-30px.jpg",dark:"https://cdn.yunyoujun.cn/img/bg/galaxy.jpg"},say:{enable:!0,api:"https://el-bot-api.vercel.app/api/words/young",hitokoto:{enable:!1,api:"https://v1.hitokoto.cn"}},pages:[],sidebar:null,footer:{since:2022,icon:{name:"i-ri-cloud-line",animated:!0,color:"var(--va-c-primary)",url:"https://sponsors.yunyoujun.cn",title:"Sponsor YunYouJun"},powered:!0,beian:{enable:!1,icp:""}},types:{link:{color:"var(--va-c-primary)",icon:"i-ri-external-link-line"},bilibili:{color:"#FF8EB3",icon:"i-ri-bilibili-line"},douban:{color:"#007722",icon:"i-ri-douban-line"},github:{color:"var(--va-c-text)",icon:"i-ri-github-line"},"netease-cloud-music":{color:"#C10D0C",icon:"i-ri-netease-cloud-music-line"},notion:{color:"var(--va-c-text)",icon:"i-simple-icons-notion"},twitter:{color:"#1da1f2",icon:"i-ri-twitter-line"},wechat:{color:"#1AAD19",icon:"i-ri-wechat-2-line"},weibo:{color:"#E6162D",icon:"i-ri-weibo-line"},yuque:{color:"#25b864",icon:"i-ant-design-yuque-outlined"},zhihu:{color:"#0084FF",icon:"i-ri-zhihu-line"}},menu:{custom:{title:"button.about",icon:"i-ri-clipboard-line",url:"/about"}}};function d(i){var t,r,a,c,l,u,s,p,m,f;let o=[],n=i.types;if(n)for(let e in n)o.push((t=n[e])==null?void 0:t.icon);return(a=(r=i.footer)==null?void 0:r.icon)!=null&&a.name&&o.push((l=(c=i.footer)==null?void 0:c.icon)==null?void 0:l.name),(s=(u=i.menu)==null?void 0:u.custom)!=null&&s.icon&&o.push((m=(p=i.menu)==null?void 0:p.custom)==null?void 0:m.icon),i.pages&&((f=i.pages)==null||f.forEach(e=>{e.icon&&o.push(e.icon)})),o}function g(i=y){return{name:"valaxy-theme-yun",enforce:"pre",config(){var o;return{css:{preprocessorOptions:{scss:{additionalData:`$c-primary: ${((o=i.colors)==null?void 0:o.primary)||"#0078E7"} !default;`}}},optimizeDeps:{exclude:["@docsearch/js"]}}}}}var v=g;export{b as anonymousImage,v as default,y as defaultThemeConfig,d as generateSafelist,g as yunPlugin};
|
package/layouts/404.vue
CHANGED
@@ -7,7 +7,7 @@ const { t } = useI18n()
|
|
7
7
|
</script>
|
8
8
|
|
9
9
|
<template>
|
10
|
-
<
|
10
|
+
<Layout>
|
11
11
|
<template #content>
|
12
12
|
<div text="center">
|
13
13
|
<div text-4xl>
|
@@ -21,5 +21,5 @@ const { t } = useI18n()
|
|
21
21
|
</div>
|
22
22
|
</div>
|
23
23
|
</template>
|
24
|
-
</
|
24
|
+
</Layout>
|
25
25
|
</template>
|
package/layouts/archives.vue
CHANGED
@@ -11,7 +11,7 @@ const title = usePostTitle(frontmatter)
|
|
11
11
|
</script>
|
12
12
|
|
13
13
|
<template>
|
14
|
-
<
|
14
|
+
<Layout>
|
15
15
|
<template #main-header>
|
16
16
|
<YunPageHeader :title="title || t('menu.archives')" :icon="frontmatter.icon || 'i-ri-archive-line'" :color="frontmatter.color" />
|
17
17
|
</template>
|
@@ -19,5 +19,5 @@ const title = usePostTitle(frontmatter)
|
|
19
19
|
<router-view />
|
20
20
|
<YunPostCollapse :posts="postList" />
|
21
21
|
</template>
|
22
|
-
</
|
22
|
+
</Layout>
|
23
23
|
</template>
|
package/layouts/categories.vue
CHANGED
@@ -46,7 +46,7 @@ const title = usePostTitle(frontmatter)
|
|
46
46
|
</script>
|
47
47
|
|
48
48
|
<template>
|
49
|
-
<
|
49
|
+
<Layout>
|
50
50
|
<template #main-header>
|
51
51
|
<YunPageHeader
|
52
52
|
:title="title || t('menu.categories')"
|
@@ -68,5 +68,5 @@ const title = usePostTitle(frontmatter)
|
|
68
68
|
<YunPostCollapse w="full" m="b-4" p="x-20 lt-sm:x-5" :posts="posts" />
|
69
69
|
</YunCard>
|
70
70
|
</template>
|
71
|
-
</
|
71
|
+
</Layout>
|
72
72
|
</template>
|
package/layouts/default.vue
CHANGED
File without changes
|
package/layouts/post.vue
CHANGED
@@ -15,7 +15,7 @@ const showSponsor = computed(() => {
|
|
15
15
|
</script>
|
16
16
|
|
17
17
|
<template>
|
18
|
-
<
|
18
|
+
<Layout>
|
19
19
|
<template #main-header-after>
|
20
20
|
<YunPostMeta :frontmatter="frontmatter" />
|
21
21
|
</template>
|
@@ -28,5 +28,5 @@ const showSponsor = computed(() => {
|
|
28
28
|
<template #aside-custom>
|
29
29
|
<slot name="aside-custom" />
|
30
30
|
</template>
|
31
|
-
</
|
31
|
+
</Layout>
|
32
32
|
</template>
|
package/layouts/tags.vue
CHANGED
@@ -49,7 +49,7 @@ const title = usePostTitle(frontmatter)
|
|
49
49
|
</script>
|
50
50
|
|
51
51
|
<template>
|
52
|
-
<
|
52
|
+
<Layout>
|
53
53
|
<template #main-header>
|
54
54
|
<YunPageHeader
|
55
55
|
:title="title || t('menu.tags')"
|
@@ -77,5 +77,5 @@ const title = usePostTitle(frontmatter)
|
|
77
77
|
<YunPostCollapse w="full" m="b-4" p="x-20 lt-sm:x-5" :posts="posts" />
|
78
78
|
</YunCard>
|
79
79
|
</template>
|
80
|
-
</
|
80
|
+
</Layout>
|
81
81
|
</template>
|
package/node/index.ts
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "valaxy-theme-yun",
|
3
|
-
"version": "0.7.
|
3
|
+
"version": "0.7.8",
|
4
4
|
"author": {
|
5
5
|
"email": "me@yunyoujun.cn",
|
6
6
|
"name": "YunYouJun",
|
@@ -21,15 +21,14 @@
|
|
21
21
|
"main": "dist/index.js",
|
22
22
|
"module": "dist/index.mjs",
|
23
23
|
"types": "dist/index.d.ts",
|
24
|
-
"peerDependencies": {
|
25
|
-
"valaxy": "0.7.5"
|
26
|
-
},
|
27
24
|
"dependencies": {
|
25
|
+
"@docsearch/css": "^3.1.1",
|
26
|
+
"@docsearch/js": "^3.1.1",
|
28
27
|
"@iconify-json/ant-design": "^1.1.3",
|
29
28
|
"@iconify-json/simple-icons": "^1.1.19"
|
30
29
|
},
|
31
30
|
"devDependencies": {
|
32
|
-
"valaxy": "0.7.
|
31
|
+
"valaxy": "0.7.8"
|
33
32
|
},
|
34
33
|
"scripts": {
|
35
34
|
"build": "rimraf dist && tsup",
|
package/styles/vars.scss
CHANGED
@@ -1,33 +1,47 @@
|
|
1
|
-
@use
|
1
|
+
@use "sass:map";
|
2
2
|
|
3
3
|
// palette
|
4
4
|
$light: () !default;
|
5
|
-
$light: map.merge(
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
$light: map.merge(
|
6
|
+
(
|
7
|
+
"bg-image":
|
8
|
+
url("https://cdn.yunyoujun.cn/img/bg/stars-timing-0-blur-30px.jpg"),
|
9
|
+
"sidebar-bg-color": var(--va-c-bg-light),
|
10
|
+
"sidebar-bg-image":
|
11
|
+
url("https://cdn.yunyoujun.cn/img/bg/alpha-stars-timing-1.webp"),
|
12
|
+
),
|
13
|
+
$light
|
14
|
+
);
|
10
15
|
|
11
16
|
$dark: () !default;
|
12
|
-
$dark: map.merge(
|
13
|
-
|
14
|
-
|
15
|
-
|
17
|
+
$dark: map.merge(
|
18
|
+
(
|
19
|
+
"bg-image": none,
|
20
|
+
"sidebar-bg-image": none,
|
21
|
+
),
|
22
|
+
$dark
|
23
|
+
);
|
16
24
|
|
17
25
|
// common
|
18
26
|
$common: () !default;
|
19
|
-
$common: map.merge(
|
20
|
-
|
21
|
-
|
27
|
+
$common: map.merge(
|
28
|
+
(
|
29
|
+
"post-card-max-width": 900px,
|
30
|
+
),
|
31
|
+
$common
|
32
|
+
);
|
22
33
|
|
23
34
|
$z-index: () !default;
|
24
|
-
$z-index: map.merge(
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
35
|
+
$z-index: map.merge(
|
36
|
+
(
|
37
|
+
"cloud": 8,
|
38
|
+
"go-down": 9,
|
39
|
+
"sidebar": 10,
|
40
|
+
"fireworks": 11,
|
41
|
+
"menu-btn": 20,
|
42
|
+
"go-up-btn": 20,
|
43
|
+
"search-popup": 30,
|
44
|
+
"search-btn": 31,
|
45
|
+
),
|
46
|
+
$z-index
|
47
|
+
);
|
package/tsconfig.json
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
{
|
2
|
+
// we need tsconfig.json to compile without
|
3
|
+
// error: This is likely not portable. A type annotation is necessary.
|
4
|
+
"compilerOptions": {
|
5
|
+
"allowJs": true,
|
6
|
+
"baseUrl": ".",
|
7
|
+
"module": "ESNext",
|
8
|
+
"target": "ESNext",
|
9
|
+
"lib": ["DOM", "ESNext"],
|
10
|
+
"strict": true,
|
11
|
+
"esModuleInterop": true,
|
12
|
+
"jsx": "preserve",
|
13
|
+
"skipLibCheck": true,
|
14
|
+
"moduleResolution": "node",
|
15
|
+
"resolveJsonModule": true,
|
16
|
+
"noUnusedLocals": true,
|
17
|
+
"strictNullChecks": true,
|
18
|
+
"forceConsistentCasingInFileNames": true,
|
19
|
+
"types": [
|
20
|
+
"vite/client",
|
21
|
+
"vue/ref-macros",
|
22
|
+
"vite-plugin-pages/client",
|
23
|
+
"vite-plugin-vue-layouts/client"
|
24
|
+
]
|
25
|
+
},
|
26
|
+
"exclude": ["**/dist/**", "node_modules"]
|
27
|
+
}
|