themekit-js 1.48.1212 → 1.49.2618

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.
@@ -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 />
@@ -9,11 +9,13 @@
9
9
  a.btn{
10
10
  text-decoration:none !important;
11
11
  border-radius: 28px;
12
- padding: 0 12px;
12
+ padding: 0 8px;
13
13
  line-height: 28px;
14
14
  font-size: 14px;
15
+
16
+
15
17
  }
16
- a.btn .icon{ display: inline-flex; vertical-align: middle; margin-left: -6px; margin-right: 2px;margin-top: -2px; }
18
+ a.btn .icon{ display: inline-flex; vertical-align: middle; border-radius: 100px; margin-left: -6px; margin-right: 2px;margin-top: -2px; }
17
19
  .btn:active {
18
20
  transition: color 0.1s, border-color 0.1s, background-color 0.1s;
19
21
  }
@@ -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="secret_ppf82nO2iZgQ7IA7btWhxO9ocyC8C2pzG0YsPgCyuuA"
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-CHUX9t8R.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-DQeart1n.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
 
@@ -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-CHUX9t8R.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-CHUX9t8R.js';
3
+ import { g as glob, c as createMarkdownRenderer, f as fs, m as matter, a as getDefaultExportFromCjs } from './serve-DQeart1n.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-DQeart1n.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';
@@ -38218,6 +38219,33 @@ function clearCache(file) {
38218
38219
  file = JSON.stringify({ file }).slice(1);
38219
38220
  cache$1.find((_, key) => key.endsWith(file) && cache$1.delete(key));
38220
38221
  }
38222
+ async function seedunk_mdparser(src) {
38223
+ const regexmd = new RegExp(/\]\((.+?)\)/g);
38224
+ let matchmd;
38225
+ let plain = src;
38226
+ while ((matchmd = regexmd.exec(src)) !== null) {
38227
+ if (matchmd[1].indexOf("?include=markdown") >= 0) {
38228
+ const mdresponse = await axios.get(matchmd[1]);
38229
+ if (mdresponse.status == 200) {
38230
+ let mdraw = mdresponse.data;
38231
+ let imgmatch;
38232
+ const imgregex = new RegExp(/\!\[(.+?)\)/g);
38233
+ while ((imgmatch = imgregex.exec(mdraw)) !== null) {
38234
+ const args = imgmatch[1].split("(");
38235
+ if (args.length > 1) {
38236
+ const imgsrc = args[1];
38237
+ if (imgsrc.indexOf("http") < 0 && imgsrc.substring(0, 1) != "/") {
38238
+ const parsedPath = path$q.parse(matchmd[1]);
38239
+ mdraw = mdraw.replace(imgsrc, parsedPath.dir + "/" + imgsrc);
38240
+ }
38241
+ }
38242
+ }
38243
+ plain = plain.replace(matchmd[1], matchmd[1] + ")\r\n" + mdraw);
38244
+ }
38245
+ }
38246
+ }
38247
+ return plain;
38248
+ }
38221
38249
  async function createMarkdownToVueRenderFn(srcDir, options = {}, pages, isBuild = false, base = "/", includeLastUpdatedData = false, cleanUrls = false, siteConfig = null) {
38222
38250
  const md = await createMarkdownRenderer(
38223
38251
  srcDir,
@@ -38334,7 +38362,7 @@ async function createMarkdownToVueRenderFn(srcDir, options = {}, pages, isBuild
38334
38362
  const blockType = blockTypeRegex.exec(block);
38335
38363
  let blockContent = "";
38336
38364
  if (blockType == null) ; else if (blockType[0] == "Doc" || blockType[0] == "Github" || blockType[0] == "DocWithCatalog") {
38337
- blockContent = md.render(block, env);
38365
+ blockContent = md.render(await seedunk_mdparser(block), env);
38338
38366
  } else if (blockType[0] == "HTML") {
38339
38367
  blockContent = encodeURIComponent(block);
38340
38368
  }
@@ -38352,7 +38380,7 @@ async function createMarkdownToVueRenderFn(srcDir, options = {}, pages, isBuild
38352
38380
  blocks.push(blockItem);
38353
38381
  }
38354
38382
  }
38355
- const html = md.render(src, env);
38383
+ const html = md.render(await seedunk_mdparser(src), env);
38356
38384
  const {
38357
38385
  frontmatter = {},
38358
38386
  headers = [],
@@ -46745,7 +46773,7 @@ function escapeHtml(string) {
46745
46773
 
46746
46774
  var escape$1 = /*@__PURE__*/getDefaultExportFromCjs(escapeHtml_1);
46747
46775
 
46748
- var version = "1.48.1212";
46776
+ var version = "1.49.2618";
46749
46777
 
46750
46778
  async function renderPage(render, config, page, result, appChunk, cssChunk, assets, pageToHashMap, metadataScript, additionalHeadTags) {
46751
46779
  const routePath = `/${page.replace(/\.md$/, "")}`;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "themekit-js",
3
- "version": "1.48.1212",
4
- "description": "基于VitePress开发的Markdown静态网站生成器",
3
+ "version": "1.49.2618",
4
+ "description": "基于VitePress开发的Markdown静态网站生成器",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@8.15.6",
7
7
  "main": "dist/node/index.js",