valaxy-theme-yun 0.7.8 → 0.8.0
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/ValaxyMain.vue +9 -3
- package/components/YunAside.vue +1 -1
- package/components/YunBackToTop.vue +1 -1
- package/components/YunBanner.vue +2 -1
- package/components/YunBg.vue +1 -1
- package/components/YunConfig.vue +1 -1
- package/components/YunOverview.vue +1 -1
- package/components/YunPostList.vue +1 -1
- package/components/YunPostNav.vue +2 -2
- package/components/YunSearch.vue +1 -1
- package/components/YunSidebarNav.vue +1 -1
- package/components/YunToc.vue +3 -3
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/layouts/home.vue +1 -5
- package/node/index.ts +8 -5
- package/package.json +2 -2
- package/styles/css-vars.scss +3 -5
- package/styles/layout/index.scss +1 -1
- package/styles/layout/post.scss +1 -1
- package/styles/markdown.scss +1 -1
@@ -12,13 +12,15 @@ const config = useConfig()
|
|
12
12
|
|
13
13
|
const { styles, icon, color } = usePostProperty(props.frontmatter.type)
|
14
14
|
const title = usePostTitle(computed(() => props.frontmatter))
|
15
|
+
|
16
|
+
const aside = computed(() => props.frontmatter.aside !== false)
|
15
17
|
</script>
|
16
18
|
|
17
19
|
<template>
|
18
20
|
<main class="yun-main lt-md:ml-0" flex="~">
|
19
21
|
<div w="full" flex="~">
|
20
22
|
<slot name="main">
|
21
|
-
<div class="content" flex="~ col grow" w="full" p="l-4 lt-md:0">
|
23
|
+
<div class="content" :class="!aside && 'no-aside'" flex="~ col grow" w="full" p="l-4 lt-md:0">
|
22
24
|
<YunCard :cover="frontmatter.cover" m="0" class="relative" :style="styles">
|
23
25
|
<slot name="main-header">
|
24
26
|
<YunPageHeader :title="title" :icon="frontmatter.icon || icon" :color="frontmatter.color || color" :cover="frontmatter.cover" />
|
@@ -59,7 +61,7 @@ const title = usePostTitle(computed(() => props.frontmatter))
|
|
59
61
|
</slot>
|
60
62
|
|
61
63
|
<slot name="aside">
|
62
|
-
<YunAside :frontmatter="frontmatter" :data="data">
|
64
|
+
<YunAside v-if="aside" :frontmatter="frontmatter" :data="data">
|
63
65
|
<slot name="aside-custom" />
|
64
66
|
</YunAside>
|
65
67
|
</slot>
|
@@ -68,11 +70,15 @@ const title = usePostTitle(computed(() => props.frontmatter))
|
|
68
70
|
</template>
|
69
71
|
|
70
72
|
<style lang="scss">
|
71
|
-
@use '
|
73
|
+
@use 'valaxy/client/styles/mixins' as *;
|
72
74
|
@include xl {
|
73
75
|
.content{
|
74
76
|
// 8px scrollbar width
|
75
77
|
max-width: calc(100vw - 2 * var(--va-sidebar-width-mobile) - 1rem - 8px);
|
78
|
+
|
79
|
+
&.no-aside {
|
80
|
+
max-width: calc(100vw - var(--va-sidebar-width-mobile));
|
81
|
+
}
|
76
82
|
}
|
77
83
|
}
|
78
84
|
</style>
|
package/components/YunAside.vue
CHANGED
package/components/YunBanner.vue
CHANGED
package/components/YunBg.vue
CHANGED
package/components/YunConfig.vue
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
|
-
import { usePrevNext } from '
|
2
|
+
import { usePrevNext } from 'valaxy'
|
3
3
|
const [prev, next] = usePrevNext()
|
4
4
|
</script>
|
5
5
|
|
@@ -21,7 +21,7 @@ const [prev, next] = usePrevNext()
|
|
21
21
|
</template>
|
22
22
|
|
23
23
|
<style lang="scss">
|
24
|
-
@use '
|
24
|
+
@use 'valaxy/client/styles/mixins' as *;
|
25
25
|
|
26
26
|
.post-nav {
|
27
27
|
display: flex;
|
package/components/YunSearch.vue
CHANGED
package/components/YunToc.vue
CHANGED
@@ -2,12 +2,12 @@
|
|
2
2
|
import { computed, ref } from 'vue'
|
3
3
|
import { useI18n } from 'vue-i18n'
|
4
4
|
import type { Header } from 'valaxy'
|
5
|
-
import { useThemeConfig } from '../composables'
|
6
|
-
import { useFrontmatter } from '~/composables'
|
7
5
|
import {
|
8
6
|
resolveHeaders,
|
9
7
|
useActiveAnchor,
|
10
|
-
|
8
|
+
useFrontmatter,
|
9
|
+
} from 'valaxy'
|
10
|
+
import { useThemeConfig } from '../composables'
|
11
11
|
|
12
12
|
const props = defineProps<{ headers: Header[] }>()
|
13
13
|
|
package/dist/index.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
import { Plugin } from 'vite';
|
2
|
+
import { ResolvedValaxyOptions } from 'valaxy';
|
2
3
|
|
3
4
|
declare namespace YunTheme {
|
4
5
|
type Config = ThemeConfig;
|
@@ -132,6 +133,6 @@ interface UserOptions {
|
|
132
133
|
primary: string;
|
133
134
|
};
|
134
135
|
}
|
135
|
-
declare function
|
136
|
+
declare function themePlugin(options: ResolvedValaxyOptions): Plugin;
|
136
137
|
|
137
|
-
export { ThemeConfig, ThemeUserConfig, UserOptions, YunTheme, anonymousImage,
|
138
|
+
export { ThemeConfig, ThemeUserConfig, UserOptions, YunTheme, anonymousImage, themePlugin as default, defaultThemeConfig, generateSafelist, themePlugin };
|
package/dist/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";var a=Object.defineProperty;var
|
1
|
+
"use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var x=(o,i)=>{for(var e in i)a(o,e,{get:i[e],enumerable:!0})},v=(o,i,e,t)=>{if(i&&typeof i=="object"||typeof i=="function")for(let n of d(i))!h.call(o,n)&&n!==e&&a(o,n,{get:()=>i[n],enumerable:!(t=b(i,n))||t.enumerable});return o};var j=o=>v(a({},"__esModule",{value:!0}),o);var E={};x(E,{anonymousImage:()=>w,default:()=>D,defaultThemeConfig:()=>T,generateSafelist:()=>k,themePlugin:()=>g});module.exports=j(E);var w="https://cdn.yunyoujun.cn/img/avatar/none.jpg",T={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,c,l,s,u,p,m,y,f;let i=[],e=o.types;if(e)for(let r in e)i.push((t=e[r])==null?void 0:t.icon);return(c=(n=o.footer)==null?void 0:n.icon)!=null&&c.name&&i.push((s=(l=o.footer)==null?void 0:l.icon)==null?void 0:s.name),(p=(u=o.menu)==null?void 0:u.custom)!=null&&p.icon&&i.push((y=(m=o.menu)==null?void 0:m.custom)==null?void 0:y.icon),o.pages&&((f=o.pages)==null||f.forEach(r=>{r.icon&&i.push(r.icon)})),i}function g(o){let i=o.config.themeConfig;return{name:"valaxy-theme-yun",enforce:"pre",config(){var e;return{css:{preprocessorOptions:{scss:{additionalData:`$c-primary: ${((e=i.colors)==null?void 0:e.primary)||"#0078E7"} !default;`}}},optimizeDeps:{exclude:["@docsearch/js"]},valaxy:{}}}}}var D=g;0&&(module.exports={anonymousImage,defaultThemeConfig,generateSafelist,themePlugin});
|
package/dist/index.mjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var
|
1
|
+
var g="https://cdn.yunyoujun.cn/img/avatar/none.jpg",b={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(o){var t,r,a,c,l,s,u,p,m,y;let i=[],e=o.types;if(e)for(let n in e)i.push((t=e[n])==null?void 0:t.icon);return(a=(r=o.footer)==null?void 0:r.icon)!=null&&a.name&&i.push((l=(c=o.footer)==null?void 0:c.icon)==null?void 0:l.name),(u=(s=o.menu)==null?void 0:s.custom)!=null&&u.icon&&i.push((m=(p=o.menu)==null?void 0:p.custom)==null?void 0:m.icon),o.pages&&((y=o.pages)==null||y.forEach(n=>{n.icon&&i.push(n.icon)})),i}function f(o){let i=o.config.themeConfig;return{name:"valaxy-theme-yun",enforce:"pre",config(){var e;return{css:{preprocessorOptions:{scss:{additionalData:`$c-primary: ${((e=i.colors)==null?void 0:e.primary)||"#0078E7"} !default;`}}},optimizeDeps:{exclude:["@docsearch/js"]},valaxy:{}}}}}var x=f;export{g as anonymousImage,x as default,b as defaultThemeConfig,d as generateSafelist,f as themePlugin};
|
package/layouts/home.vue
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
|
-
import { useConfig } from 'valaxy'
|
3
|
-
import { useLayout } from '~/composables'
|
2
|
+
import { useAppStore, useConfig, useLayout } from 'valaxy'
|
4
3
|
|
5
|
-
import { useAppStore } from '~/stores/app'
|
6
4
|
const app = useAppStore()
|
7
|
-
|
8
5
|
const config = useConfig()
|
9
|
-
|
10
6
|
const isHome = useLayout('home')
|
11
7
|
</script>
|
12
8
|
|
package/node/index.ts
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
import type { Plugin } from 'vite'
|
2
|
-
import type {
|
3
|
-
import { defaultThemeConfig } from '../config'
|
2
|
+
import type { ResolvedValaxyOptions } from 'valaxy'
|
4
3
|
|
5
4
|
export * from '../config'
|
6
5
|
export * from '../types'
|
@@ -11,7 +10,9 @@ export interface UserOptions {
|
|
11
10
|
}
|
12
11
|
}
|
13
12
|
|
14
|
-
export function
|
13
|
+
export function themePlugin(options: ResolvedValaxyOptions): Plugin {
|
14
|
+
const themeConfig = options.config.themeConfig
|
15
|
+
|
15
16
|
return {
|
16
17
|
name: 'valaxy-theme-yun',
|
17
18
|
enforce: 'pre',
|
@@ -21,7 +22,7 @@ export function yunPlugin(userOptions: Partial<ThemeConfig> = defaultThemeConfig
|
|
21
22
|
css: {
|
22
23
|
preprocessorOptions: {
|
23
24
|
scss: {
|
24
|
-
additionalData: `$c-primary: ${
|
25
|
+
additionalData: `$c-primary: ${themeConfig.colors?.primary || '#0078E7'} !default;`,
|
25
26
|
},
|
26
27
|
},
|
27
28
|
},
|
@@ -29,9 +30,11 @@ export function yunPlugin(userOptions: Partial<ThemeConfig> = defaultThemeConfig
|
|
29
30
|
optimizeDeps: {
|
30
31
|
exclude: ['@docsearch/js'],
|
31
32
|
},
|
33
|
+
|
34
|
+
valaxy: {},
|
32
35
|
}
|
33
36
|
},
|
34
37
|
}
|
35
38
|
}
|
36
39
|
|
37
|
-
export default
|
40
|
+
export default themePlugin
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "valaxy-theme-yun",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.8.0",
|
4
4
|
"author": {
|
5
5
|
"email": "me@yunyoujun.cn",
|
6
6
|
"name": "YunYouJun",
|
@@ -28,7 +28,7 @@
|
|
28
28
|
"@iconify-json/simple-icons": "^1.1.19"
|
29
29
|
},
|
30
30
|
"devDependencies": {
|
31
|
-
"valaxy": "0.
|
31
|
+
"valaxy": "0.8.0"
|
32
32
|
},
|
33
33
|
"scripts": {
|
34
34
|
"build": "rimraf dist && tsup",
|
package/styles/css-vars.scss
CHANGED
@@ -1,11 +1,9 @@
|
|
1
|
-
@use
|
2
|
-
@use
|
3
|
-
$namespace: 'yun'
|
4
|
-
);
|
1
|
+
@use "./vars" as *;
|
2
|
+
@use "valaxy/client/styles/mixins" as * with($namespace: "yun");
|
5
3
|
|
6
4
|
:root {
|
7
5
|
@include set-css-var-from-map($common);
|
8
|
-
@include set-css-var-from-map($z-index,
|
6
|
+
@include set-css-var-from-map($z-index, "z");
|
9
7
|
}
|
10
8
|
|
11
9
|
:root {
|
package/styles/layout/index.scss
CHANGED
package/styles/layout/post.scss
CHANGED
package/styles/markdown.scss
CHANGED