@ansidev-oss/vitepress-theme-ansidev 1.2.0 → 1.3.0
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/node/composables/excerpt.d.ts +9 -0
- package/dist/node/composables/excerpt.test.d.ts +1 -0
- package/dist/node/composables/index.d.ts +4 -0
- package/dist/node/composables/markdown.d.ts +2 -0
- package/dist/node/composables/route.d.ts +15 -0
- package/dist/node/composables/slug.d.ts +7 -0
- package/dist/node/composables/types.d.ts +7 -0
- package/dist/node/config.d.ts +45 -0
- package/package.json +1 -3
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalizes a post/project excerpt into safe HTML suitable for v-html.
|
|
3
|
+
*
|
|
4
|
+
* Excerpts may originate raw (gray-matter) or pre-rendered (createContentLoader).
|
|
5
|
+
* Raw input is rendered with markdown-it with html disabled, so inline markdown
|
|
6
|
+
* (links, emphasis, inline code) works and source HTML is escaped (no injection).
|
|
7
|
+
* Excess `undefined`/empty input yields undefined.
|
|
8
|
+
*/
|
|
9
|
+
export declare const useExcerptHtml: (excerpt?: string) => string | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Pattern } from './types';
|
|
2
|
+
export declare const useMarkdownFrontmatterRoute: (pattern: Pattern, frontmatterKey: string, excerptSeparator?: string) => {
|
|
3
|
+
paths(): {
|
|
4
|
+
params: {
|
|
5
|
+
slug: string;
|
|
6
|
+
};
|
|
7
|
+
}[];
|
|
8
|
+
};
|
|
9
|
+
export declare const useArchiveRoute: (pattern: Pattern, excerptSeparator?: string) => {
|
|
10
|
+
paths(): {
|
|
11
|
+
params: {
|
|
12
|
+
slug: string;
|
|
13
|
+
};
|
|
14
|
+
}[];
|
|
15
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Pattern, StringOrFrontmatterToString } from './types';
|
|
2
|
+
export declare const useSlugFromMarkdownFrontMatter: (pattern: Pattern, frontmatterKeyOrMappingFn: StringOrFrontmatterToString, excerptSeparator?: string) => {
|
|
3
|
+
params: {
|
|
4
|
+
slug: string;
|
|
5
|
+
};
|
|
6
|
+
}[];
|
|
7
|
+
export { useSlug, useSlugFilter } from '../../shared/composables';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type Pattern = string | string[];
|
|
2
|
+
export type Frontmatter = Record<string, unknown> & {
|
|
3
|
+
date?: string;
|
|
4
|
+
excerpt?: string;
|
|
5
|
+
};
|
|
6
|
+
export type FrontmatterToString = (frontmatter: Frontmatter) => string;
|
|
7
|
+
export type StringOrFrontmatterToString = string | FrontmatterToString;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { UserConfig } from 'vitepress';
|
|
2
|
+
import type { ThemeConfig } from '../client/types';
|
|
3
|
+
/**
|
|
4
|
+
* @type {import('vitepress').UserConfig}
|
|
5
|
+
*/
|
|
6
|
+
declare const baseConfig: {
|
|
7
|
+
themeConfig: {
|
|
8
|
+
siteURL: string;
|
|
9
|
+
googleAnalytics: {
|
|
10
|
+
id: string;
|
|
11
|
+
};
|
|
12
|
+
search: {
|
|
13
|
+
provider: string;
|
|
14
|
+
options: {
|
|
15
|
+
/**
|
|
16
|
+
* @param {string} src
|
|
17
|
+
* @param {import('vitepress').MarkdownEnv} env
|
|
18
|
+
* @param {import('markdown-it')} md
|
|
19
|
+
*/
|
|
20
|
+
_render(src: any, env: any, md: any): Promise<string>;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
vite: {
|
|
25
|
+
ssr: {
|
|
26
|
+
noExternal: string[];
|
|
27
|
+
};
|
|
28
|
+
optimizeDeps: {
|
|
29
|
+
exclude: string[];
|
|
30
|
+
};
|
|
31
|
+
css: {
|
|
32
|
+
preprocessorOptions: {
|
|
33
|
+
scss: {
|
|
34
|
+
api: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Helper function to define theme configuration with proper typing
|
|
42
|
+
* Note: TailwindCSS plugin should be added in vite.config.ts, not here
|
|
43
|
+
*/
|
|
44
|
+
export declare function defineWithDefaultThemeConfig(config?: UserConfig<ThemeConfig>): UserConfig<ThemeConfig>;
|
|
45
|
+
export default baseConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ansidev-oss/vitepress-theme-ansidev",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "The VitePress theme for ansidev's blog",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/node/index.js",
|
|
@@ -69,7 +69,6 @@
|
|
|
69
69
|
"rimraf": "^6.1.3",
|
|
70
70
|
"swetrix": "^4.1.0",
|
|
71
71
|
"tailwindcss": "^4.2.0",
|
|
72
|
-
"ts-node": "^10.9.2",
|
|
73
72
|
"typescript": "^6.0.0",
|
|
74
73
|
"vite": "npm:@voidzero-dev/vite-plus-core@1.4.0",
|
|
75
74
|
"vitepress": "^2.0.0-alpha.16",
|
|
@@ -83,7 +82,6 @@
|
|
|
83
82
|
"gray-matter": "^4.0.3",
|
|
84
83
|
"medium-zoom": "^1.1.0",
|
|
85
84
|
"swetrix": "^4.1.0",
|
|
86
|
-
"ts-node": "^10.9.2",
|
|
87
85
|
"typescript": "^5.9.3",
|
|
88
86
|
"vitepress": "^2.0.0-alpha.16",
|
|
89
87
|
"vue": "^3.5.28"
|