@docusaurus/plugin-content-blog 2.0.0-beta.17 → 2.0.0-beta.18
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/lib/authors.d.ts +3 -1
- package/lib/authors.js +10 -2
- package/lib/blogUtils.d.ts +3 -1
- package/lib/blogUtils.js +9 -7
- package/lib/feed.d.ts +2 -1
- package/lib/feed.js +9 -8
- package/lib/{blogFrontMatter.d.ts → frontMatter.d.ts} +3 -1
- package/lib/{blogFrontMatter.js → frontMatter.js} +0 -0
- package/lib/index.d.ts +2 -2
- package/lib/index.js +6 -14
- package/lib/markdownLoader.js +1 -1
- package/lib/options.d.ts +10 -0
- package/lib/{pluginOptionSchema.js → options.js} +8 -3
- package/lib/translations.js +4 -4
- package/lib/types.d.ts +7 -49
- package/package.json +10 -10
- package/src/authors.ts +29 -18
- package/src/blogUtils.ts +14 -12
- package/src/deps.d.ts +1 -1
- package/src/feed.ts +11 -6
- package/src/{blogFrontMatter.ts → frontMatter.ts} +3 -3
- package/src/index.ts +17 -34
- package/src/markdownLoader.ts +1 -1
- package/src/{pluginOptionSchema.ts → options.ts} +15 -3
- package/src/plugin-content-blog.d.ts +390 -69
- package/src/translations.ts +6 -4
- package/src/types.ts +5 -61
- package/lib/pluginOptionSchema.d.ts +0 -10
package/src/types.ts
CHANGED
|
@@ -5,15 +5,9 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type {
|
|
9
|
-
import type {
|
|
10
|
-
|
|
11
|
-
ContentPaths,
|
|
12
|
-
} from '@docusaurus/utils/lib/markdownLinks';
|
|
13
|
-
import type {
|
|
14
|
-
BlogPostFrontMatter,
|
|
15
|
-
Author,
|
|
16
|
-
} from '@docusaurus/plugin-content-blog';
|
|
8
|
+
import type {BrokenMarkdownLink, ContentPaths} from '@docusaurus/utils';
|
|
9
|
+
import type {BlogPostMetadata} from '@docusaurus/plugin-content-blog';
|
|
10
|
+
import type {Metadata as BlogPaginatedMetadata} from '@theme/BlogListPage';
|
|
17
11
|
|
|
18
12
|
export type BlogContentPaths = ContentPaths;
|
|
19
13
|
|
|
@@ -42,70 +36,20 @@ export interface BlogTag {
|
|
|
42
36
|
|
|
43
37
|
export interface BlogPost {
|
|
44
38
|
id: string;
|
|
45
|
-
metadata:
|
|
39
|
+
metadata: BlogPostMetadata;
|
|
46
40
|
content: string;
|
|
47
41
|
}
|
|
48
42
|
|
|
49
|
-
export interface BlogPaginatedMetadata {
|
|
50
|
-
permalink: string;
|
|
51
|
-
page: number;
|
|
52
|
-
postsPerPage: number;
|
|
53
|
-
totalPages: number;
|
|
54
|
-
totalCount: number;
|
|
55
|
-
previousPage: string | null;
|
|
56
|
-
nextPage: string | null;
|
|
57
|
-
blogTitle: string;
|
|
58
|
-
blogDescription: string;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
43
|
export interface BlogPaginated {
|
|
62
44
|
metadata: BlogPaginatedMetadata;
|
|
63
45
|
items: string[]; // blog post permalinks
|
|
64
46
|
}
|
|
65
47
|
|
|
66
|
-
export interface MetaData {
|
|
67
|
-
permalink: string;
|
|
68
|
-
source: string;
|
|
69
|
-
description: string;
|
|
70
|
-
date: Date;
|
|
71
|
-
formattedDate: string;
|
|
72
|
-
tags: Tag[];
|
|
73
|
-
title: string;
|
|
74
|
-
readingTime?: number;
|
|
75
|
-
prevItem?: Paginator;
|
|
76
|
-
nextItem?: Paginator;
|
|
77
|
-
truncated: boolean;
|
|
78
|
-
editUrl?: string;
|
|
79
|
-
authors: Author[];
|
|
80
|
-
frontMatter: BlogPostFrontMatter & Record<string, unknown>;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export interface Paginator {
|
|
84
|
-
title: string;
|
|
85
|
-
permalink: string;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export interface BlogItemsToMetadata {
|
|
89
|
-
[key: string]: MetaData;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export interface TagsModule {
|
|
93
|
-
[key: string]: TagModule;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export interface TagModule {
|
|
97
|
-
allTagsPath: string;
|
|
98
|
-
slug: string;
|
|
99
|
-
name: string;
|
|
100
|
-
count: number;
|
|
101
|
-
permalink: string;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
48
|
export type BlogBrokenMarkdownLink = BrokenMarkdownLink<BlogContentPaths>;
|
|
105
49
|
export type BlogMarkdownLoaderOptions = {
|
|
106
50
|
siteDir: string;
|
|
107
51
|
contentPaths: BlogContentPaths;
|
|
108
52
|
truncateMarker: RegExp;
|
|
109
|
-
sourceToPermalink:
|
|
53
|
+
sourceToPermalink: {[aliasedPath: string]: string};
|
|
110
54
|
onBrokenMarkdownLink: (brokenMarkdownLink: BlogBrokenMarkdownLink) => void;
|
|
111
55
|
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
import { Joi } from '@docusaurus/utils-validation';
|
|
8
|
-
import type { PluginOptions } from '@docusaurus/plugin-content-blog';
|
|
9
|
-
export declare const DEFAULT_OPTIONS: PluginOptions;
|
|
10
|
-
export declare const PluginOptionSchema: Joi.ObjectSchema<PluginOptions>;
|