valaxy 0.1.1 → 0.2.1

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.
Files changed (96) hide show
  1. package/bin/valaxy.js +1 -1
  2. package/dist/chunk-B2JVVNA4.js +88 -0
  3. package/dist/chunk-FH6NMGNX.mjs +88 -0
  4. package/dist/chunk-TSLYS2VY.js +1 -0
  5. package/dist/chunk-U4ZDCBEC.mjs +1 -0
  6. package/dist/config-24b4f209.d.ts +188 -0
  7. package/dist/index.d.ts +337 -150
  8. package/dist/index.js +1 -1
  9. package/dist/index.mjs +1 -1
  10. package/dist/{cli.d.ts → node/cli.d.ts} +0 -0
  11. package/dist/node/cli.js +45 -0
  12. package/dist/node/cli.mjs +45 -0
  13. package/dist/node/index.d.ts +46 -0
  14. package/dist/node/index.js +1 -0
  15. package/dist/node/index.mjs +1 -0
  16. package/package.json +23 -20
  17. package/src/client/components/PostCard.vue +16 -17
  18. package/src/client/components/PostList.vue +3 -3
  19. package/src/client/components/ValaxyCopyright.vue +1 -1
  20. package/src/client/components/ValaxyFooter.vue +1 -1
  21. package/src/client/components/ValaxyMd.vue +1 -1
  22. package/src/client/components/ValaxyOverlay.vue +4 -4
  23. package/src/client/components/ValaxyPagination.vue +14 -11
  24. package/src/client/components/ValaxyRightSidebar.vue +2 -2
  25. package/src/client/components/ValaxySidebar.vue +4 -10
  26. package/src/client/components/ValaxyToc.vue +12 -10
  27. package/src/client/composables/category.ts +24 -5
  28. package/src/client/composables/comments/index.ts +1 -0
  29. package/src/client/composables/comments/twikoo.ts +37 -0
  30. package/src/client/composables/comments/waline.ts +8 -5
  31. package/src/client/composables/common.ts +3 -4
  32. package/src/client/composables/post.ts +26 -1
  33. package/src/client/composables/search/algolia.ts +2 -1
  34. package/src/client/composables/sidebar.ts +2 -2
  35. package/src/client/composables/tag.ts +9 -2
  36. package/src/client/composables/widgets/backToTop.ts +10 -4
  37. package/src/client/index.html +5 -0
  38. package/src/client/layouts/404.vue +5 -1
  39. package/src/client/main.ts +2 -9
  40. package/src/client/modules/valaxy.ts +31 -13
  41. package/src/client/shims.d.ts +5 -5
  42. package/src/client/styles/common/button.scss +3 -5
  43. package/src/client/styles/common/code.scss +181 -9
  44. package/src/client/styles/common/custom-blocks.scss +84 -0
  45. package/src/client/styles/common/hamburger.scss +2 -2
  46. package/src/client/styles/common/markdown.scss +4 -6
  47. package/src/client/styles/common/sidebar.scss +3 -3
  48. package/src/client/styles/common/transition.scss +2 -2
  49. package/src/client/styles/css-vars.scss +39 -0
  50. package/src/client/styles/global/helper.scss +2 -2
  51. package/src/client/styles/global/i18n.scss +20 -0
  52. package/src/client/styles/global/index.scss +1 -1
  53. package/src/client/styles/global/nprogress.scss +1 -1
  54. package/src/client/styles/global/reset.scss +1 -1
  55. package/src/client/styles/index.scss +21 -8
  56. package/src/client/styles/mixins/config.scss +1 -1
  57. package/src/client/styles/mixins/index.scss +1 -0
  58. package/src/client/styles/palette.scss +58 -44
  59. package/src/client/styles/vars.scss +1 -13
  60. package/src/client/styles/widgets/banner.scss +2 -2
  61. package/src/client/utils/index.ts +0 -2
  62. package/src/node/build.ts +20 -1
  63. package/src/node/cli.ts +32 -19
  64. package/src/node/markdown/headings.ts +3 -2
  65. package/src/node/markdown/highlight.ts +50 -0
  66. package/src/node/markdown/highlightLines.ts +96 -0
  67. package/src/node/markdown/index.ts +23 -12
  68. package/src/node/markdown/markdown-it-container.ts +9 -1
  69. package/src/node/markdown/markdown-it-katex.ts +20 -10
  70. package/src/node/markdown/parseHeader.ts +4 -2
  71. package/src/node/options.ts +3 -1
  72. package/src/node/plugins/index.ts +53 -24
  73. package/src/node/plugins/markdown.ts +1 -1
  74. package/src/node/plugins/preset.ts +46 -10
  75. package/src/node/plugins/unocss.ts +21 -19
  76. package/src/node/rss.ts +127 -0
  77. package/src/node/server.ts +1 -1
  78. package/src/node/shims.d.ts +15 -0
  79. package/src/node/utils/cli.ts +0 -1
  80. package/src/node/vite.ts +7 -15
  81. package/src/types/config.ts +28 -2
  82. package/src/types/posts.ts +6 -1
  83. package/tsup.config.ts +1 -0
  84. package/dist/build-VGAF4K5S.js +0 -1
  85. package/dist/build-Y5F7AZ2V.mjs +0 -1
  86. package/dist/chunk-5KQ3UFYI.js +0 -1
  87. package/dist/chunk-ESCOXVP6.mjs +0 -83
  88. package/dist/chunk-JWA76JND.mjs +0 -1
  89. package/dist/chunk-WYCH73X6.js +0 -83
  90. package/dist/cli.js +0 -6
  91. package/dist/cli.mjs +0 -6
  92. package/src/client/pages/about/index.md +0 -5
  93. package/src/client/pages/posts/index.md +0 -5
  94. package/src/client/styles/css-vars/dark.scss +0 -17
  95. package/src/client/styles/css-vars/index.scss +0 -18
  96. package/src/client/styles/css-vars/light.scss +0 -9
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var c=Object.create;var a=Object.defineProperty,p=Object.defineProperties,m=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols,y=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable;var l=(e,n,t)=>n in e?a(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,x= exports.a =(e,n)=>{for(var t in n||(n={}))g.call(n,t)&&l(e,t,n[t]);if(s)for(var t of s(n))b.call(n,t)&&l(e,t,n[t]);return e},w= exports.b =(e,n)=>p(e,d(n));var k=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(n,t)=>(typeof require!="undefined"?require:n)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var f=(e,n)=>()=>(e&&(n=e(e=0)),n);var v=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports);var h=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of u(n))!g.call(e,i)&&i!==t&&a(e,i,{get:()=>n[i],enumerable:!(r=m(n,i))||r.enumerable});return e};var C=(e,n,t)=>(t=e!=null?c(y(e)):{},h(n||!e||!e.__esModule?a(t,"default",{value:e,enumerable:!0}):t,e));var o=f(()=>{});o();var Y={url:"",lang:"en",title:"Valaxy Blog",subtitle:"Next Generation Static Blog Framework.",author:{avatar:"https://cdn.jsdelivr.net/gh/YunYouJun/yun/images/meme/yun-good-with-bg.jpg",email:"me@yunyoujun.cn",link:"https://www.yunyoujun.cn",name:"YunYouJun",status:{emoji:"\u{1F60A}",message:"All at sea."}},feed:{name:"",favicon:"favicon.png"},social:[],description:"A blog generated by Valaxy.",license:{enabled:!0,language:"",type:"by-nc-sa"},sponsor:{enable:!0,title:"\u6211\u5F88\u53EF\u7231\uFF0C\u8BF7\u7ED9\u6211\u94B1",methods:[{name:"\u652F\u4ED8\u5B9D",url:"https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/donate/alipay-qrcode.jpg",color:"#00A3EE",icon:"i-ri-alipay-line"},{name:"QQ \u652F\u4ED8",url:"https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/donate/qqpay-qrcode.png",color:"#12B7F5",icon:"i-ri-qq-line"},{name:"\u5FAE\u4FE1\u652F\u4ED8",url:"https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/donate/wechatpay-qrcode.jpg",color:"#2DC100",icon:"i-ri-wechat-pay-line"}]},search:{algolia:{enable:!1,appId:"",apiKey:"",indexName:"",chunkSize:5e3}},comment:{waline:{enable:!1,serverURL:""},twikoo:{enable:!1,envId:"https://twikoo.vercel.app"}},theme:"yun",themeConfig:{},unocss:{},markdown:{excerpt:"<!-- more -->"},markdownIt:{toc:{includeLevel:[1,2,3,4],listType:"ol"},katex:{}}};o();o();exports.a = x; exports.b = w; exports.c = k; exports.d = v; exports.e = C; exports.f = o; exports.g = Y;
@@ -0,0 +1 @@
1
+ var p=Object.create;var a=Object.defineProperty,m=Object.defineProperties,c=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols,y=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable;var l=(e,n,t)=>n in e?a(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,x=(e,n)=>{for(var t in n||(n={}))g.call(n,t)&&l(e,t,n[t]);if(s)for(var t of s(n))b.call(n,t)&&l(e,t,n[t]);return e},k=(e,n)=>m(e,d(n));var w=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(n,t)=>(typeof require!="undefined"?require:n)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var f=(e,n)=>()=>(e&&(n=e(e=0)),n);var v=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports);var h=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of u(n))!g.call(e,i)&&i!==t&&a(e,i,{get:()=>n[i],enumerable:!(r=c(n,i))||r.enumerable});return e};var C=(e,n,t)=>(t=e!=null?p(y(e)):{},h(n||!e||!e.__esModule?a(t,"default",{value:e,enumerable:!0}):t,e));var o=f(()=>{});o();var Y={url:"",lang:"en",title:"Valaxy Blog",subtitle:"Next Generation Static Blog Framework.",author:{avatar:"https://cdn.jsdelivr.net/gh/YunYouJun/yun/images/meme/yun-good-with-bg.jpg",email:"me@yunyoujun.cn",link:"https://www.yunyoujun.cn",name:"YunYouJun",status:{emoji:"\u{1F60A}",message:"All at sea."}},feed:{name:"",favicon:"favicon.png"},social:[],description:"A blog generated by Valaxy.",license:{enabled:!0,language:"",type:"by-nc-sa"},sponsor:{enable:!0,title:"\u6211\u5F88\u53EF\u7231\uFF0C\u8BF7\u7ED9\u6211\u94B1",methods:[{name:"\u652F\u4ED8\u5B9D",url:"https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/donate/alipay-qrcode.jpg",color:"#00A3EE",icon:"i-ri-alipay-line"},{name:"QQ \u652F\u4ED8",url:"https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/donate/qqpay-qrcode.png",color:"#12B7F5",icon:"i-ri-qq-line"},{name:"\u5FAE\u4FE1\u652F\u4ED8",url:"https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/donate/wechatpay-qrcode.jpg",color:"#2DC100",icon:"i-ri-wechat-pay-line"}]},search:{algolia:{enable:!1,appId:"",apiKey:"",indexName:"",chunkSize:5e3}},comment:{waline:{enable:!1,serverURL:""},twikoo:{enable:!1,envId:"https://twikoo.vercel.app"}},theme:"yun",themeConfig:{},unocss:{},markdown:{excerpt:"<!-- more -->"},markdownIt:{toc:{includeLevel:[1,2,3,4],listType:"ol"},katex:{}}};o();o();export{x as a,k as b,w as c,v as d,C as e,o as f,Y as g};
@@ -0,0 +1,188 @@
1
+ import { PartialDeep } from 'type-fest';
2
+ import { VitePluginConfig } from 'unocss/vite';
3
+ import MarkdownIt from 'markdown-it';
4
+ import Anchor from 'markdown-it-anchor';
5
+ import { KatexOptions } from 'katex';
6
+ import Markdown from 'vite-plugin-md';
7
+
8
+ interface MarkdownOptions extends MarkdownIt.Options {
9
+ config?: (md: MarkdownIt) => void;
10
+ anchor?: {
11
+ permalink?: Anchor.AnchorOptions['permalink'];
12
+ };
13
+ toc?: any;
14
+ katex?: KatexOptions;
15
+ }
16
+
17
+ declare type ViteMdOptions = Parameters<typeof Markdown>[0];
18
+
19
+ declare type ValaxyThemeConfig = Record<string, any>;
20
+ interface SocialLink {
21
+ /**
22
+ * The title of your link
23
+ */
24
+ name: string;
25
+ link: string;
26
+ /**
27
+ * 图标名称
28
+ * https://icones.js.org/
29
+ */
30
+ icon: string;
31
+ color: string;
32
+ }
33
+ interface ValaxyConfig<T = ValaxyThemeConfig> {
34
+ /**
35
+ * Default language
36
+ * @description 默认语言
37
+ * @default 'en'
38
+ */
39
+ lang: string;
40
+ /**
41
+ * You site url in web, required for ssg & rss
42
+ * @description 站点的 URL,SSG & RSS 需要(譬如生成版权处文章永久链接)
43
+ */
44
+ url: string;
45
+ /**
46
+ * Site title
47
+ * @description 站点标题
48
+ */
49
+ title: string;
50
+ /**
51
+ * 副标题
52
+ */
53
+ subtitle: string;
54
+ /**
55
+ * 站点描述
56
+ */
57
+ description: string;
58
+ /**
59
+ * The owner of this blog
60
+ * @description 博客作者
61
+ */
62
+ author: {
63
+ /**
64
+ * Your name
65
+ * @description 你的名字
66
+ */
67
+ name: string;
68
+ email: string;
69
+ link: string;
70
+ avatar: string;
71
+ /**
72
+ * The status of you
73
+ * @description 状态
74
+ */
75
+ status: {
76
+ emoji: string;
77
+ /**
78
+ * show when hover emoji
79
+ * @description 当鼠标悬浮在图标上时显示
80
+ */
81
+ message: string;
82
+ };
83
+ };
84
+ feed: {
85
+ /**
86
+ * name: feed -> feed.xml / feed.atom / feed.json
87
+ * @default '' -> feed.xml / atom.xml / feed.json
88
+ */
89
+ name: string;
90
+ favicon: string;
91
+ };
92
+ /**
93
+ * 社交链接
94
+ */
95
+ social: SocialLink[];
96
+ /**
97
+ * search
98
+ */
99
+ search: {
100
+ algolia: {
101
+ enable: boolean;
102
+ appId: string;
103
+ apiKey: string;
104
+ indexName: string;
105
+ chunkSize: number;
106
+ };
107
+ };
108
+ /**
109
+ * comment: waline/...
110
+ */
111
+ comment: {
112
+ waline: {
113
+ enable: boolean;
114
+ serverURL: string;
115
+ };
116
+ twikoo: {
117
+ enable: boolean;
118
+ envId: string;
119
+ };
120
+ };
121
+ /**
122
+ * The name of theme
123
+ * @description 主题名称
124
+ */
125
+ theme: string;
126
+ /**
127
+ * The config of theme
128
+ * @description 主题配置
129
+ */
130
+ themeConfig: T;
131
+ /**
132
+ * Unocss Config
133
+ */
134
+ unocss: VitePluginConfig;
135
+ /**
136
+ * The license of your posts
137
+ * @description 文章所使用的协议,默认使用 Creative Commons
138
+ * @default https://creativecommons.org/licenses/
139
+ */
140
+ license: {
141
+ /**
142
+ * Whether to show at the bottom of the article
143
+ * @description 是否显示在文章底部
144
+ * @default true
145
+ */
146
+ enabled: boolean;
147
+ /**
148
+ * Creative License Language, same with your config.lang
149
+ * when lang === 'zh-CN', use 'zh'
150
+ * @description 默认与站点语言相同
151
+ * @default 'en'
152
+ */
153
+ language: string;
154
+ /**
155
+ * Type of license
156
+ * @description 证书类型
157
+ * @default 'by-nc-sa'
158
+ */
159
+ type: 'zero' | 'by-sa' | 'by-nd' | 'by-nc' | 'by-nc-sa' | 'by-nc-nd';
160
+ };
161
+ /**
162
+ * donate for author
163
+ * @description 打赏/赞助
164
+ */
165
+ sponsor: {
166
+ enable: boolean;
167
+ title: string;
168
+ methods: {
169
+ name: string;
170
+ url: string;
171
+ color: string;
172
+ icon: string;
173
+ }[];
174
+ };
175
+ /**
176
+ * for markdown
177
+ */
178
+ markdown: ViteMdOptions;
179
+ markdownIt: MarkdownOptions;
180
+ }
181
+ /**
182
+ * Valaxy User Config
183
+ * @description Valaxy 用户配置
184
+ */
185
+ declare type UserConfig<T = ValaxyThemeConfig> = PartialDeep<ValaxyConfig<T>>;
186
+ declare const defaultValaxyConfig: ValaxyConfig;
187
+
188
+ export { SocialLink as S, UserConfig as U, ValaxyConfig as V, ValaxyThemeConfig as a, defaultValaxyConfig as d };