valaxy 0.4.0 → 0.6.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 (155) hide show
  1. package/README.md +0 -4
  2. package/{src/client → client}/App.vue +0 -0
  3. package/{src/client/composables/search/index.ts → client/app/data.ts} +0 -0
  4. package/{src/client → client}/components/AppLink.vue +0 -0
  5. package/client/components/PostCard.vue +84 -0
  6. package/{src/client → client}/components/PostList.vue +0 -0
  7. package/{src/client → client}/components/README.md +0 -0
  8. package/{src/client → client}/components/ValaxyBg.vue +0 -0
  9. package/{src/client → client}/components/ValaxyCopyright.vue +0 -0
  10. package/{src/client → client}/components/ValaxyFooter.vue +1 -1
  11. package/{src/client → client}/components/ValaxyHamburger.vue +0 -0
  12. package/client/components/ValaxyMd.vue +74 -0
  13. package/{src/client → client}/components/ValaxyOverlay.vue +0 -0
  14. package/{src/client → client}/components/ValaxyPagination.vue +0 -0
  15. package/{src/client → client}/components/ValaxyRightSidebar.vue +0 -0
  16. package/{src/client → client}/components/ValaxySidebar.vue +0 -0
  17. package/{src/client → client}/components/ValaxyToc.vue +3 -3
  18. package/{src/client → client}/composables/category.ts +0 -0
  19. package/{src/client → client}/composables/comments/index.ts +0 -0
  20. package/{src/client → client}/composables/comments/twikoo.ts +0 -0
  21. package/{src/client → client}/composables/comments/waline.ts +0 -0
  22. package/{src/client → client}/composables/common.ts +0 -0
  23. package/client/composables/copy-code.ts +92 -0
  24. package/{src/client → client}/composables/dark.ts +0 -0
  25. package/client/composables/features/index.ts +0 -0
  26. package/{src/client → client}/composables/helper.ts +0 -0
  27. package/{src/client → client}/composables/index.ts +1 -1
  28. package/{src/client → client}/composables/layout.ts +0 -0
  29. package/client/composables/outline.ts +168 -0
  30. package/{src/client → client}/composables/post.ts +0 -0
  31. package/client/composables/search/index.ts +0 -0
  32. package/{src/client → client}/composables/sidebar.ts +46 -1
  33. package/{src/client → client}/composables/tag.ts +0 -0
  34. package/{src/client → client}/composables/widgets/aplayer.ts +0 -0
  35. package/{src/client → client}/composables/widgets/backToTop.ts +0 -0
  36. package/{src/client → client}/composables/widgets/codepen.ts +0 -0
  37. package/{src/client → client}/composables/widgets/index.ts +0 -0
  38. package/client/config.ts +75 -0
  39. package/{src/client → client}/index.html +0 -0
  40. package/{src/client → client}/index.ts +0 -0
  41. package/{src/client → client}/layouts/404.vue +0 -0
  42. package/{src/client → client}/layouts/README.md +0 -0
  43. package/{src/client → client}/locales/README.md +0 -0
  44. package/{src/client → client}/locales/en.yml +1 -0
  45. package/{src/client → client}/locales/zh-CN.yml +4 -3
  46. package/{src/client → client}/main.ts +4 -1
  47. package/{src/client → client}/modules/README.md +0 -0
  48. package/{src/client → client}/modules/nprogress.ts +0 -0
  49. package/{src/client → client}/modules/pinia.ts +0 -0
  50. package/{src/client → client}/modules/valaxy.ts +19 -7
  51. package/{src/client → client}/pages/README.md +0 -0
  52. package/{src/client → client}/pages/[...all].vue +0 -0
  53. package/{src/client → client}/pages/hi/[name].vue +0 -0
  54. package/{src/client → client}/pages/index.vue +0 -0
  55. package/{src/client → client}/pages/page/[page].vue +0 -0
  56. package/{src/client → client}/shims.d.ts +7 -1
  57. package/{src/client → client}/stores/app.ts +0 -0
  58. package/{src/client → client}/stores/user.ts +0 -0
  59. package/{src/client → client}/styles/common/button.scss +0 -0
  60. package/client/styles/common/code.scss +231 -0
  61. package/{src/client → client}/styles/common/custom-blocks.scss +0 -0
  62. package/{src/client → client}/styles/common/hamburger.scss +0 -0
  63. package/{src/client → client}/styles/common/markdown.scss +0 -2
  64. package/client/styles/common/scrollbar.scss +28 -0
  65. package/{src/client → client}/styles/common/sidebar.scss +0 -0
  66. package/{src/client → client}/styles/common/transition.scss +0 -0
  67. package/client/styles/css-vars.scss +62 -0
  68. package/{src/client → client}/styles/global/helper.scss +0 -0
  69. package/{src/client → client}/styles/global/i18n.scss +0 -0
  70. package/{src/client → client}/styles/global/index.scss +0 -0
  71. package/{src/client → client}/styles/global/nprogress.scss +0 -0
  72. package/{src/client → client}/styles/global/reset.scss +0 -0
  73. package/{src/client → client}/styles/index.scss +0 -0
  74. package/{src/client → client}/styles/mixins/config.scss +0 -0
  75. package/{src/client → client}/styles/mixins/index.scss +0 -0
  76. package/{src/client → client}/styles/mixins/size.scss +0 -0
  77. package/{src/client → client}/styles/mixins/variable.scss +0 -0
  78. package/{src/client → client}/styles/palette.scss +21 -2
  79. package/client/styles/third/katex.scss +3 -0
  80. package/client/styles/vars.scss +41 -0
  81. package/{src/client → client}/styles/widgets/banner.scss +0 -0
  82. package/{src/client → client}/types.ts +0 -0
  83. package/{src/client → client}/utils/helper.ts +22 -0
  84. package/{src/client → client}/utils/index.ts +0 -0
  85. package/client/utils/sidebar.ts +26 -0
  86. package/{src/client → client}/utils/time.ts +0 -0
  87. package/config/index.ts +18 -0
  88. package/dist/chunk-EAN2KU6W.mjs +1 -0
  89. package/dist/chunk-HMUGSKPK.mjs +40 -0
  90. package/dist/chunk-U5OMNIOK.js +1 -0
  91. package/dist/chunk-ZHHNO5RK.js +40 -0
  92. package/dist/{config-de04677b.d.ts → config-112ac884.d.ts} +37 -14
  93. package/dist/index.d.ts +65 -111
  94. package/dist/index.js +1 -1
  95. package/dist/index.mjs +1 -1
  96. package/dist/node/cli.js +7 -11
  97. package/dist/node/cli.mjs +7 -11
  98. package/dist/node/index.d.ts +3 -2
  99. package/dist/node/index.js +1 -1
  100. package/dist/node/index.mjs +1 -1
  101. package/{src/index.ts → index.ts} +1 -0
  102. package/{src/node → node}/build.ts +0 -0
  103. package/{src/node → node}/cli.ts +3 -2
  104. package/node/config.ts +156 -0
  105. package/{src/node → node}/index.ts +0 -0
  106. package/{src/node → node}/markdown/check.ts +0 -0
  107. package/node/markdown/highlight.ts +38 -0
  108. package/{src/node → node}/markdown/index.ts +30 -16
  109. package/{src/node → node}/markdown/markdown-it/container.ts +0 -0
  110. package/{src/node → node}/markdown/markdown-it/headings.ts +0 -0
  111. package/{src/node → node}/markdown/markdown-it/highlightLines.ts +1 -1
  112. package/{src/node → node}/markdown/markdown-it/katex.ts +0 -0
  113. package/{src/node → node}/markdown/markdown-it/parseHeader.ts +0 -0
  114. package/node/markdown/markdownToVue.ts +274 -0
  115. package/{src/node → node}/markdown/slugify.ts +0 -0
  116. package/{src/node → node}/options.ts +18 -2
  117. package/{src/node → node}/plugins/extendConfig.ts +5 -3
  118. package/node/plugins/index.ts +224 -0
  119. package/{src/node → node}/plugins/preset.ts +8 -8
  120. package/{src/node → node}/plugins/unocss.ts +0 -0
  121. package/{src/node → node}/plugins/valaxy.ts +0 -0
  122. package/{src/node → node}/rss.ts +1 -1
  123. package/{src/node → node}/server.ts +0 -0
  124. package/{src/node → node}/shims.d.ts +0 -5
  125. package/{src/node → node}/utils/cli.ts +1 -1
  126. package/node/utils/getGitTimestamp.ts +13 -0
  127. package/node/utils/index.ts +59 -0
  128. package/node/utils/net.ts +20 -0
  129. package/{src/node → node}/vite.ts +5 -1
  130. package/package.json +32 -13
  131. package/shared/index.ts +1 -0
  132. package/tsup.config.ts +7 -4
  133. package/{src/types → types}/config.ts +31 -108
  134. package/types/data.ts +31 -0
  135. package/{src/types → types}/index.ts +1 -0
  136. package/{src/types → types}/posts.ts +6 -1
  137. package/dist/chunk-6LIOFBAA.mjs +0 -1
  138. package/dist/chunk-HRARZPSA.js +0 -83
  139. package/dist/chunk-N6HD5SHF.mjs +0 -83
  140. package/dist/chunk-V3BMKLEW.js +0 -1
  141. package/src/client/components/PostCard.vue +0 -68
  142. package/src/client/components/ValaxyMd.vue +0 -71
  143. package/src/client/composables/features/index.ts +0 -1
  144. package/src/client/composables/features/katex.ts +0 -15
  145. package/src/client/composables/search/algolia.ts +0 -115
  146. package/src/client/config.ts +0 -51
  147. package/src/client/styles/common/code.scss +0 -207
  148. package/src/client/styles/common/scrollbar.scss +0 -34
  149. package/src/client/styles/css-vars.scss +0 -39
  150. package/src/client/styles/vars.scss +0 -27
  151. package/src/node/config.ts +0 -52
  152. package/src/node/markdown/highlight.ts +0 -50
  153. package/src/node/plugins/index.ts +0 -120
  154. package/src/node/plugins/markdown.ts +0 -57
  155. package/src/node/utils/index.ts +0 -26
@@ -1,7 +1,6 @@
1
1
  import type { PartialDeep } from 'type-fest'
2
2
  import type { VitePluginConfig } from 'unocss/vite'
3
3
  import type { MarkdownOptions } from '../node/markdown'
4
- import type { ViteMdOptions } from '../node/plugins/markdown'
5
4
 
6
5
  export type ValaxyThemeConfig = Record<string, any>
7
6
 
@@ -19,6 +18,18 @@ export interface SocialLink {
19
18
  color: string
20
19
  }
21
20
 
21
+ export interface AlgoliaSearchOptions {
22
+ enable: boolean
23
+ appId: string
24
+ apiKey: string
25
+ indexName: string
26
+ placeholder?: string
27
+ searchParameters?: any
28
+ disableUserPersonalization?: boolean
29
+ initialQuery?: string
30
+ }
31
+
32
+ // packages/valaxy/node/config.ts
22
33
  export interface ValaxyConfig<T = ValaxyThemeConfig> {
23
34
  /**
24
35
  * Default language
@@ -29,6 +40,7 @@ export interface ValaxyConfig<T = ValaxyThemeConfig> {
29
40
  /**
30
41
  * You site url in web, required for ssg & rss
31
42
  * @description 站点的 URL,SSG & RSS 需要(譬如生成版权处文章永久链接)
43
+ * @default '/'
32
44
  */
33
45
  url: string
34
46
  /**
@@ -71,6 +83,11 @@ export interface ValaxyConfig<T = ValaxyThemeConfig> {
71
83
  }
72
84
  }
73
85
 
86
+ /**
87
+ * show last updated time by git
88
+ */
89
+ lastUpdated: boolean
90
+
74
91
  /**
75
92
  * icon for your website
76
93
  */
@@ -94,13 +111,8 @@ export interface ValaxyConfig<T = ValaxyThemeConfig> {
94
111
  * search
95
112
  */
96
113
  search: {
97
- algolia: {
98
- enable: boolean
99
- appId: string
100
- apiKey: string
101
- indexName: string
102
- chunkSize: number
103
- }
114
+ enable: boolean
115
+ algolia: AlgoliaSearchOptions
104
116
  }
105
117
 
106
118
  /**
@@ -117,6 +129,16 @@ export interface ValaxyConfig<T = ValaxyThemeConfig> {
117
129
  }
118
130
  }
119
131
 
132
+ /**
133
+ * Markdown Feature
134
+ */
135
+ features: {
136
+ /**
137
+ * enable katex for global
138
+ */
139
+ katex: boolean
140
+ }
141
+
120
142
  /**
121
143
  * The name of theme
122
144
  * @description 主题名称
@@ -185,7 +207,6 @@ export interface ValaxyConfig<T = ValaxyThemeConfig> {
185
207
  /**
186
208
  * for markdown
187
209
  */
188
- markdown: ViteMdOptions
189
210
  markdownIt: MarkdownOptions
190
211
  }
191
212
 
@@ -193,102 +214,4 @@ export interface ValaxyConfig<T = ValaxyThemeConfig> {
193
214
  * Valaxy User Config
194
215
  * @description Valaxy 用户配置
195
216
  */
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
- }
217
+ export type UserConfig<ThemeConfig = ValaxyThemeConfig> = PartialDeep<ValaxyConfig<ThemeConfig>>
package/types/data.ts ADDED
@@ -0,0 +1,31 @@
1
+ import type { Post } from './posts'
2
+
3
+ export interface Header {
4
+ level: number
5
+ title: string
6
+ slug: string
7
+ /**
8
+ * i18n
9
+ */
10
+ lang?: string
11
+ }
12
+
13
+ export interface PageData {
14
+ path: string
15
+ relativePath: string
16
+ title: string
17
+ titleTemplate?: string
18
+ description: string
19
+ headers: Header[]
20
+ frontmatter: Post
21
+ lastUpdated?: number
22
+ }
23
+
24
+ export interface PageDataPayload {
25
+ path: string
26
+ pageData: PageData
27
+ }
28
+
29
+ export type HeadConfig =
30
+ | [string, Record<string, string>]
31
+ | [string, Record<string, string>, string]
@@ -1,2 +1,3 @@
1
1
  export * from './config'
2
2
  export * from './posts'
3
+ export * from './data'
@@ -109,9 +109,14 @@ 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 样式
115
120
  */
116
- markdown: boolean
121
+ markdown?: boolean
117
122
  }
@@ -1 +0,0 @@
1
- var g=Object.create;var a=Object.defineProperty,c=Object.defineProperties,m=Object.getOwnPropertyDescriptor,p=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertyNames,r=Object.getOwnPropertySymbols,d=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;var s=(n,e,i)=>e in n?a(n,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[e]=i,h=(n,e)=>{for(var i in e||(e={}))l.call(e,i)&&s(n,i,e[i]);if(r)for(var i of r(e))y.call(e,i)&&s(n,i,e[i]);return n},b=(n,e)=>c(n,p(e));var k=(n=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(n,{get:(e,i)=>(typeof require!="undefined"?require:e)[i]}):n)(function(n){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+n+'" is not supported')});var v=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var f=(n,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of u(e))!l.call(n,t)&&t!==i&&a(n,t,{get:()=>e[t],enumerable:!(o=m(e,t))||o.enumerable});return n};var x=(n,e,i)=>(i=n!=null?g(d(n)):{},f(e||!n||!n.__esModule?a(i,"default",{value:n,enumerable:!0}):i,n));var C={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,C as f};