themekit-js 1.1.30 → 1.1.32

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.
@@ -33,14 +33,30 @@ const params = computed(() => {
33
33
  // return [params["theme"]==null?props.theme:params["theme"],params["size"]==null?props.size:params["size"],props.baseClass]
34
34
  })
35
35
 
36
-
36
+
37
+ const classes = computed(() => {
38
+ const _:any=[props.baseClass]
39
+ if(params.value['theme']!=null){
40
+ _.push(params.value['theme'])
41
+ }
42
+ if(params.value['size']!=null){
43
+ _.push(params.value['size'])
44
+ }
45
+
46
+ if(params.value['class']!=null){
47
+ _.push(params.value['class'])
48
+ }
49
+ return _
50
+ })
51
+
52
+ //[params['theme']==null?props.theme:params['theme'],params['size']==null?props.size:params['size'],props.baseClass]
37
53
  </script>
38
54
 
39
55
  <template >
40
56
  <component
41
57
  :is="component"
42
58
  class="btn"
43
- :class="[params['theme']==null?props.theme:params['theme'],params['size']==null?props.size:params['size'],props.baseClass]"
59
+ :class="classes"
44
60
  :href="href ? href : undefined"
45
61
  :target="props.target"
46
62
  >
@@ -25,7 +25,12 @@ function hasCover(children:any){
25
25
 
26
26
  if(match.length>2&&match[1]=="class"&&match[2]=="cover"){
27
27
  styles.push({"display":"block"})
28
- styles.push({"background-image":"url("+ base.value+ child["src"] +")"})
28
+ const src=child["src"]
29
+ if(src.substring(0,1)=="/"){
30
+ styles.push({"background-image":"url("+ base.value+src.substring(1,src.length) +")"})
31
+ }else{
32
+ styles.push({"background-image":"url("+ src +")"})
33
+ }
29
34
  break
30
35
  }
31
36
  }
@@ -59,16 +64,13 @@ function hasCover(children:any){
59
64
  <template v-for="(subitem) in item.children">
60
65
  <template v-if="subitem.block_type=='text'">{{subitem.content}} </template>
61
66
  <Image v-if="subitem.block_type=='img'"
62
- :block="subitem"
63
- />
67
+ :block="subitem" />
64
68
  <Button v-if="subitem.block_type=='a'"
65
- tag="a"
66
- size="medium"
69
+ tag="a"
70
+ size="medium"
67
71
  :block="subitem"
68
72
  :href="subitem.href"
69
- :target="_blank"
70
- ></Button>
71
-
73
+ :target="_blank" ></Button>
72
74
  </template>
73
75
  </p>
74
76
 
@@ -70,7 +70,14 @@ const styles= computed(() => {
70
70
  styles.push({ 'background-color':props.block['background-color']})
71
71
  }
72
72
  if(props.block['background-image']){
73
- styles.push({ 'background-image':'url('+base.value+props.block['background-image']+")"})
73
+
74
+ const src=props.block['background-image']
75
+ if(src.substring(0,1)=="/"){
76
+ styles.push({"background-image":"url("+ base.value+src.substring(1,src.length) +")"})
77
+ }else{
78
+ styles.push({"background-image":"url("+ src +")"})
79
+ }
80
+
74
81
  }
75
82
  if(props.block['color']){
76
83
  styles.push({ 'color': props.block['color']})
package/dist/node/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as getDefaultExportFromCjs, q as c, t as clearCache, n as init, b as build, o as serve, v as version, p as createServer } from './serve-mJVIC3K8.js';
1
+ import { a as getDefaultExportFromCjs, q as c, t as clearCache, n as init, b as build, o as serve, v as version, p as createServer } from './serve-DnyzZFIh.js';
2
2
  import { createLogger } from 'vite';
3
3
  import 'path';
4
4
  import 'shiki';
@@ -1,7 +1,7 @@
1
1
  import { normalizePath } from 'vite';
2
2
  export { loadEnv } from 'vite';
3
- import { g as glob, c as createMarkdownRenderer, f as fs, m as matter, a as getDefaultExportFromCjs } from './serve-mJVIC3K8.js';
4
- export { S as ScaffoldThemeType, b as build, p as createServer, e as defineConfig, h as defineConfigWithTheme, d as defineLoader, n as init, j as mergeConfig, r as resolveConfig, l as resolvePages, k as resolveSiteData, i as resolveUserConfig, s as scaffold, o as serve } from './serve-mJVIC3K8.js';
3
+ import { g as glob, c as createMarkdownRenderer, f as fs, m as matter, a as getDefaultExportFromCjs } from './serve-DnyzZFIh.js';
4
+ export { S as ScaffoldThemeType, b as build, p as createServer, e as defineConfig, h as defineConfigWithTheme, d as defineLoader, n as init, j as mergeConfig, r as resolveConfig, l as resolvePages, k as resolveSiteData, i as resolveUserConfig, s as scaffold, o as serve } from './serve-DnyzZFIh.js';
5
5
  import path from 'path';
6
6
  import 'crypto';
7
7
  import 'module';
@@ -46733,7 +46733,7 @@ function escapeHtml(string) {
46733
46733
 
46734
46734
  var escape$1 = /*@__PURE__*/getDefaultExportFromCjs(escapeHtml_1);
46735
46735
 
46736
- var version = "1.1.30";
46736
+ var version = "1.1.32";
46737
46737
 
46738
46738
  async function renderPage(render, config, page, result, appChunk, cssChunk, assets, pageToHashMap, metadataScript, additionalHeadTags) {
46739
46739
  const routePath = `/${page.replace(/\.md$/, "")}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "themekit-js",
3
- "version": "1.1.30",
3
+ "version": "1.1.32",
4
4
  "description": "基于VitePress开发的Markdown静态网站生成器",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@8.15.6",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "./vue-demi": {
29
29
  "default": "./lib/vue-demi.mjs"
30
- }
30
+ }
31
31
  },
32
32
  "bin": {
33
33
  "themekit": "bin/themekit.js"