@docusaurus/plugin-content-blog 0.0.0-5846 → 0.0.0-5847
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/blogUtils.js +0 -17
- package/package.json +9 -9
- package/src/blogUtils.ts +0 -25
- package/src/plugin-content-blog.d.ts +0 -5
package/lib/blogUtils.js
CHANGED
|
@@ -96,21 +96,6 @@ function parseBlogFileName(blogSourceRelative) {
|
|
|
96
96
|
return { date: undefined, text, slug };
|
|
97
97
|
}
|
|
98
98
|
exports.parseBlogFileName = parseBlogFileName;
|
|
99
|
-
function formatBlogPostDate(locale, date, calendar) {
|
|
100
|
-
try {
|
|
101
|
-
return new Intl.DateTimeFormat(locale, {
|
|
102
|
-
day: 'numeric',
|
|
103
|
-
month: 'long',
|
|
104
|
-
year: 'numeric',
|
|
105
|
-
timeZone: 'UTC',
|
|
106
|
-
calendar,
|
|
107
|
-
}).format(date);
|
|
108
|
-
}
|
|
109
|
-
catch (err) {
|
|
110
|
-
logger_1.default.error `Can't format blog post date "${String(date)}"`;
|
|
111
|
-
throw err;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
99
|
async function parseBlogPostMarkdownFile({ filePath, parseFrontMatter, }) {
|
|
115
100
|
const fileContent = await fs_extra_1.default.readFile(filePath, 'utf-8');
|
|
116
101
|
try {
|
|
@@ -177,7 +162,6 @@ async function processBlogSourceFile(blogSourceRelative, contentPaths, context,
|
|
|
177
162
|
}
|
|
178
163
|
}
|
|
179
164
|
const date = await getDate();
|
|
180
|
-
const formattedDate = formatBlogPostDate(i18n.currentLocale, date, i18n.localeConfigs[i18n.currentLocale].calendar);
|
|
181
165
|
const title = frontMatter.title ?? contentTitle ?? parsedBlogFileName.text;
|
|
182
166
|
const description = frontMatter.description ?? excerpt ?? '';
|
|
183
167
|
const slug = frontMatter.slug ?? parsedBlogFileName.slug;
|
|
@@ -220,7 +204,6 @@ async function processBlogSourceFile(blogSourceRelative, contentPaths, context,
|
|
|
220
204
|
title,
|
|
221
205
|
description,
|
|
222
206
|
date,
|
|
223
|
-
formattedDate,
|
|
224
207
|
tags: (0, utils_1.normalizeFrontMatterTags)(tagsBasePath, frontMatter.tags),
|
|
225
208
|
readingTime: showReadingTime
|
|
226
209
|
? options.readingTime({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/plugin-content-blog",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-5847",
|
|
4
4
|
"description": "Blog plugin for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/plugin-content-blog.d.ts",
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
},
|
|
32
32
|
"license": "MIT",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@docusaurus/core": "0.0.0-
|
|
35
|
-
"@docusaurus/logger": "0.0.0-
|
|
36
|
-
"@docusaurus/mdx-loader": "0.0.0-
|
|
37
|
-
"@docusaurus/types": "0.0.0-
|
|
38
|
-
"@docusaurus/utils": "0.0.0-
|
|
39
|
-
"@docusaurus/utils-common": "0.0.0-
|
|
40
|
-
"@docusaurus/utils-validation": "0.0.0-
|
|
34
|
+
"@docusaurus/core": "0.0.0-5847",
|
|
35
|
+
"@docusaurus/logger": "0.0.0-5847",
|
|
36
|
+
"@docusaurus/mdx-loader": "0.0.0-5847",
|
|
37
|
+
"@docusaurus/types": "0.0.0-5847",
|
|
38
|
+
"@docusaurus/utils": "0.0.0-5847",
|
|
39
|
+
"@docusaurus/utils-common": "0.0.0-5847",
|
|
40
|
+
"@docusaurus/utils-validation": "0.0.0-5847",
|
|
41
41
|
"cheerio": "^1.0.0-rc.12",
|
|
42
42
|
"feed": "^4.2.2",
|
|
43
43
|
"fs-extra": "^11.1.1",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"engines": {
|
|
57
57
|
"node": ">=18.0"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "a819e55b3b147c8ca2c1483813cc9c0ce2b75500"
|
|
60
60
|
}
|
package/src/blogUtils.ts
CHANGED
|
@@ -164,25 +164,6 @@ export function parseBlogFileName(
|
|
|
164
164
|
return {date: undefined, text, slug};
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
function formatBlogPostDate(
|
|
168
|
-
locale: string,
|
|
169
|
-
date: Date,
|
|
170
|
-
calendar: string,
|
|
171
|
-
): string {
|
|
172
|
-
try {
|
|
173
|
-
return new Intl.DateTimeFormat(locale, {
|
|
174
|
-
day: 'numeric',
|
|
175
|
-
month: 'long',
|
|
176
|
-
year: 'numeric',
|
|
177
|
-
timeZone: 'UTC',
|
|
178
|
-
calendar,
|
|
179
|
-
}).format(date);
|
|
180
|
-
} catch (err) {
|
|
181
|
-
logger.error`Can't format blog post date "${String(date)}"`;
|
|
182
|
-
throw err;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
167
|
async function parseBlogPostMarkdownFile({
|
|
187
168
|
filePath,
|
|
188
169
|
parseFrontMatter,
|
|
@@ -289,11 +270,6 @@ async function processBlogSourceFile(
|
|
|
289
270
|
}
|
|
290
271
|
|
|
291
272
|
const date = await getDate();
|
|
292
|
-
const formattedDate = formatBlogPostDate(
|
|
293
|
-
i18n.currentLocale,
|
|
294
|
-
date,
|
|
295
|
-
i18n.localeConfigs[i18n.currentLocale]!.calendar,
|
|
296
|
-
);
|
|
297
273
|
|
|
298
274
|
const title = frontMatter.title ?? contentTitle ?? parsedBlogFileName.text;
|
|
299
275
|
const description = frontMatter.description ?? excerpt ?? '';
|
|
@@ -348,7 +324,6 @@ async function processBlogSourceFile(
|
|
|
348
324
|
title,
|
|
349
325
|
description,
|
|
350
326
|
date,
|
|
351
|
-
formattedDate,
|
|
352
327
|
tags: normalizeFrontMatterTags(tagsBasePath, frontMatter.tags),
|
|
353
328
|
readingTime: showReadingTime
|
|
354
329
|
? options.readingTime({
|
|
@@ -192,11 +192,6 @@ yarn workspace v1.22.19image` is a collocated image path, this entry will be the
|
|
|
192
192
|
* into a string.
|
|
193
193
|
*/
|
|
194
194
|
readonly date: Date;
|
|
195
|
-
/**
|
|
196
|
-
* Publish date formatted according to the locale, so that the client can
|
|
197
|
-
* render the date regardless of the existence of `Intl.DateTimeFormat`.
|
|
198
|
-
*/
|
|
199
|
-
readonly formattedDate: string;
|
|
200
195
|
/** Full link including base URL. */
|
|
201
196
|
readonly permalink: string;
|
|
202
197
|
/**
|