valaxy-theme-yun 0.7.8 → 0.9.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 +18 -4
- 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/components/YunWaline.vue +3 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/layouts/home.vue +1 -5
- package/node/index.ts +12 -6
- 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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import type { PageData, Post } from 'valaxy'
|
|
3
3
|
import { useConfig, usePostTitle } from 'valaxy'
|
|
4
|
-
import { computed } from 'vue'
|
|
4
|
+
import { computed, defineAsyncComponent } from 'vue'
|
|
5
5
|
import { usePostProperty } from '../composables'
|
|
6
6
|
|
|
7
7
|
const props = defineProps<{
|
|
@@ -12,13 +12,23 @@ 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)
|
|
17
|
+
|
|
18
|
+
const YunWaline = config.value.comment.waline.enable
|
|
19
|
+
? defineAsyncComponent(() => import('./YunWaline.vue'))
|
|
20
|
+
: () => null
|
|
21
|
+
|
|
22
|
+
const YunTwikoo = config.value.comment.waline.enable
|
|
23
|
+
? defineAsyncComponent(() => import('./YunTwikoo.vue'))
|
|
24
|
+
: () => null
|
|
15
25
|
</script>
|
|
16
26
|
|
|
17
27
|
<template>
|
|
18
28
|
<main class="yun-main lt-md:ml-0" flex="~">
|
|
19
29
|
<div w="full" flex="~">
|
|
20
30
|
<slot name="main">
|
|
21
|
-
<div class="content" flex="~ col grow" w="full" p="l-4 lt-md:0">
|
|
31
|
+
<div class="content" :class="!aside && 'no-aside'" flex="~ col grow" w="full" p="l-4 lt-md:0">
|
|
22
32
|
<YunCard :cover="frontmatter.cover" m="0" class="relative" :style="styles">
|
|
23
33
|
<slot name="main-header">
|
|
24
34
|
<YunPageHeader :title="title" :icon="frontmatter.icon || icon" :color="frontmatter.color || color" :cover="frontmatter.cover" />
|
|
@@ -59,7 +69,7 @@ const title = usePostTitle(computed(() => props.frontmatter))
|
|
|
59
69
|
</slot>
|
|
60
70
|
|
|
61
71
|
<slot name="aside">
|
|
62
|
-
<YunAside :frontmatter="frontmatter" :data="data">
|
|
72
|
+
<YunAside v-if="aside" :frontmatter="frontmatter" :data="data">
|
|
63
73
|
<slot name="aside-custom" />
|
|
64
74
|
</YunAside>
|
|
65
75
|
</slot>
|
|
@@ -68,11 +78,15 @@ const title = usePostTitle(computed(() => props.frontmatter))
|
|
|
68
78
|
</template>
|
|
69
79
|
|
|
70
80
|
<style lang="scss">
|
|
71
|
-
@use '
|
|
81
|
+
@use 'valaxy/client/styles/mixins' as *;
|
|
72
82
|
@include xl {
|
|
73
83
|
.content{
|
|
74
84
|
// 8px scrollbar width
|
|
75
85
|
max-width: calc(100vw - 2 * var(--va-sidebar-width-mobile) - 1rem - 8px);
|
|
86
|
+
|
|
87
|
+
&.no-aside {
|
|
88
|
+
max-width: calc(100vw - var(--va-sidebar-width-mobile));
|
|
89
|
+
}
|
|
76
90
|
}
|
|
77
91
|
}
|
|
78
92
|
</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/components/YunWaline.vue
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { useConfig
|
|
2
|
+
import { useConfig } from 'valaxy'
|
|
3
|
+
// we need import on demand
|
|
4
|
+
import { useWaline } from 'valaxy/client/composables/comments/waline'
|
|
3
5
|
|
|
4
6
|
const config = useConfig()
|
|
5
7
|
useWaline(config.value.comment.waline, config.value.cdn.prefix)
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as valaxy_dist_node from 'valaxy/dist/node';
|
|
2
2
|
|
|
3
3
|
declare namespace YunTheme {
|
|
4
4
|
type Config = ThemeConfig;
|
|
@@ -132,6 +132,6 @@ interface UserOptions {
|
|
|
132
132
|
primary: string;
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
|
-
declare
|
|
135
|
+
declare const _default: Promise<valaxy_dist_node.ValaxyThemePlugin | valaxy_dist_node.ThemeConfigFn>;
|
|
136
136
|
|
|
137
|
-
export { ThemeConfig, ThemeUserConfig, UserOptions, YunTheme, anonymousImage,
|
|
137
|
+
export { ThemeConfig, ThemeUserConfig, UserOptions, YunTheme, anonymousImage, _default as default, defaultThemeConfig, generateSafelist };
|
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=(i,o)=>{for(var e in o)a(i,e,{get:o[e],enumerable:!0})},v=(i,o,e,t)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of d(o))!h.call(i,n)&&n!==e&&a(i,n,{get:()=>o[n],enumerable:!(t=b(o,n))||t.enumerable});return i};var j=i=>v(a({},"__esModule",{value:!0}),i);var O={};x(O,{anonymousImage:()=>w,default:()=>E,defaultThemeConfig:()=>T,generateSafelist:()=>k});module.exports=j(O);var g=require("valaxy");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(i){var t,n,c,l,u,s,p,m,y,f;let o=[],e=i.types;if(e)for(let r in e)o.push((t=e[r])==null?void 0:t.icon);return(c=(n=i.footer)==null?void 0:n.icon)!=null&&c.name&&o.push((u=(l=i.footer)==null?void 0:l.icon)==null?void 0:u.name),(p=(s=i.menu)==null?void 0:s.custom)!=null&&p.icon&&o.push((y=(m=i.menu)==null?void 0:m.custom)==null?void 0:y.icon),i.pages&&((f=i.pages)==null||f.forEach(r=>{r.icon&&o.push(r.icon)})),o}function D(i){let o=i.config.themeConfig;return{name:"valaxy-theme-yun",enforce:"pre",config(){var e;return{css:{preprocessorOptions:{scss:{additionalData:`$c-primary: ${((e=o.colors)==null?void 0:e.primary)||"#0078E7"} !default;`}}},optimizeDeps:{exclude:["@docsearch/js"]}}}}}var E=(0,g.defineThemePlugin)(i=>({vite:{plugins:[D(i)]}}));0&&(module.exports={anonymousImage,defaultThemeConfig,generateSafelist});
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var b="https://cdn.yunyoujun.cn/img/avatar/none.jpg",
|
|
1
|
+
import{defineThemePlugin as f}from"valaxy";var b="https://cdn.yunyoujun.cn/img/avatar/none.jpg",d={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 h(i){var t,r,a,c,l,u,s,p,m,y;let o=[],e=i.types;if(e)for(let n in e)o.push((t=e[n])==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&&((y=i.pages)==null||y.forEach(n=>{n.icon&&o.push(n.icon)})),o}function g(i){let o=i.config.themeConfig;return{name:"valaxy-theme-yun",enforce:"pre",config(){var e;return{css:{preprocessorOptions:{scss:{additionalData:`$c-primary: ${((e=o.colors)==null?void 0:e.primary)||"#0078E7"} !default;`}}},optimizeDeps:{exclude:["@docsearch/js"]}}}}}var j=f(i=>({vite:{plugins:[g(i)]}}));export{b as anonymousImage,j as default,d as defaultThemeConfig,h as generateSafelist};
|
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,6 @@
|
|
|
1
|
+
import { defineThemePlugin } from 'valaxy'
|
|
2
|
+
import type { ResolvedValaxyOptions } from 'valaxy'
|
|
1
3
|
import type { Plugin } from 'vite'
|
|
2
|
-
import type { ThemeConfig } from '../types'
|
|
3
|
-
import { defaultThemeConfig } from '../config'
|
|
4
4
|
|
|
5
5
|
export * from '../config'
|
|
6
6
|
export * from '../types'
|
|
@@ -11,17 +11,17 @@ export interface UserOptions {
|
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
function ThemeYunVitePlugin(options: ResolvedValaxyOptions): Plugin {
|
|
15
|
+
const themeConfig = options.config.themeConfig
|
|
15
16
|
return {
|
|
16
17
|
name: 'valaxy-theme-yun',
|
|
17
18
|
enforce: 'pre',
|
|
18
|
-
|
|
19
19
|
config() {
|
|
20
20
|
return {
|
|
21
21
|
css: {
|
|
22
22
|
preprocessorOptions: {
|
|
23
23
|
scss: {
|
|
24
|
-
additionalData: `$c-primary: ${
|
|
24
|
+
additionalData: `$c-primary: ${themeConfig.colors?.primary || '#0078E7'} !default;`,
|
|
25
25
|
},
|
|
26
26
|
},
|
|
27
27
|
},
|
|
@@ -34,4 +34,10 @@ export function yunPlugin(userOptions: Partial<ThemeConfig> = defaultThemeConfig
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
export default
|
|
37
|
+
export default defineThemePlugin((options) => {
|
|
38
|
+
return {
|
|
39
|
+
vite: {
|
|
40
|
+
plugins: [ThemeYunVitePlugin(options)],
|
|
41
|
+
},
|
|
42
|
+
}
|
|
43
|
+
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "valaxy-theme-yun",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.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.9.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