themekit-js 1.1.5 → 1.1.7
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/Layout.vue +1 -0
- package/dist/client/theme-default/composables/sidebar.js +4 -2
- package/dist/node/cli.js +1 -1
- package/dist/node/index.js +2 -2
- package/dist/node/{serve-TkLPWTJT.js → serve-CVWqBeop.js} +23 -27
- package/package.json +1 -1
- package/template/api-examples.md +0 -49
- package/template/index.md +0 -27
- package/template/markdown-examples.md +0 -85
|
@@ -20,7 +20,8 @@ export function useSidebar() {
|
|
|
20
20
|
const hasSidebar = computed(() => {
|
|
21
21
|
return (frontmatter.value.sidebar !== false &&
|
|
22
22
|
sidebar.value.length > 0 &&
|
|
23
|
-
frontmatter.value.layout
|
|
23
|
+
frontmatter.value.layout == 'doc' //@seedunk frontmatter.value.layout == 'home'
|
|
24
|
+
);
|
|
24
25
|
});
|
|
25
26
|
const leftAside = computed(() => {
|
|
26
27
|
if (hasAside)
|
|
@@ -30,7 +31,8 @@ export function useSidebar() {
|
|
|
30
31
|
return false;
|
|
31
32
|
});
|
|
32
33
|
const hasAside = computed(() => {
|
|
33
|
-
if (frontmatter.value.layout === 'home')
|
|
34
|
+
//@seedunk if (frontmatter.value.layout === 'home') return false
|
|
35
|
+
if (frontmatter.value.layout !== 'doc')
|
|
34
36
|
return false;
|
|
35
37
|
if (frontmatter.value.aside != null)
|
|
36
38
|
return !!frontmatter.value.aside;
|
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-CVWqBeop.js';
|
|
2
2
|
import { createLogger } from 'vite';
|
|
3
3
|
import 'path';
|
|
4
4
|
import 'shiki';
|
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-CVWqBeop.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-CVWqBeop.js';
|
|
5
5
|
import path from 'path';
|
|
6
6
|
import 'crypto';
|
|
7
7
|
import 'module';
|
|
@@ -19677,6 +19677,7 @@ async function resolvePages(srcDir, userConfig, logger) {
|
|
|
19677
19677
|
cwd: srcDir,
|
|
19678
19678
|
ignore: [
|
|
19679
19679
|
"**/node_modules/**",
|
|
19680
|
+
"**/themekit-js/**",
|
|
19680
19681
|
"**/dist/**",
|
|
19681
19682
|
...userConfig.srcExclude || []
|
|
19682
19683
|
]
|
|
@@ -46708,7 +46709,7 @@ function escapeHtml(string) {
|
|
|
46708
46709
|
|
|
46709
46710
|
var escape$1 = /*@__PURE__*/getDefaultExportFromCjs(escapeHtml_1);
|
|
46710
46711
|
|
|
46711
|
-
var version = "1.1.
|
|
46712
|
+
var version = "1.1.7";
|
|
46712
46713
|
|
|
46713
46714
|
async function renderPage(render, config, page, result, appChunk, cssChunk, assets, pageToHashMap, metadataScript, additionalHeadTags) {
|
|
46714
46715
|
const routePath = `/${page.replace(/\.md$/, "")}`;
|
|
@@ -46945,7 +46946,6 @@ async function build(root, buildOptions = {}) {
|
|
|
46945
46946
|
const isDefaultTheme = clientResult && clientResult.output.some(
|
|
46946
46947
|
(chunk) => chunk.type === "chunk" && chunk.name === "theme" && chunk.moduleIds.some((id) => id.includes("client/theme-default"))
|
|
46947
46948
|
);
|
|
46948
|
-
copyAsset(siteConfig);
|
|
46949
46949
|
const metadataScript = generateMetadataScript(pageToHashMap, siteConfig);
|
|
46950
46950
|
if (isDefaultTheme) {
|
|
46951
46951
|
const fontURL = assets.find(
|
|
@@ -46964,6 +46964,27 @@ async function build(root, buildOptions = {}) {
|
|
|
46964
46964
|
]);
|
|
46965
46965
|
}
|
|
46966
46966
|
}
|
|
46967
|
+
const imgs = await out.glob(["**.png", "**.jpg", "**.svg"], {
|
|
46968
|
+
cwd: root,
|
|
46969
|
+
ignore: [
|
|
46970
|
+
"**/node_modules/**",
|
|
46971
|
+
"**/themekit-js/**",
|
|
46972
|
+
"**/dist/**"
|
|
46973
|
+
]
|
|
46974
|
+
});
|
|
46975
|
+
imgs.forEach((file) => {
|
|
46976
|
+
fs$a.stat(file, (err, stats) => {
|
|
46977
|
+
if (err || siteConfig.outDir == null) {
|
|
46978
|
+
return;
|
|
46979
|
+
}
|
|
46980
|
+
const newFilePath = path$q.resolve(siteConfig.outDir, file);
|
|
46981
|
+
const newFileDir = path$q.dirname(newFilePath);
|
|
46982
|
+
if (!fs$a.existsSync(newFileDir)) {
|
|
46983
|
+
fs$a.mkdirSync(newFileDir, { recursive: true });
|
|
46984
|
+
}
|
|
46985
|
+
fs$a.writeFile(newFilePath, fs$a.readFileSync(file));
|
|
46986
|
+
});
|
|
46987
|
+
});
|
|
46967
46988
|
await pMap(
|
|
46968
46989
|
["404.md", ...siteConfig.pages],
|
|
46969
46990
|
async (page) => {
|
|
@@ -47040,31 +47061,6 @@ function generateMetadataScript(pageToHashMap, config) {
|
|
|
47040
47061
|
inHead: true
|
|
47041
47062
|
};
|
|
47042
47063
|
}
|
|
47043
|
-
function copyAsset(config) {
|
|
47044
|
-
if (config.mpa) {
|
|
47045
|
-
return;
|
|
47046
|
-
}
|
|
47047
|
-
const srcDir = path$q.join(config.root, "/.themekit/assets");
|
|
47048
|
-
const destDir = path$q.join(config.outDir, "/.themekit/assets");
|
|
47049
|
-
copyDirectory(srcDir, destDir).then(() => {
|
|
47050
|
-
console.log("Directory copied successfully.");
|
|
47051
|
-
}).catch((error) => {
|
|
47052
|
-
console.error("Error copying directory:", error);
|
|
47053
|
-
});
|
|
47054
|
-
}
|
|
47055
|
-
async function copyDirectory(source, destination) {
|
|
47056
|
-
const entries = await fs$a.readdir(source, { withFileTypes: true });
|
|
47057
|
-
await fs$a.mkdir(destination, { recursive: true });
|
|
47058
|
-
for (let entry of entries) {
|
|
47059
|
-
const srcPath = path$q.join(source, entry.name);
|
|
47060
|
-
const destPath = path$q.join(destination, entry.name);
|
|
47061
|
-
if (entry.isDirectory()) {
|
|
47062
|
-
await copyDirectory(srcPath, destPath);
|
|
47063
|
-
} else {
|
|
47064
|
-
await fs$a.copyFile(srcPath, destPath);
|
|
47065
|
-
}
|
|
47066
|
-
}
|
|
47067
|
-
}
|
|
47068
47064
|
|
|
47069
47065
|
const ESC = '\x1B';
|
|
47070
47066
|
const CSI = `${ESC}[`;
|
package/package.json
CHANGED
package/template/api-examples.md
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
outline: deep
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Runtime API Examples
|
|
6
|
-
|
|
7
|
-
This page demonstrates usage of some of the runtime APIs provided by VitePress.
|
|
8
|
-
|
|
9
|
-
The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files:
|
|
10
|
-
|
|
11
|
-
```md
|
|
12
|
-
<script setup>
|
|
13
|
-
import { useData } from 'themekit-js'
|
|
14
|
-
|
|
15
|
-
const { theme, page, frontmatter } = useData()
|
|
16
|
-
</script>
|
|
17
|
-
|
|
18
|
-
## Results
|
|
19
|
-
|
|
20
|
-
### Theme Data
|
|
21
|
-
<pre>{{ theme }}</pre>
|
|
22
|
-
|
|
23
|
-
### Page Data
|
|
24
|
-
<pre>{{ page }}</pre>
|
|
25
|
-
|
|
26
|
-
### Page Frontmatter
|
|
27
|
-
<pre>{{ frontmatter }}</pre>
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
<script setup>
|
|
31
|
-
import { useData } from 'themekit-js'
|
|
32
|
-
|
|
33
|
-
const { site, theme, page, frontmatter } = useData()
|
|
34
|
-
</script>
|
|
35
|
-
|
|
36
|
-
## Results
|
|
37
|
-
|
|
38
|
-
### Theme Data
|
|
39
|
-
<pre>{{ theme }}</pre>
|
|
40
|
-
|
|
41
|
-
### Page Data
|
|
42
|
-
<pre>{{ page }}</pre>
|
|
43
|
-
|
|
44
|
-
### Page Frontmatter
|
|
45
|
-
<pre>{{ frontmatter }}</pre>
|
|
46
|
-
|
|
47
|
-
## More
|
|
48
|
-
|
|
49
|
-
Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata).
|
package/template/index.md
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
<% if (defaultTheme) { %>---
|
|
2
|
-
layout: home
|
|
3
|
-
|
|
4
|
-
hero:
|
|
5
|
-
name: <%= title %>
|
|
6
|
-
text: <%= description %>
|
|
7
|
-
tagline: My great project tagline
|
|
8
|
-
actions:
|
|
9
|
-
- theme: brand
|
|
10
|
-
text: Markdown Examples
|
|
11
|
-
link: /markdown-examples
|
|
12
|
-
- theme: alt
|
|
13
|
-
text: API Examples
|
|
14
|
-
link: /api-examples
|
|
15
|
-
|
|
16
|
-
features:
|
|
17
|
-
- title: Feature A
|
|
18
|
-
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
|
|
19
|
-
- title: Feature B
|
|
20
|
-
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
|
|
21
|
-
- title: Feature C
|
|
22
|
-
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
|
|
23
|
-
---
|
|
24
|
-
<% } else { %>---
|
|
25
|
-
home: true
|
|
26
|
-
---
|
|
27
|
-
<% } %>
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
# Markdown Extension Examples
|
|
2
|
-
|
|
3
|
-
This page demonstrates some of the built-in markdown extensions provided by VitePress.
|
|
4
|
-
|
|
5
|
-
## Syntax Highlighting
|
|
6
|
-
|
|
7
|
-
VitePress provides Syntax Highlighting powered by [Shiki](https://github.com/shikijs/shiki), with additional features like line-highlighting:
|
|
8
|
-
|
|
9
|
-
**Input**
|
|
10
|
-
|
|
11
|
-
````md
|
|
12
|
-
```js{4}
|
|
13
|
-
export default {
|
|
14
|
-
data () {
|
|
15
|
-
return {
|
|
16
|
-
msg: 'Highlighted!'
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
```
|
|
21
|
-
````
|
|
22
|
-
|
|
23
|
-
**Output**
|
|
24
|
-
|
|
25
|
-
```js{4}
|
|
26
|
-
export default {
|
|
27
|
-
data () {
|
|
28
|
-
return {
|
|
29
|
-
msg: 'Highlighted!'
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Custom Containers
|
|
36
|
-
|
|
37
|
-
**Input**
|
|
38
|
-
|
|
39
|
-
```md
|
|
40
|
-
::: info
|
|
41
|
-
This is an info box.
|
|
42
|
-
:::
|
|
43
|
-
|
|
44
|
-
::: tip
|
|
45
|
-
This is a tip.
|
|
46
|
-
:::
|
|
47
|
-
|
|
48
|
-
::: warning
|
|
49
|
-
This is a warning.
|
|
50
|
-
:::
|
|
51
|
-
|
|
52
|
-
::: danger
|
|
53
|
-
This is a dangerous warning.
|
|
54
|
-
:::
|
|
55
|
-
|
|
56
|
-
::: details
|
|
57
|
-
This is a details block.
|
|
58
|
-
:::
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
**Output**
|
|
62
|
-
|
|
63
|
-
::: info
|
|
64
|
-
This is an info box.
|
|
65
|
-
:::
|
|
66
|
-
|
|
67
|
-
::: tip
|
|
68
|
-
This is a tip.
|
|
69
|
-
:::
|
|
70
|
-
|
|
71
|
-
::: warning
|
|
72
|
-
This is a warning.
|
|
73
|
-
:::
|
|
74
|
-
|
|
75
|
-
::: danger
|
|
76
|
-
This is a dangerous warning.
|
|
77
|
-
:::
|
|
78
|
-
|
|
79
|
-
::: details
|
|
80
|
-
This is a details block.
|
|
81
|
-
:::
|
|
82
|
-
|
|
83
|
-
## More
|
|
84
|
-
|
|
85
|
-
Check out the documentation for the [full list of markdown extensions](https://vitepress.dev/guide/markdown).
|