@docusaurus/plugin-content-blog 3.0.1 → 3.1.1
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 +1 -0
- package/lib/authors.js +20 -5
- package/lib/blogUtils.js +13 -7
- package/package.json +9 -9
- package/src/authors.ts +40 -8
- package/src/blogUtils.ts +24 -9
- package/.docusaurus/DONT-EDIT-THIS-FOLDER +0 -5
- package/.docusaurus/client-modules.js +0 -5
- package/.docusaurus/codeTranslations.json +0 -1
- package/.docusaurus/docusaurus-plugin-content-blog/default/blog-only-aeb.json +0 -10
- package/.docusaurus/docusaurus-plugin-content-blog/default/blog-only-archive-245.json +0 -312
- package/.docusaurus/docusaurus-plugin-content-blog/default/blog-only-page-2-d48.json +0 -11
- package/.docusaurus/docusaurus-plugin-content-blog/default/blog-only-page-3-8b6.json +0 -10
- package/.docusaurus/docusaurus-plugin-content-blog/default/blog-only-tags-birthday-c96-list.json +0 -9
- package/.docusaurus/docusaurus-plugin-content-blog/default/blog-only-tags-birthday-c96.json +0 -7
- package/.docusaurus/docusaurus-plugin-content-blog/default/blog-only-tags-complex-cf3-list.json +0 -9
- package/.docusaurus/docusaurus-plugin-content-blog/default/blog-only-tags-complex-cf3.json +0 -7
- package/.docusaurus/docusaurus-plugin-content-blog/default/blog-only-tags-date-c24-list.json +0 -9
- package/.docusaurus/docusaurus-plugin-content-blog/default/blog-only-tags-date-c24.json +0 -7
- package/.docusaurus/docusaurus-plugin-content-blog/default/blog-only-tags-tags-344.json +0 -17
- package/.docusaurus/docusaurus-plugin-content-blog/default/blog-post-list-prop-default.json +0 -30
- package/.docusaurus/docusaurus-plugin-content-blog/default/plugin-route-context-module-100.json +0 -4
- package/.docusaurus/docusaurus-plugin-content-blog/default/site-src-tests-fixtures-website-blog-2018-12-14-happy-first-birthday-slash-md-d1e.json +0 -46
- package/.docusaurus/docusaurus-plugin-content-blog/default/site-src-tests-fixtures-website-blog-blog-with-links-mdx-fe5.json +0 -22
- package/.docusaurus/docusaurus-plugin-content-blog/default/site-src-tests-fixtures-website-blog-complex-slug-md-314.json +0 -40
- package/.docusaurus/docusaurus-plugin-content-blog/default/site-src-tests-fixtures-website-blog-date-matter-md-191.json +0 -33
- package/.docusaurus/docusaurus-plugin-content-blog/default/site-src-tests-fixtures-website-blog-heading-as-title-md-10c.json +0 -25
- package/.docusaurus/docusaurus-plugin-content-blog/default/site-src-tests-fixtures-website-blog-mdx-blog-post-mdx-025.json +0 -26
- package/.docusaurus/docusaurus-plugin-content-blog/default/site-src-tests-fixtures-website-blog-mdx-require-blog-post-mdx-4ba.json +0 -26
- package/.docusaurus/docusaurus-plugin-content-blog/default/site-src-tests-fixtures-website-blog-simple-slug-md-324.json +0 -36
- package/.docusaurus/docusaurus-plugin-content-blog/default/site-src-tests-fixtures-website-blog-unlisted-md-5cb.json +0 -18
- package/.docusaurus/docusaurus-theme-search-algolia/default/plugin-route-context-module-100.json +0 -4
- package/.docusaurus/docusaurus.config.mjs +0 -246
- package/.docusaurus/globalData.json +0 -1
- package/.docusaurus/i18n.json +0 -17
- package/.docusaurus/registry.js +0 -38
- package/.docusaurus/routes.js +0 -99
- package/.docusaurus/routesChunkNames.json +0 -194
- package/.docusaurus/site-metadata.json +0 -24
package/lib/authors.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export declare function getAuthorsMap(params: {
|
|
|
17
17
|
type AuthorsParam = {
|
|
18
18
|
frontMatter: BlogPostFrontMatter;
|
|
19
19
|
authorsMap: AuthorsMap | undefined;
|
|
20
|
+
baseUrl: string;
|
|
20
21
|
};
|
|
21
22
|
export declare function getBlogPostAuthors(params: AuthorsParam): Author[];
|
|
22
23
|
export {};
|
package/lib/authors.js
CHANGED
|
@@ -44,13 +44,21 @@ async function getAuthorsMap(params) {
|
|
|
44
44
|
}, validateAuthorsMap);
|
|
45
45
|
}
|
|
46
46
|
exports.getAuthorsMap = getAuthorsMap;
|
|
47
|
+
function normalizeImageUrl({ imageURL, baseUrl, }) {
|
|
48
|
+
return imageURL?.startsWith('/')
|
|
49
|
+
? (0, utils_1.normalizeUrl)([baseUrl, imageURL])
|
|
50
|
+
: imageURL;
|
|
51
|
+
}
|
|
47
52
|
// Legacy v1/early-v2 front matter fields
|
|
48
53
|
// We may want to deprecate those in favor of using only frontMatter.authors
|
|
49
|
-
function getFrontMatterAuthorLegacy(frontMatter) {
|
|
54
|
+
function getFrontMatterAuthorLegacy({ baseUrl, frontMatter, }) {
|
|
50
55
|
const name = frontMatter.author;
|
|
51
56
|
const title = frontMatter.author_title ?? frontMatter.authorTitle;
|
|
52
57
|
const url = frontMatter.author_url ?? frontMatter.authorURL;
|
|
53
|
-
const imageURL =
|
|
58
|
+
const imageURL = normalizeImageUrl({
|
|
59
|
+
imageURL: frontMatter.author_image_url ?? frontMatter.authorImageURL,
|
|
60
|
+
baseUrl,
|
|
61
|
+
});
|
|
54
62
|
if (name || title || url || imageURL) {
|
|
55
63
|
return {
|
|
56
64
|
name,
|
|
@@ -105,18 +113,25 @@ ${Object.keys(authorsMap)
|
|
|
105
113
|
}
|
|
106
114
|
return frontMatterAuthors.map(toAuthor);
|
|
107
115
|
}
|
|
116
|
+
function fixAuthorImageBaseURL(authors, { baseUrl }) {
|
|
117
|
+
return authors.map((author) => ({
|
|
118
|
+
...author,
|
|
119
|
+
imageURL: normalizeImageUrl({ imageURL: author.imageURL, baseUrl }),
|
|
120
|
+
}));
|
|
121
|
+
}
|
|
108
122
|
function getBlogPostAuthors(params) {
|
|
109
|
-
const authorLegacy = getFrontMatterAuthorLegacy(params
|
|
123
|
+
const authorLegacy = getFrontMatterAuthorLegacy(params);
|
|
110
124
|
const authors = getFrontMatterAuthors(params);
|
|
125
|
+
const updatedAuthors = fixAuthorImageBaseURL(authors, params);
|
|
111
126
|
if (authorLegacy) {
|
|
112
127
|
// Technically, we could allow mixing legacy/authors front matter, but do we
|
|
113
128
|
// really want to?
|
|
114
|
-
if (
|
|
129
|
+
if (updatedAuthors.length > 0) {
|
|
115
130
|
throw new Error(`To declare blog post authors, use the 'authors' front matter in priority.
|
|
116
131
|
Don't mix 'authors' with other existing 'author_*' front matter. Choose one or the other, not both at the same time.`);
|
|
117
132
|
}
|
|
118
133
|
return [authorLegacy];
|
|
119
134
|
}
|
|
120
|
-
return
|
|
135
|
+
return updatedAuthors;
|
|
121
136
|
}
|
|
122
137
|
exports.getBlogPostAuthors = getBlogPostAuthors;
|
package/lib/blogUtils.js
CHANGED
|
@@ -111,10 +111,13 @@ function formatBlogPostDate(locale, date, calendar) {
|
|
|
111
111
|
throw err;
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
async function parseBlogPostMarkdownFile(
|
|
115
|
-
const
|
|
114
|
+
async function parseBlogPostMarkdownFile({ filePath, parseFrontMatter, }) {
|
|
115
|
+
const fileContent = await fs_extra_1.default.readFile(filePath, 'utf-8');
|
|
116
116
|
try {
|
|
117
|
-
const result = (0, utils_1.
|
|
117
|
+
const result = await (0, utils_1.parseMarkdownFile)({
|
|
118
|
+
filePath,
|
|
119
|
+
fileContent,
|
|
120
|
+
parseFrontMatter,
|
|
118
121
|
removeContentTitle: true,
|
|
119
122
|
});
|
|
120
123
|
return {
|
|
@@ -123,18 +126,21 @@ async function parseBlogPostMarkdownFile(blogSourceAbsolute) {
|
|
|
123
126
|
};
|
|
124
127
|
}
|
|
125
128
|
catch (err) {
|
|
126
|
-
logger_1.default.error `Error while parsing blog post file path=${
|
|
129
|
+
logger_1.default.error `Error while parsing blog post file path=${filePath}.`;
|
|
127
130
|
throw err;
|
|
128
131
|
}
|
|
129
132
|
}
|
|
130
133
|
const defaultReadingTime = ({ content, options }) => (0, reading_time_1.default)(content, options).minutes;
|
|
131
134
|
async function processBlogSourceFile(blogSourceRelative, contentPaths, context, options, authorsMap) {
|
|
132
|
-
const { siteConfig: { baseUrl }, siteDir, i18n, } = context;
|
|
135
|
+
const { siteConfig: { baseUrl, markdown: { parseFrontMatter }, }, siteDir, i18n, } = context;
|
|
133
136
|
const { routeBasePath, tagsBasePath: tagsRouteBasePath, truncateMarker, showReadingTime, editUrl, } = options;
|
|
134
137
|
// Lookup in localized folder in priority
|
|
135
138
|
const blogDirPath = await (0, utils_1.getFolderContainingFile)((0, utils_1.getContentPathList)(contentPaths), blogSourceRelative);
|
|
136
139
|
const blogSourceAbsolute = path_1.default.join(blogDirPath, blogSourceRelative);
|
|
137
|
-
const { frontMatter, content, contentTitle, excerpt } = await parseBlogPostMarkdownFile(
|
|
140
|
+
const { frontMatter, content, contentTitle, excerpt } = await parseBlogPostMarkdownFile({
|
|
141
|
+
filePath: blogSourceAbsolute,
|
|
142
|
+
parseFrontMatter,
|
|
143
|
+
});
|
|
138
144
|
const aliasedSource = (0, utils_1.aliasedSitePath)(blogSourceAbsolute, siteDir);
|
|
139
145
|
const draft = (0, utils_1.isDraft)({ frontMatter });
|
|
140
146
|
const unlisted = (0, utils_1.isUnlisted)({ frontMatter });
|
|
@@ -204,7 +210,7 @@ async function processBlogSourceFile(blogSourceRelative, contentPaths, context,
|
|
|
204
210
|
routeBasePath,
|
|
205
211
|
tagsRouteBasePath,
|
|
206
212
|
]);
|
|
207
|
-
const authors = (0, authors_1.getBlogPostAuthors)({ authorsMap, frontMatter });
|
|
213
|
+
const authors = (0, authors_1.getBlogPostAuthors)({ authorsMap, frontMatter, baseUrl });
|
|
208
214
|
return {
|
|
209
215
|
id: slug,
|
|
210
216
|
metadata: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/plugin-content-blog",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"description": "Blog plugin for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/plugin-content-blog.d.ts",
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
},
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@docusaurus/core": "3.
|
|
23
|
-
"@docusaurus/logger": "3.
|
|
24
|
-
"@docusaurus/mdx-loader": "3.
|
|
25
|
-
"@docusaurus/types": "3.
|
|
26
|
-
"@docusaurus/utils": "3.
|
|
27
|
-
"@docusaurus/utils-common": "3.
|
|
28
|
-
"@docusaurus/utils-validation": "3.
|
|
22
|
+
"@docusaurus/core": "3.1.1",
|
|
23
|
+
"@docusaurus/logger": "3.1.1",
|
|
24
|
+
"@docusaurus/mdx-loader": "3.1.1",
|
|
25
|
+
"@docusaurus/types": "3.1.1",
|
|
26
|
+
"@docusaurus/utils": "3.1.1",
|
|
27
|
+
"@docusaurus/utils-common": "3.1.1",
|
|
28
|
+
"@docusaurus/utils-validation": "3.1.1",
|
|
29
29
|
"cheerio": "^1.0.0-rc.12",
|
|
30
30
|
"feed": "^4.2.2",
|
|
31
31
|
"fs-extra": "^11.1.1",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"engines": {
|
|
45
45
|
"node": ">=18.0"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "8017f6a6776ba1bd7065e630a52fe2c2654e2f1b"
|
|
48
48
|
}
|
package/src/authors.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {getDataFileData} from '@docusaurus/utils';
|
|
8
|
+
import {getDataFileData, normalizeUrl} from '@docusaurus/utils';
|
|
9
9
|
import {Joi, URISchema} from '@docusaurus/utils-validation';
|
|
10
10
|
import type {BlogContentPaths} from './types';
|
|
11
11
|
import type {
|
|
@@ -68,17 +68,37 @@ export async function getAuthorsMap(params: {
|
|
|
68
68
|
type AuthorsParam = {
|
|
69
69
|
frontMatter: BlogPostFrontMatter;
|
|
70
70
|
authorsMap: AuthorsMap | undefined;
|
|
71
|
+
baseUrl: string;
|
|
71
72
|
};
|
|
72
73
|
|
|
74
|
+
function normalizeImageUrl({
|
|
75
|
+
imageURL,
|
|
76
|
+
baseUrl,
|
|
77
|
+
}: {
|
|
78
|
+
imageURL: string | undefined;
|
|
79
|
+
baseUrl: string;
|
|
80
|
+
}) {
|
|
81
|
+
return imageURL?.startsWith('/')
|
|
82
|
+
? normalizeUrl([baseUrl, imageURL])
|
|
83
|
+
: imageURL;
|
|
84
|
+
}
|
|
85
|
+
|
|
73
86
|
// Legacy v1/early-v2 front matter fields
|
|
74
87
|
// We may want to deprecate those in favor of using only frontMatter.authors
|
|
75
|
-
function getFrontMatterAuthorLegacy(
|
|
76
|
-
|
|
77
|
-
|
|
88
|
+
function getFrontMatterAuthorLegacy({
|
|
89
|
+
baseUrl,
|
|
90
|
+
frontMatter,
|
|
91
|
+
}: {
|
|
92
|
+
baseUrl: string;
|
|
93
|
+
frontMatter: BlogPostFrontMatter;
|
|
94
|
+
}): Author | undefined {
|
|
78
95
|
const name = frontMatter.author;
|
|
79
96
|
const title = frontMatter.author_title ?? frontMatter.authorTitle;
|
|
80
97
|
const url = frontMatter.author_url ?? frontMatter.authorURL;
|
|
81
|
-
const imageURL =
|
|
98
|
+
const imageURL = normalizeImageUrl({
|
|
99
|
+
imageURL: frontMatter.author_image_url ?? frontMatter.authorImageURL,
|
|
100
|
+
baseUrl,
|
|
101
|
+
});
|
|
82
102
|
|
|
83
103
|
if (name || title || url || imageURL) {
|
|
84
104
|
return {
|
|
@@ -148,14 +168,26 @@ ${Object.keys(authorsMap)
|
|
|
148
168
|
return frontMatterAuthors.map(toAuthor);
|
|
149
169
|
}
|
|
150
170
|
|
|
171
|
+
function fixAuthorImageBaseURL(
|
|
172
|
+
authors: Author[],
|
|
173
|
+
{baseUrl}: {baseUrl: string},
|
|
174
|
+
) {
|
|
175
|
+
return authors.map((author) => ({
|
|
176
|
+
...author,
|
|
177
|
+
imageURL: normalizeImageUrl({imageURL: author.imageURL, baseUrl}),
|
|
178
|
+
}));
|
|
179
|
+
}
|
|
180
|
+
|
|
151
181
|
export function getBlogPostAuthors(params: AuthorsParam): Author[] {
|
|
152
|
-
const authorLegacy = getFrontMatterAuthorLegacy(params
|
|
182
|
+
const authorLegacy = getFrontMatterAuthorLegacy(params);
|
|
153
183
|
const authors = getFrontMatterAuthors(params);
|
|
154
184
|
|
|
185
|
+
const updatedAuthors = fixAuthorImageBaseURL(authors, params);
|
|
186
|
+
|
|
155
187
|
if (authorLegacy) {
|
|
156
188
|
// Technically, we could allow mixing legacy/authors front matter, but do we
|
|
157
189
|
// really want to?
|
|
158
|
-
if (
|
|
190
|
+
if (updatedAuthors.length > 0) {
|
|
159
191
|
throw new Error(
|
|
160
192
|
`To declare blog post authors, use the 'authors' front matter in priority.
|
|
161
193
|
Don't mix 'authors' with other existing 'author_*' front matter. Choose one or the other, not both at the same time.`,
|
|
@@ -164,5 +196,5 @@ Don't mix 'authors' with other existing 'author_*' front matter. Choose one or t
|
|
|
164
196
|
return [authorLegacy];
|
|
165
197
|
}
|
|
166
198
|
|
|
167
|
-
return
|
|
199
|
+
return updatedAuthors;
|
|
168
200
|
}
|
package/src/blogUtils.ts
CHANGED
|
@@ -11,7 +11,7 @@ import _ from 'lodash';
|
|
|
11
11
|
import logger from '@docusaurus/logger';
|
|
12
12
|
import readingTime from 'reading-time';
|
|
13
13
|
import {
|
|
14
|
-
|
|
14
|
+
parseMarkdownFile,
|
|
15
15
|
normalizeUrl,
|
|
16
16
|
aliasedSitePath,
|
|
17
17
|
getEditUrl,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
} from '@docusaurus/utils';
|
|
30
30
|
import {validateBlogPostFrontMatter} from './frontMatter';
|
|
31
31
|
import {type AuthorsMap, getAuthorsMap, getBlogPostAuthors} from './authors';
|
|
32
|
-
import type {LoadContext} from '@docusaurus/types';
|
|
32
|
+
import type {LoadContext, ParseFrontMatter} from '@docusaurus/types';
|
|
33
33
|
import type {
|
|
34
34
|
PluginOptions,
|
|
35
35
|
ReadingTimeFunction,
|
|
@@ -180,10 +180,19 @@ function formatBlogPostDate(
|
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
-
async function parseBlogPostMarkdownFile(
|
|
184
|
-
|
|
183
|
+
async function parseBlogPostMarkdownFile({
|
|
184
|
+
filePath,
|
|
185
|
+
parseFrontMatter,
|
|
186
|
+
}: {
|
|
187
|
+
filePath: string;
|
|
188
|
+
parseFrontMatter: ParseFrontMatter;
|
|
189
|
+
}) {
|
|
190
|
+
const fileContent = await fs.readFile(filePath, 'utf-8');
|
|
185
191
|
try {
|
|
186
|
-
const result =
|
|
192
|
+
const result = await parseMarkdownFile({
|
|
193
|
+
filePath,
|
|
194
|
+
fileContent,
|
|
195
|
+
parseFrontMatter,
|
|
187
196
|
removeContentTitle: true,
|
|
188
197
|
});
|
|
189
198
|
return {
|
|
@@ -191,7 +200,7 @@ async function parseBlogPostMarkdownFile(blogSourceAbsolute: string) {
|
|
|
191
200
|
frontMatter: validateBlogPostFrontMatter(result.frontMatter),
|
|
192
201
|
};
|
|
193
202
|
} catch (err) {
|
|
194
|
-
logger.error`Error while parsing blog post file path=${
|
|
203
|
+
logger.error`Error while parsing blog post file path=${filePath}.`;
|
|
195
204
|
throw err;
|
|
196
205
|
}
|
|
197
206
|
}
|
|
@@ -207,7 +216,10 @@ async function processBlogSourceFile(
|
|
|
207
216
|
authorsMap?: AuthorsMap,
|
|
208
217
|
): Promise<BlogPost | undefined> {
|
|
209
218
|
const {
|
|
210
|
-
siteConfig: {
|
|
219
|
+
siteConfig: {
|
|
220
|
+
baseUrl,
|
|
221
|
+
markdown: {parseFrontMatter},
|
|
222
|
+
},
|
|
211
223
|
siteDir,
|
|
212
224
|
i18n,
|
|
213
225
|
} = context;
|
|
@@ -228,7 +240,10 @@ async function processBlogSourceFile(
|
|
|
228
240
|
const blogSourceAbsolute = path.join(blogDirPath, blogSourceRelative);
|
|
229
241
|
|
|
230
242
|
const {frontMatter, content, contentTitle, excerpt} =
|
|
231
|
-
await parseBlogPostMarkdownFile(
|
|
243
|
+
await parseBlogPostMarkdownFile({
|
|
244
|
+
filePath: blogSourceAbsolute,
|
|
245
|
+
parseFrontMatter,
|
|
246
|
+
});
|
|
232
247
|
|
|
233
248
|
const aliasedSource = aliasedSitePath(blogSourceAbsolute, siteDir);
|
|
234
249
|
|
|
@@ -319,7 +334,7 @@ async function processBlogSourceFile(
|
|
|
319
334
|
routeBasePath,
|
|
320
335
|
tagsRouteBasePath,
|
|
321
336
|
]);
|
|
322
|
-
const authors = getBlogPostAuthors({authorsMap, frontMatter});
|
|
337
|
+
const authors = getBlogPostAuthors({authorsMap, frontMatter, baseUrl});
|
|
323
338
|
|
|
324
339
|
return {
|
|
325
340
|
id: slug,
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export default [
|
|
2
|
-
require("/Users/sebastienlorber/Desktop/projects/docusaurus/node_modules/infima/dist/css/default/default.css"),
|
|
3
|
-
require("/Users/sebastienlorber/Desktop/projects/docusaurus/packages/docusaurus-theme-classic/lib/prism-include-languages"),
|
|
4
|
-
require("/Users/sebastienlorber/Desktop/projects/docusaurus/packages/docusaurus-theme-classic/lib/nprogress"),
|
|
5
|
-
];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|
|
@@ -1,312 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"blogPosts": [
|
|
3
|
-
{
|
|
4
|
-
"id": "/blog-with-links",
|
|
5
|
-
"metadata": {
|
|
6
|
-
"permalink": "/blog-only/blog-with-links",
|
|
7
|
-
"editUrl": "https://github.com/facebook/docusaurus/edit/main/website/src/__tests__/__fixtures__/website/blog/blog-with-links.mdx",
|
|
8
|
-
"source": "@site/src/__tests__/__fixtures__/website/blog/blog-with-links.mdx",
|
|
9
|
-
"title": "test links",
|
|
10
|
-
"description": "absolute full url",
|
|
11
|
-
"date": "2023-07-23T00:00:00.000Z",
|
|
12
|
-
"formattedDate": "July 23, 2023",
|
|
13
|
-
"tags": [],
|
|
14
|
-
"readingTime": 0.145,
|
|
15
|
-
"hasTruncateMarker": false,
|
|
16
|
-
"authors": [],
|
|
17
|
-
"frontMatter": {
|
|
18
|
-
"title": "test links",
|
|
19
|
-
"date": "2023-07-23T00:00:00.000Z"
|
|
20
|
-
},
|
|
21
|
-
"unlisted": false,
|
|
22
|
-
"nextItem": {
|
|
23
|
-
"title": "MDX Blog Sample with require calls",
|
|
24
|
-
"permalink": "/blog-only/mdx-require-blog-post"
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
"content": "import useBaseUrl from '@docusaurus/useBaseUrl';\n\n[absolute full url](https://github.com/facebook/docusaurus)\n\n[absolute url with implicit domain name](/blog/2017/12/14/introducing-docusaurus)\n\n[relative url](2017-12-14-introducing-docusaurus.mdx)\n\n[anchor](#title)\n\n\n\n\n\n<img\n srcSet={`${useBaseUrl(\n '/img/docusaurus-social-card.png 300w',\n )}, ${useBaseUrl('/img/docusaurus-social-card.png 500w')}`}\n/>\n\n<img src={useBaseUrl('/img/docusaurus-social-card.png')} />"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"id": "/mdx-require-blog-post",
|
|
31
|
-
"metadata": {
|
|
32
|
-
"permalink": "/blog-only/mdx-require-blog-post",
|
|
33
|
-
"editUrl": "https://github.com/facebook/docusaurus/edit/main/website/src/__tests__/__fixtures__/website/blog/mdx-require-blog-post.mdx",
|
|
34
|
-
"source": "@site/src/__tests__/__fixtures__/website/blog/mdx-require-blog-post.mdx",
|
|
35
|
-
"title": "MDX Blog Sample with require calls",
|
|
36
|
-
"description": "Test MDX with require calls",
|
|
37
|
-
"date": "2021-03-06T00:00:00.000Z",
|
|
38
|
-
"formattedDate": "March 6, 2021",
|
|
39
|
-
"tags": [],
|
|
40
|
-
"readingTime": 0.09,
|
|
41
|
-
"hasTruncateMarker": false,
|
|
42
|
-
"authors": [],
|
|
43
|
-
"frontMatter": {
|
|
44
|
-
"title": "MDX Blog Sample with require calls",
|
|
45
|
-
"date": "2021-03-06T00:00:00.000Z"
|
|
46
|
-
},
|
|
47
|
-
"unlisted": false,
|
|
48
|
-
"prevItem": {
|
|
49
|
-
"title": "test links",
|
|
50
|
-
"permalink": "/blog-only/blog-with-links"
|
|
51
|
-
},
|
|
52
|
-
"nextItem": {
|
|
53
|
-
"title": "Full Blog Sample",
|
|
54
|
-
"permalink": "/blog-only/mdx-blog-post"
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
"content": "Test MDX with require calls\n\nimport useBaseUrl from '@docusaurus/useBaseUrl';\n\n<img src={useBaseUrl('/img/docusaurus-social-card.png')} />\n\n<img src={require('../static/img/docusaurus-social-card.png').default} />\n\n<img src={require('@site/static/img/docusaurus-social-card.png').default} />"
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
"id": "/mdx-blog-post",
|
|
61
|
-
"metadata": {
|
|
62
|
-
"permalink": "/blog-only/mdx-blog-post",
|
|
63
|
-
"editUrl": "https://github.com/facebook/docusaurus/edit/main/website/src/__tests__/__fixtures__/website/blog/mdx-blog-post.mdx",
|
|
64
|
-
"source": "@site/src/__tests__/__fixtures__/website/blog/mdx-blog-post.mdx",
|
|
65
|
-
"title": "Full Blog Sample",
|
|
66
|
-
"description": "HTML Heading 1",
|
|
67
|
-
"date": "2021-03-05T00:00:00.000Z",
|
|
68
|
-
"formattedDate": "March 5, 2021",
|
|
69
|
-
"tags": [],
|
|
70
|
-
"readingTime": 0.245,
|
|
71
|
-
"hasTruncateMarker": false,
|
|
72
|
-
"authors": [],
|
|
73
|
-
"frontMatter": {
|
|
74
|
-
"title": "Full Blog Sample",
|
|
75
|
-
"date": "2021-03-05T00:00:00.000Z"
|
|
76
|
-
},
|
|
77
|
-
"unlisted": false,
|
|
78
|
-
"prevItem": {
|
|
79
|
-
"title": "MDX Blog Sample with require calls",
|
|
80
|
-
"permalink": "/blog-only/mdx-require-blog-post"
|
|
81
|
-
},
|
|
82
|
-
"nextItem": {
|
|
83
|
-
"title": "Complex Slug",
|
|
84
|
-
"permalink": "/blog-only/hey/my super path/héllô"
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
"content": "<h1>HTML Heading 1</h1>\n<h2>HTML Heading 2</h2>\n<p>HTML Paragraph</p>\n\nimport Typography from '@site/../component/Typography';\n\n<Typography>Import DOM</Typography>\n\n# Heading 1\n\n## Heading 2\n\n### Heading 3\n\n#### Heading 4\n\n##### Heading 5\n\n- list1\n- list2\n- list3\n\n* list1\n* list2\n* list3\n\nNormal Text _Italics Text_ **Bold Text**\n\n[link](https://v2.docusaurus.io/) "
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
"id": "/hey/my super path/héllô",
|
|
91
|
-
"metadata": {
|
|
92
|
-
"permalink": "/blog-only/hey/my super path/héllô",
|
|
93
|
-
"editUrl": "https://github.com/facebook/docusaurus/edit/main/website/src/__tests__/__fixtures__/website/blog/complex-slug.md",
|
|
94
|
-
"source": "@site/src/__tests__/__fixtures__/website/blog/complex-slug.md",
|
|
95
|
-
"title": "Complex Slug",
|
|
96
|
-
"description": "complex url slug",
|
|
97
|
-
"date": "2020-08-16T00:00:00.000Z",
|
|
98
|
-
"formattedDate": "August 16, 2020",
|
|
99
|
-
"tags": [
|
|
100
|
-
{
|
|
101
|
-
"label": "date",
|
|
102
|
-
"permalink": "/blog-only/tags/date"
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
"label": "complex",
|
|
106
|
-
"permalink": "/blog-only/tags/complex"
|
|
107
|
-
}
|
|
108
|
-
],
|
|
109
|
-
"readingTime": 0.015,
|
|
110
|
-
"hasTruncateMarker": false,
|
|
111
|
-
"authors": [],
|
|
112
|
-
"frontMatter": {
|
|
113
|
-
"slug": "/hey/my super path/héllô",
|
|
114
|
-
"title": "Complex Slug",
|
|
115
|
-
"date": "2020/08/16",
|
|
116
|
-
"tags": [
|
|
117
|
-
"date",
|
|
118
|
-
"complex"
|
|
119
|
-
]
|
|
120
|
-
},
|
|
121
|
-
"unlisted": false,
|
|
122
|
-
"prevItem": {
|
|
123
|
-
"title": "Full Blog Sample",
|
|
124
|
-
"permalink": "/blog-only/mdx-blog-post"
|
|
125
|
-
},
|
|
126
|
-
"nextItem": {
|
|
127
|
-
"title": "Simple Slug",
|
|
128
|
-
"permalink": "/blog-only/simple/slug"
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
"content": "complex url slug"
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
"id": "/simple/slug",
|
|
135
|
-
"metadata": {
|
|
136
|
-
"permalink": "/blog-only/simple/slug",
|
|
137
|
-
"editUrl": "https://github.com/facebook/docusaurus/edit/main/website/src/__tests__/__fixtures__/website/blog/simple-slug.md",
|
|
138
|
-
"source": "@site/src/__tests__/__fixtures__/website/blog/simple-slug.md",
|
|
139
|
-
"title": "Simple Slug",
|
|
140
|
-
"description": "simple url slug",
|
|
141
|
-
"date": "2020-08-15T00:00:00.000Z",
|
|
142
|
-
"formattedDate": "August 15, 2020",
|
|
143
|
-
"tags": [],
|
|
144
|
-
"readingTime": 0.015,
|
|
145
|
-
"hasTruncateMarker": false,
|
|
146
|
-
"authors": [
|
|
147
|
-
{
|
|
148
|
-
"name": "Sébastien Lorber",
|
|
149
|
-
"title": "Docusaurus maintainer",
|
|
150
|
-
"url": "https://sebastienlorber.com"
|
|
151
|
-
}
|
|
152
|
-
],
|
|
153
|
-
"frontMatter": {
|
|
154
|
-
"slug": "/simple/slug",
|
|
155
|
-
"title": "Simple Slug",
|
|
156
|
-
"date": "2020-08-15T00:00:00.000Z",
|
|
157
|
-
"author": "Sébastien Lorber",
|
|
158
|
-
"author_title": "Docusaurus maintainer",
|
|
159
|
-
"author_url": "https://sebastienlorber.com"
|
|
160
|
-
},
|
|
161
|
-
"unlisted": false,
|
|
162
|
-
"prevItem": {
|
|
163
|
-
"title": "Complex Slug",
|
|
164
|
-
"permalink": "/blog-only/hey/my super path/héllô"
|
|
165
|
-
},
|
|
166
|
-
"nextItem": {
|
|
167
|
-
"title": "some heading",
|
|
168
|
-
"permalink": "/blog-only/heading-as-title"
|
|
169
|
-
}
|
|
170
|
-
},
|
|
171
|
-
"content": "simple url slug"
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
"id": "/unlisted",
|
|
175
|
-
"metadata": {
|
|
176
|
-
"permalink": "/blog-only/unlisted",
|
|
177
|
-
"editUrl": "https://github.com/facebook/docusaurus/edit/main/website/src/__tests__/__fixtures__/website/blog/unlisted.md",
|
|
178
|
-
"source": "@site/src/__tests__/__fixtures__/website/blog/unlisted.md",
|
|
179
|
-
"title": "unlisted",
|
|
180
|
-
"description": "this post is unlisted",
|
|
181
|
-
"date": "2020-02-27T00:00:00.000Z",
|
|
182
|
-
"formattedDate": "February 27, 2020",
|
|
183
|
-
"tags": [],
|
|
184
|
-
"readingTime": 0.02,
|
|
185
|
-
"hasTruncateMarker": false,
|
|
186
|
-
"authors": [],
|
|
187
|
-
"frontMatter": {
|
|
188
|
-
"date": "2020-02-27T00:00:00.000Z",
|
|
189
|
-
"unlisted": true
|
|
190
|
-
},
|
|
191
|
-
"unlisted": true
|
|
192
|
-
},
|
|
193
|
-
"content": "this post is unlisted"
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
"id": "/heading-as-title",
|
|
197
|
-
"metadata": {
|
|
198
|
-
"permalink": "/blog-only/heading-as-title",
|
|
199
|
-
"editUrl": "https://github.com/facebook/docusaurus/edit/main/website/src/__tests__/__fixtures__/website/blog/heading-as-title.md",
|
|
200
|
-
"source": "@site/src/__tests__/__fixtures__/website/blog/heading-as-title.md",
|
|
201
|
-
"title": "some heading",
|
|
202
|
-
"description": "",
|
|
203
|
-
"date": "2019-01-02T00:00:00.000Z",
|
|
204
|
-
"formattedDate": "January 2, 2019",
|
|
205
|
-
"tags": [],
|
|
206
|
-
"readingTime": 0,
|
|
207
|
-
"hasTruncateMarker": false,
|
|
208
|
-
"authors": [],
|
|
209
|
-
"frontMatter": {
|
|
210
|
-
"date": "2019-01-02T00:00:00.000Z"
|
|
211
|
-
},
|
|
212
|
-
"unlisted": false,
|
|
213
|
-
"prevItem": {
|
|
214
|
-
"title": "Simple Slug",
|
|
215
|
-
"permalink": "/blog-only/simple/slug"
|
|
216
|
-
},
|
|
217
|
-
"nextItem": {
|
|
218
|
-
"title": "date-matter",
|
|
219
|
-
"permalink": "/blog-only/date-matter"
|
|
220
|
-
}
|
|
221
|
-
},
|
|
222
|
-
"content": ""
|
|
223
|
-
},
|
|
224
|
-
{
|
|
225
|
-
"id": "/date-matter",
|
|
226
|
-
"metadata": {
|
|
227
|
-
"permalink": "/blog-only/date-matter",
|
|
228
|
-
"editUrl": "https://github.com/facebook/docusaurus/edit/main/website/src/__tests__/__fixtures__/website/blog/date-matter.md",
|
|
229
|
-
"source": "@site/src/__tests__/__fixtures__/website/blog/date-matter.md",
|
|
230
|
-
"title": "date-matter",
|
|
231
|
-
"description": "date inside front matter",
|
|
232
|
-
"date": "2019-01-01T00:00:00.000Z",
|
|
233
|
-
"formattedDate": "January 1, 2019",
|
|
234
|
-
"tags": [
|
|
235
|
-
{
|
|
236
|
-
"label": "date",
|
|
237
|
-
"permalink": "/blog-only/tags/date"
|
|
238
|
-
}
|
|
239
|
-
],
|
|
240
|
-
"readingTime": 0.02,
|
|
241
|
-
"hasTruncateMarker": false,
|
|
242
|
-
"authors": [],
|
|
243
|
-
"frontMatter": {
|
|
244
|
-
"date": "2019-01-01T00:00:00.000Z",
|
|
245
|
-
"tags": [
|
|
246
|
-
"date"
|
|
247
|
-
]
|
|
248
|
-
},
|
|
249
|
-
"unlisted": false,
|
|
250
|
-
"prevItem": {
|
|
251
|
-
"title": "some heading",
|
|
252
|
-
"permalink": "/blog-only/heading-as-title"
|
|
253
|
-
},
|
|
254
|
-
"nextItem": {
|
|
255
|
-
"title": "Happy 1st Birthday Slash!",
|
|
256
|
-
"permalink": "/blog-only/2018/12/14/Happy-First-Birthday-Slash"
|
|
257
|
-
}
|
|
258
|
-
},
|
|
259
|
-
"content": "date inside front matter"
|
|
260
|
-
},
|
|
261
|
-
{
|
|
262
|
-
"id": "/2018/12/14/Happy-First-Birthday-Slash",
|
|
263
|
-
"metadata": {
|
|
264
|
-
"permalink": "/blog-only/2018/12/14/Happy-First-Birthday-Slash",
|
|
265
|
-
"editUrl": "https://github.com/facebook/docusaurus/edit/main/website/src/__tests__/__fixtures__/website/blog/2018-12-14-Happy-First-Birthday-Slash.md",
|
|
266
|
-
"source": "@site/src/__tests__/__fixtures__/website/blog/2018-12-14-Happy-First-Birthday-Slash.md",
|
|
267
|
-
"title": "Happy 1st Birthday Slash!",
|
|
268
|
-
"description": "Happy birthday!",
|
|
269
|
-
"date": "2018-12-14T00:00:00.000Z",
|
|
270
|
-
"formattedDate": "December 14, 2018",
|
|
271
|
-
"tags": [
|
|
272
|
-
{
|
|
273
|
-
"label": "birthday",
|
|
274
|
-
"permalink": "/blog-only/tags/birthday"
|
|
275
|
-
}
|
|
276
|
-
],
|
|
277
|
-
"readingTime": 0.01,
|
|
278
|
-
"hasTruncateMarker": false,
|
|
279
|
-
"authors": [
|
|
280
|
-
{
|
|
281
|
-
"name": "Yangshun Tay"
|
|
282
|
-
},
|
|
283
|
-
{
|
|
284
|
-
"name": "Sébastien Lorber",
|
|
285
|
-
"title": "Docusaurus maintainer",
|
|
286
|
-
"email": "lorber.sebastien@gmail.com",
|
|
287
|
-
"url": "https://sebastienlorber.com",
|
|
288
|
-
"key": "slorber"
|
|
289
|
-
}
|
|
290
|
-
],
|
|
291
|
-
"frontMatter": {
|
|
292
|
-
"title": "Happy 1st Birthday Slash!",
|
|
293
|
-
"authors": [
|
|
294
|
-
{
|
|
295
|
-
"name": "Yangshun Tay"
|
|
296
|
-
},
|
|
297
|
-
"slorber"
|
|
298
|
-
],
|
|
299
|
-
"tags": [
|
|
300
|
-
"birthday"
|
|
301
|
-
]
|
|
302
|
-
},
|
|
303
|
-
"unlisted": false,
|
|
304
|
-
"prevItem": {
|
|
305
|
-
"title": "date-matter",
|
|
306
|
-
"permalink": "/blog-only/date-matter"
|
|
307
|
-
}
|
|
308
|
-
},
|
|
309
|
-
"content": "Happy birthday!"
|
|
310
|
-
}
|
|
311
|
-
]
|
|
312
|
-
}
|