themekit-js 1.48.1010 → 1.49.2616
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/dist/client/theme-default/components/TKBlock.vue +2 -0
- package/dist/client/theme-default/components/blocks/Media.vue +32 -0
- package/dist/client/theme-default/components/blocks/MediaRender.vue +44 -0
- package/dist/client/theme-default/components/blocks/Notion.vue +1 -1
- package/dist/node/cli.js +2 -1
- package/dist/node/index.js +3 -2
- package/dist/node/{serve-C0Qeytmf.js → serve-DVm7krPI.js} +31 -3
- package/package.json +2 -2
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { useData } from '../composables/data'
|
|
4
4
|
import Hero from './blocks/Hero.vue';
|
|
5
5
|
import Doc from './blocks/Doc.vue';
|
|
6
|
+
import Media from './blocks/Media.vue';
|
|
6
7
|
import DocWithCatalog from './blocks/DocWithCatalog.vue'
|
|
7
8
|
import Notion from './blocks/Notion.vue';
|
|
8
9
|
import HTML from './blocks/HTML.vue';
|
|
@@ -21,6 +22,7 @@ const { frontmatter } = useData()
|
|
|
21
22
|
<DocWithCatalog :block="item" v-else-if="item.block_type =='DocWithCatalog'" ></DocWithCatalog>
|
|
22
23
|
<Notion :block="item" v-else-if="item.block_type =='Notion'" ></Notion>
|
|
23
24
|
<HTML :block="item" v-else-if="item.block_type =='HTML'" ></HTML>
|
|
25
|
+
<Media :block="item" v-else-if="item.block_type =='Media'" ></Media>
|
|
24
26
|
</div>
|
|
25
27
|
<VPHomeContent v-if="frontmatter.markdownStyles !== false">
|
|
26
28
|
<Content />
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DefaultTheme } from 'themekit-js/theme'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
// import MediaRender from './MediaRender.vue';
|
|
6
|
+
interface Props {
|
|
7
|
+
block?:any
|
|
8
|
+
name?: string
|
|
9
|
+
text?: string
|
|
10
|
+
tagline?: string
|
|
11
|
+
image?: DefaultTheme.ThemeableImage
|
|
12
|
+
}
|
|
13
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
14
|
+
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<div v-html="props.block.content" >
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<style scoped>
|
|
31
|
+
|
|
32
|
+
</style>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// import MarkdownIt from 'markdown-it'
|
|
3
|
+
/**
|
|
4
|
+
import { ref } from 'vue'
|
|
5
|
+
import axios from 'axios'
|
|
6
|
+
interface Props {
|
|
7
|
+
block?:any,
|
|
8
|
+
href?:String,
|
|
9
|
+
}
|
|
10
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
11
|
+
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
let content:String=ref("");
|
|
17
|
+
|
|
18
|
+
const option={
|
|
19
|
+
headers:{
|
|
20
|
+
'forward':"https://api.notion.com",
|
|
21
|
+
'forward-heads':"Notion-Version",
|
|
22
|
+
'Content-Type': 'application/json',
|
|
23
|
+
'Notion-Version': '2022-06-28'
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
axios.get(props.href,option)
|
|
27
|
+
.then(response => {
|
|
28
|
+
content.value=MarkdownIt({
|
|
29
|
+
html: true,
|
|
30
|
+
linkify: true
|
|
31
|
+
}).render(response.data);
|
|
32
|
+
})
|
|
33
|
+
.catch(error => { content=error; });
|
|
34
|
+
|
|
35
|
+
-v-html="content"
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<template>
|
|
41
|
+
<div ></div>
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
|
|
@@ -29,7 +29,7 @@ let Results=ref(null)
|
|
|
29
29
|
let Page=ref({"properties":{"Page":false}})
|
|
30
30
|
let Blocks=ref(null);
|
|
31
31
|
const API="http://forward.seedunk.com/v1/"
|
|
32
|
-
const Bearer="
|
|
32
|
+
const Bearer=""
|
|
33
33
|
|
|
34
34
|
const option={
|
|
35
35
|
headers:{
|
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-
|
|
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-DVm7krPI.js';
|
|
2
2
|
import { createLogger } from 'vite';
|
|
3
3
|
import 'path';
|
|
4
4
|
import 'shiki';
|
|
@@ -30,6 +30,7 @@ import 'http';
|
|
|
30
30
|
import 'querystring';
|
|
31
31
|
import 'tty';
|
|
32
32
|
import 'constants';
|
|
33
|
+
import 'axios';
|
|
33
34
|
import 'node:crypto';
|
|
34
35
|
import 'minisearch';
|
|
35
36
|
|
package/dist/node/index.js
CHANGED
|
@@ -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-
|
|
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-
|
|
3
|
+
import { g as glob, c as createMarkdownRenderer, f as fs, m as matter, a as getDefaultExportFromCjs } from './serve-DVm7krPI.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-DVm7krPI.js';
|
|
5
5
|
import path from 'path';
|
|
6
6
|
import 'crypto';
|
|
7
7
|
import 'module';
|
|
@@ -30,6 +30,7 @@ import 'http';
|
|
|
30
30
|
import 'querystring';
|
|
31
31
|
import 'tty';
|
|
32
32
|
import 'constants';
|
|
33
|
+
import 'axios';
|
|
33
34
|
import 'node:crypto';
|
|
34
35
|
import 'shiki';
|
|
35
36
|
import '@shikijs/transformers';
|
|
@@ -29,6 +29,7 @@ import http from 'http';
|
|
|
29
29
|
import * as qs from 'querystring';
|
|
30
30
|
import require$$0$4 from 'tty';
|
|
31
31
|
import require$$0$1 from 'constants';
|
|
32
|
+
import axios from 'axios';
|
|
32
33
|
import { webcrypto } from 'node:crypto';
|
|
33
34
|
import { getHighlighter, bundledLanguages, isSpecialLang } from 'shiki';
|
|
34
35
|
import { transformerNotationDiff, transformerNotationFocus, transformerNotationHighlight, transformerNotationErrorLevel, transformerCompactLineOptions } from '@shikijs/transformers';
|
|
@@ -37153,8 +37154,9 @@ const imagePlugin = (md, { lazyLoading } = {}, base) => {
|
|
|
37153
37154
|
if (!/^\.?\//.test(url))
|
|
37154
37155
|
url = "./" + url;
|
|
37155
37156
|
}
|
|
37156
|
-
if (url)
|
|
37157
|
-
token.attrSet("src",
|
|
37157
|
+
if (url) {
|
|
37158
|
+
token.attrSet("src", url);
|
|
37159
|
+
}
|
|
37158
37160
|
}
|
|
37159
37161
|
if (lazyLoading) {
|
|
37160
37162
|
token.attrSet("loading", "lazy");
|
|
@@ -38334,6 +38336,32 @@ async function createMarkdownToVueRenderFn(srcDir, options = {}, pages, isBuild
|
|
|
38334
38336
|
let blockContent = "";
|
|
38335
38337
|
if (blockType == null) ; else if (blockType[0] == "Doc" || blockType[0] == "Github" || blockType[0] == "DocWithCatalog") {
|
|
38336
38338
|
blockContent = md.render(block, env);
|
|
38339
|
+
} else if (blockType[0] == "Media") {
|
|
38340
|
+
const regex2 = new RegExp(/\]\((.+?)\.md\)/g);
|
|
38341
|
+
let match3;
|
|
38342
|
+
let plain = block;
|
|
38343
|
+
while ((match3 = regex2.exec(block)) !== null) {
|
|
38344
|
+
const md2 = match3[1] + ".md";
|
|
38345
|
+
const mdresponse = await axios.get(md2);
|
|
38346
|
+
if (mdresponse.status == 200) {
|
|
38347
|
+
let mdraw = mdresponse.data;
|
|
38348
|
+
let imgmatch;
|
|
38349
|
+
const imgregex = new RegExp(/\!\[(.+?)\)/g);
|
|
38350
|
+
while ((imgmatch = imgregex.exec(mdraw)) !== null) {
|
|
38351
|
+
const args = imgmatch[1].split("(");
|
|
38352
|
+
if (args.length > 1) {
|
|
38353
|
+
const imgsrc = args[1];
|
|
38354
|
+
if (imgsrc.indexOf("http") < 0 && imgsrc.substring(0, 1) != "/") {
|
|
38355
|
+
mdraw = mdraw.replace(imgsrc, md2 + "/../" + imgsrc);
|
|
38356
|
+
}
|
|
38357
|
+
}
|
|
38358
|
+
}
|
|
38359
|
+
console.log("------------------------");
|
|
38360
|
+
console.log(mdraw);
|
|
38361
|
+
plain = plain.replace(md2, md2 + ")\r\n" + mdraw);
|
|
38362
|
+
}
|
|
38363
|
+
}
|
|
38364
|
+
blockContent = md.render(plain, env);
|
|
38337
38365
|
} else if (blockType[0] == "HTML") {
|
|
38338
38366
|
blockContent = encodeURIComponent(block);
|
|
38339
38367
|
}
|
|
@@ -46744,7 +46772,7 @@ function escapeHtml(string) {
|
|
|
46744
46772
|
|
|
46745
46773
|
var escape$1 = /*@__PURE__*/getDefaultExportFromCjs(escapeHtml_1);
|
|
46746
46774
|
|
|
46747
|
-
var version = "1.
|
|
46775
|
+
var version = "1.49.2616";
|
|
46748
46776
|
|
|
46749
46777
|
async function renderPage(render, config, page, result, appChunk, cssChunk, assets, pageToHashMap, metadataScript, additionalHeadTags) {
|
|
46750
46778
|
const routePath = `/${page.replace(/\.md$/, "")}`;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "themekit-js",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "基于VitePress开发的Markdown静态网站生成器",
|
|
3
|
+
"version": "1.49.2616",
|
|
4
|
+
"description": "基于VitePress开发的Markdown静态网站生成器",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@8.15.6",
|
|
7
7
|
"main": "dist/node/index.js",
|