valaxy 0.3.10 → 0.5.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.
Files changed (147) hide show
  1. package/README.md +4 -0
  2. package/{src/client → client}/App.vue +0 -0
  3. package/{src/client → client}/components/AppLink.vue +0 -0
  4. package/{src/client → client}/components/PostCard.vue +37 -23
  5. package/{src/client → client}/components/PostList.vue +0 -0
  6. package/{src/client → client}/components/README.md +0 -0
  7. package/{src/client → client}/components/ValaxyBg.vue +1 -1
  8. package/{src/client → client}/components/ValaxyCopyright.vue +0 -0
  9. package/{src/client → client}/components/ValaxyFooter.vue +2 -2
  10. package/{src/client → client}/components/ValaxyHamburger.vue +0 -0
  11. package/{src/client → client}/components/ValaxyMd.vue +1 -5
  12. package/{src/client → client}/components/ValaxyOverlay.vue +0 -0
  13. package/{src/client → client}/components/ValaxyPagination.vue +0 -0
  14. package/{src/client → client}/components/ValaxyRightSidebar.vue +0 -0
  15. package/{src/client → client}/components/ValaxySidebar.vue +0 -0
  16. package/{src/client → client}/components/ValaxyToc.vue +0 -0
  17. package/{src/client → client}/composables/category.ts +0 -0
  18. package/{src/client → client}/composables/comments/index.ts +0 -0
  19. package/{src/client → client}/composables/comments/twikoo.ts +0 -0
  20. package/{src/client → client}/composables/comments/waline.ts +0 -0
  21. package/{src/client → client}/composables/common.ts +0 -0
  22. package/{src/client → client}/composables/dark.ts +0 -0
  23. package/{src/client/composables/search → client/composables/features}/index.ts +0 -0
  24. package/{src/client → client}/composables/helper.ts +0 -0
  25. package/{src/client → client}/composables/index.ts +1 -1
  26. package/{src/client → client}/composables/layout.ts +0 -0
  27. package/{src/client → client}/composables/post.ts +0 -0
  28. package/client/composables/search/index.ts +0 -0
  29. package/{src/client → client}/composables/sidebar.ts +10 -8
  30. package/{src/client → client}/composables/tag.ts +0 -0
  31. package/{src/client → client}/composables/widgets/aplayer.ts +0 -0
  32. package/{src/client → client}/composables/widgets/backToTop.ts +0 -0
  33. package/{src/client → client}/composables/widgets/codepen.ts +0 -0
  34. package/{src/client → client}/composables/widgets/index.ts +0 -0
  35. package/{src/client → client}/config.ts +2 -1
  36. package/{src/client → client}/index.html +0 -0
  37. package/{src/client → client}/index.ts +0 -0
  38. package/{src/client → client}/layouts/404.vue +0 -0
  39. package/{src/client → client}/layouts/README.md +0 -0
  40. package/{src/client → client}/locales/README.md +0 -0
  41. package/{src/client → client}/locales/en.yml +1 -0
  42. package/{src/client → client}/locales/zh-CN.yml +4 -3
  43. package/{src/client → client}/main.ts +5 -1
  44. package/{src/client → client}/modules/README.md +0 -0
  45. package/{src/client → client}/modules/nprogress.ts +0 -0
  46. package/{src/client → client}/modules/pinia.ts +0 -0
  47. package/{src/client → client}/modules/valaxy.ts +1 -1
  48. package/{src/client → client}/pages/README.md +0 -0
  49. package/{src/client → client}/pages/[...all].vue +0 -0
  50. package/{src/client → client}/pages/hi/[name].vue +0 -0
  51. package/{src/client → client}/pages/index.vue +0 -0
  52. package/{src/client → client}/pages/page/[page].vue +0 -0
  53. package/{src/client → client}/shims.d.ts +1 -0
  54. package/{src/client → client}/stores/app.ts +0 -0
  55. package/{src/client → client}/stores/user.ts +0 -0
  56. package/{src/client → client}/styles/common/button.scss +0 -0
  57. package/{src/client → client}/styles/common/code.scss +0 -0
  58. package/{src/client → client}/styles/common/custom-blocks.scss +0 -0
  59. package/{src/client → client}/styles/common/hamburger.scss +0 -0
  60. package/{src/client → client}/styles/common/markdown.scss +5 -1
  61. package/client/styles/common/scrollbar.scss +28 -0
  62. package/{src/client → client}/styles/common/sidebar.scss +0 -0
  63. package/{src/client → client}/styles/common/transition.scss +0 -0
  64. package/{src/client → client}/styles/css-vars.scss +0 -0
  65. package/{src/client → client}/styles/global/helper.scss +0 -0
  66. package/{src/client → client}/styles/global/i18n.scss +0 -0
  67. package/{src/client → client}/styles/global/index.scss +0 -0
  68. package/{src/client → client}/styles/global/nprogress.scss +0 -0
  69. package/{src/client → client}/styles/global/reset.scss +0 -0
  70. package/{src/client → client}/styles/index.scss +0 -0
  71. package/{src/client → client}/styles/mixins/config.scss +0 -0
  72. package/{src/client → client}/styles/mixins/index.scss +0 -0
  73. package/{src/client → client}/styles/mixins/size.scss +0 -0
  74. package/{src/client → client}/styles/mixins/variable.scss +0 -0
  75. package/{src/client → client}/styles/palette.scss +0 -0
  76. package/client/styles/third/katex.scss +3 -0
  77. package/{src/client → client}/styles/vars.scss +0 -0
  78. package/{src/client → client}/styles/widgets/banner.scss +0 -0
  79. package/{src/client → client}/types.ts +0 -0
  80. package/{src/client → client}/utils/helper.ts +0 -0
  81. package/{src/client → client}/utils/index.ts +0 -0
  82. package/{src/client → client}/utils/time.ts +0 -0
  83. package/dist/chunk-EAN2KU6W.mjs +1 -0
  84. package/dist/chunk-RSQONJW3.mjs +86 -0
  85. package/dist/chunk-U5OMNIOK.js +1 -0
  86. package/dist/chunk-XQIGHIAX.js +86 -0
  87. package/dist/client/index.d.ts +188 -0
  88. package/dist/client/index.js +1 -0
  89. package/dist/client/index.mjs +1 -0
  90. package/dist/{config-de04677b.d.ts → config-7bd43d41.d.ts} +24 -12
  91. package/dist/node/cli.js +10 -10
  92. package/dist/node/cli.mjs +10 -10
  93. package/dist/node/index.d.ts +2 -2
  94. package/dist/node/index.js +1 -1
  95. package/dist/node/index.mjs +1 -1
  96. package/dist/posts-32f55e33.d.ts +117 -0
  97. package/dist/types/index.d.ts +8 -0
  98. package/dist/types/index.js +1 -0
  99. package/dist/types/index.mjs +0 -0
  100. package/index.d.ts +3 -0
  101. package/{src/node → node}/build.ts +0 -0
  102. package/{src/node → node}/cli.ts +3 -2
  103. package/node/config.ts +170 -0
  104. package/{src/node → node}/index.ts +0 -0
  105. package/{src/node → node}/markdown/check.ts +0 -0
  106. package/{src/node → node}/markdown/highlight.ts +0 -0
  107. package/{src/node → node}/markdown/index.ts +0 -0
  108. package/{src/node → node}/markdown/markdown-it/container.ts +0 -0
  109. package/{src/node → node}/markdown/markdown-it/headings.ts +0 -0
  110. package/{src/node → node}/markdown/markdown-it/highlightLines.ts +0 -0
  111. package/{src/node → node}/markdown/markdown-it/katex.ts +0 -0
  112. package/{src/node → node}/markdown/markdown-it/parseHeader.ts +0 -0
  113. package/{src/node → node}/markdown/slugify.ts +0 -0
  114. package/{src/node → node}/options.ts +2 -2
  115. package/{src/node → node}/plugins/extendConfig.ts +3 -1
  116. package/{src/node → node}/plugins/index.ts +10 -3
  117. package/{src/node → node}/plugins/markdown.ts +3 -6
  118. package/{src/node → node}/plugins/preset.ts +0 -30
  119. package/{src/node → node}/plugins/unocss.ts +0 -0
  120. package/{src/node → node}/plugins/valaxy.ts +0 -0
  121. package/{src/node → node}/rss.ts +0 -0
  122. package/{src/node → node}/server.ts +6 -4
  123. package/{src/node → node}/shims.d.ts +0 -0
  124. package/{src/node → node}/utils/cli.ts +1 -1
  125. package/node/utils/index.ts +48 -0
  126. package/node/utils/net.ts +20 -0
  127. package/{src/node → node}/vite.ts +5 -1
  128. package/package.json +21 -16
  129. package/tsup.config.ts +4 -3
  130. package/{src/types → types}/config.ts +27 -107
  131. package/{src/types → types}/index.ts +0 -0
  132. package/{src/types → types}/posts.ts +5 -0
  133. package/dist/chunk-6QPICP7C.mjs +0 -1
  134. package/dist/chunk-PICIUZML.js +0 -83
  135. package/dist/chunk-S2VGPR56.mjs +0 -83
  136. package/dist/chunk-ZP4HS4GX.js +0 -1
  137. package/dist/index.d.ts +0 -407
  138. package/dist/index.js +0 -1
  139. package/dist/index.mjs +0 -1
  140. package/src/client/composables/features/index.ts +0 -1
  141. package/src/client/composables/features/katex.ts +0 -15
  142. package/src/client/composables/search/algolia.ts +0 -115
  143. package/src/client/modules/pwa.ts +0 -12
  144. package/src/client/styles/common/scrollbar.scss +0 -34
  145. package/src/index.ts +0 -2
  146. package/src/node/config.ts +0 -52
  147. package/src/node/utils/index.ts +0 -26
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valaxy",
3
- "version": "0.3.10",
3
+ "version": "0.5.0",
4
4
  "description": "📄 Vite & Vue powered static blog generator.",
5
5
  "author": {
6
6
  "email": "me@yunyoujun.cn",
@@ -16,11 +16,17 @@
16
16
  "blog"
17
17
  ],
18
18
  "exports": {
19
- ".": "./src/index.ts",
19
+ ".": {
20
+ "types": "./index.d.ts",
21
+ "require": "./dist/index.js",
22
+ "import": "./dist/index.mjs"
23
+ },
24
+ "./client": "./dist/client.d.ts",
25
+ "./client/*": "./client/*",
20
26
  "./*": "./*"
21
27
  },
22
28
  "main": "dist/index.js",
23
- "types": "dist/index.d.ts",
29
+ "types": "index.d.ts",
24
30
  "bin": {
25
31
  "vala": "./bin/valaxy.js",
26
32
  "valaxy": "./bin/valaxy.js"
@@ -30,11 +36,13 @@
30
36
  },
31
37
  "dependencies": {
32
38
  "@ctrl/tinycolor": "^3.4.1",
39
+ "@docsearch/css": "^3.1.0",
40
+ "@docsearch/js": "^3.1.0",
33
41
  "@iconify-json/carbon": "^1.1.5",
34
42
  "@iconify-json/ri": "^1.1.2",
35
43
  "@intlify/vite-plugin-vue-i18n": "^3.4.0",
36
44
  "@vitejs/plugin-vue": "^2.3.3",
37
- "@vueuse/core": "^8.6.0",
45
+ "@vueuse/core": "^8.7.3",
38
46
  "@vueuse/head": "^0.7.6",
39
47
  "consola": "^2.15.3",
40
48
  "critters": "^0.0.16",
@@ -55,22 +63,21 @@
55
63
  "pinia": "^2.0.14",
56
64
  "prism-theme-vars": "^0.2.3",
57
65
  "prismjs": "^1.28.0",
58
- "sass": "^1.52.2",
66
+ "sass": "^1.52.3",
59
67
  "star-markdown-css": "^0.3.3",
60
68
  "unconfig": "^0.3.4",
61
- "unocss": "^0.37.4",
69
+ "unocss": "^0.39.0",
62
70
  "unplugin-vue-components": "^0.19.6",
63
- "vite": "^2.9.10",
71
+ "vite": "^2.9.12",
64
72
  "vite-plugin-inspect": "^0.5.0",
65
- "vite-plugin-md": "^0.14.0",
66
- "vite-plugin-pages": "^0.23.0",
67
- "vite-plugin-pwa": "^0.12.0",
73
+ "vite-plugin-md": "^0.13.1",
74
+ "vite-plugin-pages": "^0.24.2",
68
75
  "vite-plugin-vue-layouts": "^0.6.0",
69
- "vite-ssg": "0.20.1",
76
+ "vite-ssg": "0.19.2",
70
77
  "vite-ssg-sitemap": "0.2.7",
71
78
  "vue": "^3.2.37",
72
79
  "vue-i18n": "^9.1.10",
73
- "vue-router": "^4.0.15",
80
+ "vue-router": "^4.0.16",
74
81
  "yargs": "^17.5.1"
75
82
  },
76
83
  "devDependencies": {
@@ -81,15 +88,13 @@
81
88
  "debug": "^4.3.4",
82
89
  "diacritics": "^1.3.0",
83
90
  "https-localhost": "^4.7.1",
84
- "type-fest": "^2.13.0",
85
- "vue-tsc": "^0.37.0"
91
+ "type-fest": "^2.13.1"
86
92
  },
87
93
  "scripts": {
88
94
  "build": "rimraf dist && tsup --splitting",
89
95
  "dev": "tsup --watch --splitting",
90
96
  "lint": "eslint \"**/*.{vue,ts,js}\"",
91
97
  "preview": "vite preview",
92
- "preview-https": "serve dist",
93
- "typecheck": "vue-tsc --noEmit"
98
+ "preview-https": "serve dist"
94
99
  }
95
100
  }
package/tsup.config.ts CHANGED
@@ -3,9 +3,10 @@ import { defineConfig } from 'tsup'
3
3
  export default defineConfig((options) => {
4
4
  return {
5
5
  entry: [
6
- 'src/index.ts',
7
- 'src/node/index.ts',
8
- 'src/node/cli.ts',
6
+ 'client/index.ts',
7
+ 'node/index.ts',
8
+ 'node/cli.ts',
9
+ 'types/index.ts',
9
10
  ],
10
11
  // https://tsup.egoist.sh/#code-splitting
11
12
  // Code splitting currently only works with the esm output format, and it's enabled by default. If you want code splitting for cjs output format as well, try using --splitting flag which is an experimental feature to get rid of the limitation in esbuild.
@@ -1,7 +1,9 @@
1
1
  import type { PartialDeep } from 'type-fest'
2
2
  import type { VitePluginConfig } from 'unocss/vite'
3
+ import type Markdown from 'vite-plugin-md'
3
4
  import type { MarkdownOptions } from '../node/markdown'
4
- import type { ViteMdOptions } from '../node/plugins/markdown'
5
+
6
+ export type ViteMdOptions = Parameters<typeof Markdown>[0]
5
7
 
6
8
  export type ValaxyThemeConfig = Record<string, any>
7
9
 
@@ -19,6 +21,17 @@ export interface SocialLink {
19
21
  color: string
20
22
  }
21
23
 
24
+ export interface AlgoliaSearchOptions {
25
+ enable: boolean
26
+ appId: string
27
+ apiKey: string
28
+ indexName: string
29
+ placeholder?: string
30
+ searchParameters?: any
31
+ disableUserPersonalization?: boolean
32
+ initialQuery?: string
33
+ }
34
+
22
35
  export interface ValaxyConfig<T = ValaxyThemeConfig> {
23
36
  /**
24
37
  * Default language
@@ -94,13 +107,8 @@ export interface ValaxyConfig<T = ValaxyThemeConfig> {
94
107
  * search
95
108
  */
96
109
  search: {
97
- algolia: {
98
- enable: boolean
99
- appId: string
100
- apiKey: string
101
- indexName: string
102
- chunkSize: number
103
- }
110
+ enable: boolean
111
+ algolia: AlgoliaSearchOptions
104
112
  }
105
113
 
106
114
  /**
@@ -117,6 +125,16 @@ export interface ValaxyConfig<T = ValaxyThemeConfig> {
117
125
  }
118
126
  }
119
127
 
128
+ /**
129
+ * Markdown Feature
130
+ */
131
+ features: {
132
+ /**
133
+ * enable katex for global
134
+ */
135
+ katex: boolean
136
+ }
137
+
120
138
  /**
121
139
  * The name of theme
122
140
  * @description 主题名称
@@ -193,102 +211,4 @@ export interface ValaxyConfig<T = ValaxyThemeConfig> {
193
211
  * Valaxy User Config
194
212
  * @description Valaxy 用户配置
195
213
  */
196
- export type UserConfig<T = ValaxyThemeConfig> = PartialDeep<ValaxyConfig<T>>
197
-
198
- export const defaultValaxyConfig: ValaxyConfig = {
199
- url: '',
200
- lang: 'en',
201
- title: 'Valaxy Blog',
202
- description: 'A blog generated by Valaxy.',
203
- subtitle: 'Next Generation Static Blog Framework.',
204
- author: {
205
- avatar: 'https://cdn.jsdelivr.net/gh/YunYouJun/yun/images/meme/yun-good-with-bg.jpg',
206
- email: 'me@yunyoujun.cn',
207
- link: 'https://www.yunyoujun.cn',
208
- name: 'YunYouJun',
209
- status: {
210
- emoji: '😊',
211
- message: 'All at sea.',
212
- },
213
- },
214
- favicon: 'favicon.svg',
215
- feed: {
216
- name: '',
217
- favicon: 'favicon.svg',
218
- },
219
- social: [],
220
-
221
- license: {
222
- enabled: true,
223
- language: '',
224
- type: 'by-nc-sa',
225
- },
226
-
227
- sponsor: {
228
- enable: true,
229
- title: '我很可爱,请给我钱',
230
- methods: [
231
- {
232
- name: '支付宝',
233
- url: 'https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/donate/alipay-qrcode.jpg',
234
- color: '#00A3EE',
235
- icon: 'i-ri-alipay-line',
236
- },
237
- {
238
- name: 'QQ 支付',
239
- url: 'https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/donate/qqpay-qrcode.png',
240
- color: '#12B7F5',
241
- icon: 'i-ri-qq-line',
242
- },
243
- {
244
- name: '微信支付',
245
- url: 'https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/donate/wechatpay-qrcode.jpg',
246
- color: '#2DC100',
247
- icon: 'i-ri-wechat-pay-line',
248
- },
249
-
250
- ],
251
- },
252
-
253
- search: {
254
- algolia: {
255
- enable: false,
256
- appId: '',
257
- apiKey: '',
258
- indexName: '',
259
- chunkSize: 5000,
260
- },
261
- },
262
-
263
- comment: {
264
- waline: {
265
- enable: false,
266
- serverURL: '',
267
- },
268
- twikoo: {
269
- enable: false,
270
- envId: 'https://twikoo.vercel.app',
271
- },
272
- },
273
-
274
- theme: 'yun',
275
- themeConfig: {
276
- pkg: {
277
- name: '',
278
- version: '',
279
- },
280
- },
281
-
282
- unocss: {},
283
-
284
- markdown: {
285
- excerpt: '<!-- more -->',
286
- },
287
- markdownIt: {
288
- toc: {
289
- includeLevel: [1, 2, 3, 4],
290
- listType: 'ol',
291
- },
292
- katex: {},
293
- },
294
- }
214
+ export type UserConfig<ThemeConfig = ValaxyThemeConfig> = PartialDeep<ValaxyConfig<ThemeConfig>>
File without changes
@@ -109,6 +109,11 @@ export interface Post extends Record<string, any> {
109
109
  * @description 是否为草稿
110
110
  */
111
111
  draft?: boolean
112
+ /**
113
+ * cover
114
+ * @description 封面图片
115
+ */
116
+ cover?: string
112
117
  /**
113
118
  * enable markdown-body class
114
119
  * @description 是否启用默认的 markdown 样式
@@ -1 +0,0 @@
1
- var c=Object.create;var a=Object.defineProperty,m=Object.defineProperties,p=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyDescriptors,d=Object.getOwnPropertyNames,r=Object.getOwnPropertySymbols,y=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,f=Object.prototype.propertyIsEnumerable;var s=(e,n,i)=>n in e?a(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i,h=(e,n)=>{for(var i in n||(n={}))l.call(n,i)&&s(e,i,n[i]);if(r)for(var i of r(n))f.call(n,i)&&s(e,i,n[i]);return e},b=(e,n)=>m(e,u(n));var k=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(n,i)=>(typeof require!="undefined"?require:n)[i]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var v=(e,n)=>()=>(e&&(n=e(e=0)),n);var x=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),w=(e,n)=>{for(var i in n)a(e,i,{get:n[i],enumerable:!0})},g=(e,n,i,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of d(n))!l.call(e,t)&&t!==i&&a(e,t,{get:()=>n[t],enumerable:!(o=p(n,t))||o.enumerable});return e};var C=(e,n,i)=>(i=e!=null?c(y(e)):{},g(n||!e||!e.__esModule?a(i,"default",{value:e,enumerable:!0}):i,e)),V=e=>g(a({},"__esModule",{value:!0}),e);var Y={url:"",lang:"en",title:"Valaxy Blog",description:"A blog generated by Valaxy.",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."}},favicon:"favicon.svg",feed:{name:"",favicon:"favicon.svg"},social:[],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:{pkg:{name:"",version:""}},unocss:{},markdown:{excerpt:"<!-- more -->"},markdownIt:{toc:{includeLevel:[1,2,3,4],listType:"ol"},katex:{}}};export{h as a,b,k as c,v as d,x as e,w as f,C as g,V as h,Y as i};