@docusaurus/plugin-content-blog 2.0.0-beta.12faed89d → 2.0.0-beta.13
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/.tsbuildinfo +1 -1
- package/lib/authors.d.ts +23 -0
- package/lib/authors.js +147 -0
- package/lib/blogFrontMatter.d.ts +19 -6
- package/lib/blogFrontMatter.js +31 -19
- package/lib/blogUtils.d.ts +10 -4
- package/lib/blogUtils.js +141 -136
- package/lib/feed.d.ts +20 -0
- package/lib/feed.js +90 -0
- package/lib/index.js +99 -106
- package/lib/markdownLoader.d.ts +3 -6
- package/lib/markdownLoader.js +5 -5
- package/lib/pluginOptionSchema.d.ts +3 -26
- package/lib/pluginOptionSchema.js +28 -7
- package/lib/translations.d.ts +10 -0
- package/lib/translations.js +53 -0
- package/lib/types.d.ts +54 -14
- package/package.json +17 -13
- package/src/__tests__/__fixtures__/authorsMapFiles/authors.json +29 -0
- package/src/__tests__/__fixtures__/authorsMapFiles/authors.yml +27 -0
- package/src/__tests__/__fixtures__/authorsMapFiles/authorsBad1.json +5 -0
- package/src/__tests__/__fixtures__/authorsMapFiles/authorsBad1.yml +3 -0
- package/src/__tests__/__fixtures__/authorsMapFiles/authorsBad2.json +3 -0
- package/src/__tests__/__fixtures__/authorsMapFiles/authorsBad2.yml +2 -0
- package/src/__tests__/__fixtures__/authorsMapFiles/authorsBad3.json +8 -0
- package/src/__tests__/__fixtures__/authorsMapFiles/authorsBad3.yml +3 -0
- package/src/__tests__/__fixtures__/component/Typography.tsx +6 -0
- package/src/__tests__/__fixtures__/getAuthorsMapFilePath/contentPathEmpty/empty +0 -0
- package/src/__tests__/__fixtures__/getAuthorsMapFilePath/contentPathJson1/authors.json +0 -0
- package/src/__tests__/__fixtures__/getAuthorsMapFilePath/contentPathJson2/authors.json +0 -0
- package/src/__tests__/__fixtures__/getAuthorsMapFilePath/contentPathNestedYml/sub/folder/authors.yml +0 -0
- package/src/__tests__/__fixtures__/getAuthorsMapFilePath/contentPathYml1/authors.yml +0 -0
- package/src/__tests__/__fixtures__/getAuthorsMapFilePath/contentPathYml2/authors.yml +0 -0
- package/src/__tests__/__fixtures__/website/blog/2018-12-14-Happy-First-Birthday-Slash.md +3 -0
- package/src/__tests__/__fixtures__/website/blog/_partials/somePartial.md +3 -0
- package/src/__tests__/__fixtures__/website/blog/_partials/subfolder/somePartial.md +3 -0
- package/src/__tests__/__fixtures__/website/blog/_somePartial.md +3 -0
- package/src/__tests__/__fixtures__/website/blog/authors.yml +4 -0
- package/src/__tests__/__fixtures__/website/blog/mdx-blog-post.mdx +36 -0
- package/src/__tests__/__fixtures__/website/blog/mdx-require-blog-post.mdx +14 -0
- package/src/__tests__/__fixtures__/website/blog/simple-slug.md +4 -0
- package/src/__tests__/__fixtures__/website/i18n/en/docusaurus-plugin-content-blog/2018-12-14-Happy-First-Birthday-Slash.md +3 -0
- package/src/__tests__/__fixtures__/website/i18n/en/docusaurus-plugin-content-blog/authors.yml +5 -0
- package/src/__tests__/__fixtures__/website/static/img/docusaurus.png +0 -0
- package/src/__tests__/__snapshots__/feed.test.ts.snap +164 -0
- package/src/__tests__/__snapshots__/translations.test.ts.snap +64 -0
- package/src/__tests__/authors.test.ts +608 -0
- package/src/__tests__/blogFrontMatter.test.ts +93 -16
- package/src/__tests__/blogUtils.test.ts +94 -0
- package/src/__tests__/{generateBlogFeed.test.ts → feed.test.ts} +35 -9
- package/src/__tests__/index.test.ts +84 -12
- package/src/__tests__/pluginOptionSchema.test.ts +3 -3
- package/src/__tests__/translations.test.ts +92 -0
- package/src/authors.ts +198 -0
- package/src/blogFrontMatter.ts +71 -33
- package/src/blogUtils.ts +202 -179
- package/{types.d.ts → src/deps.d.ts} +0 -0
- package/src/feed.ts +129 -0
- package/src/index.ts +118 -107
- package/src/markdownLoader.ts +8 -12
- package/{index.d.ts → src/plugin-content-blog.d.ts} +35 -31
- package/src/pluginOptionSchema.ts +31 -9
- package/src/translations.ts +63 -0
- package/src/types.ts +69 -16
- package/src/__tests__/__snapshots__/generateBlogFeed.test.ts.snap +0 -76
package/lib/types.d.ts
CHANGED
|
@@ -5,31 +5,56 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import type { RemarkAndRehypePluginOptions } from '@docusaurus/mdx-loader';
|
|
8
|
-
import {
|
|
8
|
+
import type { Tag } from '@docusaurus/utils';
|
|
9
|
+
import type { BrokenMarkdownLink, ContentPaths } from '@docusaurus/utils/lib/markdownLinks';
|
|
10
|
+
import { Overwrite } from 'utility-types';
|
|
11
|
+
import { BlogPostFrontMatter } from './blogFrontMatter';
|
|
9
12
|
export declare type BlogContentPaths = ContentPaths;
|
|
10
13
|
export interface BlogContent {
|
|
14
|
+
blogSidebarTitle: string;
|
|
11
15
|
blogPosts: BlogPost[];
|
|
12
16
|
blogListPaginated: BlogPaginated[];
|
|
13
17
|
blogTags: BlogTags;
|
|
14
18
|
blogTagsListPath: string | null;
|
|
15
19
|
}
|
|
16
|
-
export interface DateLink {
|
|
17
|
-
date: Date;
|
|
18
|
-
link: string;
|
|
19
|
-
}
|
|
20
20
|
export declare type FeedType = 'rss' | 'atom';
|
|
21
|
+
export declare type FeedOptions = {
|
|
22
|
+
type?: FeedType[] | null;
|
|
23
|
+
title?: string;
|
|
24
|
+
description?: string;
|
|
25
|
+
copyright: string;
|
|
26
|
+
language?: string;
|
|
27
|
+
};
|
|
28
|
+
export declare type UserFeedOptions = Overwrite<Partial<FeedOptions>, {
|
|
29
|
+
type?: FeedOptions['type'] | 'all';
|
|
30
|
+
}>;
|
|
21
31
|
export declare type EditUrlFunction = (editUrlParams: {
|
|
22
32
|
blogDirPath: string;
|
|
23
33
|
blogPath: string;
|
|
24
34
|
permalink: string;
|
|
25
35
|
locale: string;
|
|
26
36
|
}) => string | undefined;
|
|
27
|
-
|
|
37
|
+
declare type ReadingTimeOptions = {
|
|
38
|
+
wordsPerMinute?: number;
|
|
39
|
+
wordBound?: (char: string) => boolean;
|
|
40
|
+
};
|
|
41
|
+
export declare type ReadingTimeFunction = (params: {
|
|
42
|
+
content: string;
|
|
43
|
+
frontMatter?: BlogPostFrontMatter & Record<string, unknown>;
|
|
44
|
+
options?: ReadingTimeOptions;
|
|
45
|
+
}) => number;
|
|
46
|
+
export declare type ReadingTimeFunctionOption = (params: Required<Omit<Parameters<ReadingTimeFunction>[0], 'options'>> & {
|
|
47
|
+
defaultReadingTime: ReadingTimeFunction;
|
|
48
|
+
}) => number | undefined;
|
|
49
|
+
export declare type PluginOptions = RemarkAndRehypePluginOptions & {
|
|
28
50
|
id?: string;
|
|
29
51
|
path: string;
|
|
30
52
|
routeBasePath: string;
|
|
53
|
+
tagsBasePath: string;
|
|
54
|
+
archiveBasePath: string;
|
|
31
55
|
include: string[];
|
|
32
|
-
|
|
56
|
+
exclude: string[];
|
|
57
|
+
postsPerPage: number | 'ALL';
|
|
33
58
|
blogListComponent: string;
|
|
34
59
|
blogPostComponent: string;
|
|
35
60
|
blogTagsListComponent: string;
|
|
@@ -41,7 +66,7 @@ export interface PluginOptions extends RemarkAndRehypePluginOptions {
|
|
|
41
66
|
truncateMarker: RegExp;
|
|
42
67
|
showReadingTime: boolean;
|
|
43
68
|
feedOptions: {
|
|
44
|
-
type?: [
|
|
69
|
+
type?: FeedType[] | null;
|
|
45
70
|
title?: string;
|
|
46
71
|
description?: string;
|
|
47
72
|
copyright: string;
|
|
@@ -50,7 +75,13 @@ export interface PluginOptions extends RemarkAndRehypePluginOptions {
|
|
|
50
75
|
editUrl?: string | EditUrlFunction;
|
|
51
76
|
editLocalizedFiles?: boolean;
|
|
52
77
|
admonitions: Record<string, unknown>;
|
|
53
|
-
|
|
78
|
+
authorsMapPath: string;
|
|
79
|
+
readingTime: ReadingTimeFunctionOption;
|
|
80
|
+
sortPosts: 'ascending' | 'descending';
|
|
81
|
+
};
|
|
82
|
+
export declare type UserPluginOptions = Overwrite<Partial<PluginOptions>, {
|
|
83
|
+
feedOptions?: UserFeedOptions;
|
|
84
|
+
}>;
|
|
54
85
|
export interface BlogTags {
|
|
55
86
|
[key: string]: BlogTag;
|
|
56
87
|
}
|
|
@@ -62,6 +93,7 @@ export interface BlogTag {
|
|
|
62
93
|
export interface BlogPost {
|
|
63
94
|
id: string;
|
|
64
95
|
metadata: MetaData;
|
|
96
|
+
content: string;
|
|
65
97
|
}
|
|
66
98
|
export interface BlogPaginatedMetadata {
|
|
67
99
|
permalink: string;
|
|
@@ -78,28 +110,35 @@ export interface BlogPaginated {
|
|
|
78
110
|
metadata: BlogPaginatedMetadata;
|
|
79
111
|
items: string[];
|
|
80
112
|
}
|
|
113
|
+
export interface Author extends Record<string, unknown> {
|
|
114
|
+
name?: string;
|
|
115
|
+
imageURL?: string;
|
|
116
|
+
url?: string;
|
|
117
|
+
title?: string;
|
|
118
|
+
}
|
|
81
119
|
export interface MetaData {
|
|
82
120
|
permalink: string;
|
|
83
121
|
source: string;
|
|
84
122
|
description: string;
|
|
85
123
|
date: Date;
|
|
86
124
|
formattedDate: string;
|
|
87
|
-
tags:
|
|
125
|
+
tags: Tag[];
|
|
88
126
|
title: string;
|
|
89
127
|
readingTime?: number;
|
|
90
128
|
prevItem?: Paginator;
|
|
91
129
|
nextItem?: Paginator;
|
|
92
130
|
truncated: boolean;
|
|
93
131
|
editUrl?: string;
|
|
132
|
+
authors: Author[];
|
|
133
|
+
}
|
|
134
|
+
export interface Assets {
|
|
135
|
+
image?: string;
|
|
136
|
+
authorsImageUrls: (string | undefined)[];
|
|
94
137
|
}
|
|
95
138
|
export interface Paginator {
|
|
96
139
|
title: string;
|
|
97
140
|
permalink: string;
|
|
98
141
|
}
|
|
99
|
-
export interface Tag {
|
|
100
|
-
label: string;
|
|
101
|
-
permalink: string;
|
|
102
|
-
}
|
|
103
142
|
export interface BlogItemsToMetadata {
|
|
104
143
|
[key: string]: MetaData;
|
|
105
144
|
}
|
|
@@ -121,3 +160,4 @@ export declare type BlogMarkdownLoaderOptions = {
|
|
|
121
160
|
sourceToPermalink: Record<string, string>;
|
|
122
161
|
onBrokenMarkdownLink: (brokenMarkdownLink: BlogBrokenMarkdownLink) => void;
|
|
123
162
|
};
|
|
163
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/plugin-content-blog",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.13",
|
|
4
4
|
"description": "Blog plugin for Docusaurus.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
|
-
"types": "
|
|
6
|
+
"types": "src/plugin-content-blog.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsc",
|
|
9
9
|
"watch": "tsc --watch"
|
|
@@ -18,29 +18,33 @@
|
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@docusaurus/core": "2.0.0-beta.
|
|
22
|
-
"@docusaurus/mdx-loader": "2.0.0-beta.
|
|
23
|
-
"@docusaurus/
|
|
24
|
-
"@docusaurus/utils": "2.0.0-beta.
|
|
25
|
-
"
|
|
26
|
-
"chalk": "^4.1.1",
|
|
21
|
+
"@docusaurus/core": "2.0.0-beta.13",
|
|
22
|
+
"@docusaurus/mdx-loader": "2.0.0-beta.13",
|
|
23
|
+
"@docusaurus/utils": "2.0.0-beta.13",
|
|
24
|
+
"@docusaurus/utils-validation": "2.0.0-beta.13",
|
|
25
|
+
"chalk": "^4.1.2",
|
|
27
26
|
"escape-string-regexp": "^4.0.0",
|
|
28
27
|
"feed": "^4.2.2",
|
|
29
28
|
"fs-extra": "^10.0.0",
|
|
30
29
|
"globby": "^11.0.2",
|
|
30
|
+
"js-yaml": "^4.0.0",
|
|
31
31
|
"loader-utils": "^2.0.0",
|
|
32
32
|
"lodash": "^4.17.20",
|
|
33
|
-
"reading-time": "^1.
|
|
33
|
+
"reading-time": "^1.5.0",
|
|
34
34
|
"remark-admonitions": "^1.2.1",
|
|
35
|
-
"tslib": "^2.
|
|
36
|
-
"
|
|
35
|
+
"tslib": "^2.3.1",
|
|
36
|
+
"utility-types": "^3.10.0",
|
|
37
|
+
"webpack": "^5.61.0"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@docusaurus/types": "2.0.0-beta.13"
|
|
37
41
|
},
|
|
38
42
|
"peerDependencies": {
|
|
39
43
|
"react": "^16.8.4 || ^17.0.0",
|
|
40
44
|
"react-dom": "^16.8.4 || ^17.0.0"
|
|
41
45
|
},
|
|
42
46
|
"engines": {
|
|
43
|
-
"node": ">=
|
|
47
|
+
"node": ">=14"
|
|
44
48
|
},
|
|
45
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "b6ca12aedf10a10c2375f4f8b7e7380cfd7c7202"
|
|
46
50
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"JMarcey": {
|
|
3
|
+
"name": "Joel Marcey",
|
|
4
|
+
"title": "Technical Lead & Developer Advocate at Facebook",
|
|
5
|
+
"url": "http://twitter.com/JoelMarcey",
|
|
6
|
+
"image_url": "https://github.com/JoelMarcey.png",
|
|
7
|
+
"twitter": "JoelMarcey"
|
|
8
|
+
},
|
|
9
|
+
"slorber": {
|
|
10
|
+
"name": "Sébastien Lorber",
|
|
11
|
+
"title": "Docusaurus maintainer",
|
|
12
|
+
"url": "https://sebastienlorber.com",
|
|
13
|
+
"image_url": "https://github.com/slorber.png",
|
|
14
|
+
"twitter": "sebastienlorber"
|
|
15
|
+
},
|
|
16
|
+
"yangshun": {
|
|
17
|
+
"name": "Yangshun Tay",
|
|
18
|
+
"title": "Front End Engineer at Facebook",
|
|
19
|
+
"url": "https://github.com/yangshun",
|
|
20
|
+
"image_url": "https://github.com/yangshun.png",
|
|
21
|
+
"twitter": "yangshunz"
|
|
22
|
+
},
|
|
23
|
+
"lex111": {
|
|
24
|
+
"name": "Alexey Pyltsyn",
|
|
25
|
+
"title": "Open-source enthusiast",
|
|
26
|
+
"url": "https://github.com/lex111",
|
|
27
|
+
"image_url": "https://github.com/lex111.png"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
|
|
2
|
+
JMarcey:
|
|
3
|
+
name: Joel Marcey
|
|
4
|
+
title: Technical Lead & Developer Advocate at Facebook
|
|
5
|
+
url: http://twitter.com/JoelMarcey
|
|
6
|
+
image_url: https://github.com/JoelMarcey.png
|
|
7
|
+
twitter: JoelMarcey
|
|
8
|
+
|
|
9
|
+
slorber:
|
|
10
|
+
name: Sébastien Lorber
|
|
11
|
+
title: Docusaurus maintainer
|
|
12
|
+
url: https://sebastienlorber.com
|
|
13
|
+
image_url: https://github.com/slorber.png
|
|
14
|
+
twitter: sebastienlorber
|
|
15
|
+
|
|
16
|
+
yangshun:
|
|
17
|
+
name: Yangshun Tay
|
|
18
|
+
title: Front End Engineer at Facebook
|
|
19
|
+
url: https://github.com/yangshun
|
|
20
|
+
image_url: https://github.com/yangshun.png
|
|
21
|
+
twitter: yangshunz
|
|
22
|
+
|
|
23
|
+
lex111:
|
|
24
|
+
name: Alexey Pyltsyn
|
|
25
|
+
title: Open-source enthusiast
|
|
26
|
+
url: https://github.com/lex111
|
|
27
|
+
image_url: https://github.com/lex111.png
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/__tests__/__fixtures__/getAuthorsMapFilePath/contentPathNestedYml/sub/folder/authors.yml
ADDED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Full Blog Sample
|
|
3
|
+
date: 2021-03-05
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<h1>HTML Heading 1</h1>
|
|
7
|
+
<h2>HTML Heading 2</h2>
|
|
8
|
+
<p>HTML Paragraph</p>
|
|
9
|
+
|
|
10
|
+
import Typography from '../../component/Typography'
|
|
11
|
+
|
|
12
|
+
<Typography>Import DOM</Typography>
|
|
13
|
+
|
|
14
|
+
# Heading 1
|
|
15
|
+
|
|
16
|
+
## Heading 2
|
|
17
|
+
|
|
18
|
+
### Heading 3
|
|
19
|
+
|
|
20
|
+
#### Heading 4
|
|
21
|
+
|
|
22
|
+
##### Heading 5
|
|
23
|
+
|
|
24
|
+
- list1
|
|
25
|
+
- list2
|
|
26
|
+
- list3
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
* list1
|
|
30
|
+
* list2
|
|
31
|
+
* list3
|
|
32
|
+
|
|
33
|
+
Normal Text *Italics Text* **Bold Text**
|
|
34
|
+
|
|
35
|
+
[link](https://v2.docusaurus.io/)
|
|
36
|
+

|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: MDX Blog Sample with require calls
|
|
3
|
+
date: 2021-03-06
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Test MDX with require calls
|
|
7
|
+
|
|
8
|
+
import useBaseUrl from '@docusaurus/useBaseUrl';
|
|
9
|
+
|
|
10
|
+
<img src={useBaseUrl('/img/docusaurus.png')} />
|
|
11
|
+
|
|
12
|
+
<img src={require('../static/img/docusaurus.png').default} />
|
|
13
|
+
|
|
14
|
+
<img src={require('@site/static/img/docusaurus.png').default} />
|
|
Binary file
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`blogFeed atom shows feed item for each post 1`] = `
|
|
4
|
+
"<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
|
|
5
|
+
<feed xmlns=\\"http://www.w3.org/2005/Atom\\">
|
|
6
|
+
<id>https://docusaurus.io/myBaseUrl/blog</id>
|
|
7
|
+
<title>Hello Blog</title>
|
|
8
|
+
<updated>2021-03-06T00:00:00.000Z</updated>
|
|
9
|
+
<generator>https://github.com/jpmonette/feed</generator>
|
|
10
|
+
<link rel=\\"alternate\\" href=\\"https://docusaurus.io/myBaseUrl/blog\\"/>
|
|
11
|
+
<subtitle>Hello Blog</subtitle>
|
|
12
|
+
<icon>https://docusaurus.io/myBaseUrl/image/favicon.ico</icon>
|
|
13
|
+
<rights>Copyright</rights>
|
|
14
|
+
<entry>
|
|
15
|
+
<title type=\\"html\\"><![CDATA[MDX Blog Sample with require calls]]></title>
|
|
16
|
+
<id>/mdx-require-blog-post</id>
|
|
17
|
+
<link href=\\"https://docusaurus.io/myBaseUrl/blog/mdx-require-blog-post\\"/>
|
|
18
|
+
<updated>2021-03-06T00:00:00.000Z</updated>
|
|
19
|
+
<summary type=\\"html\\"><![CDATA[Test MDX with require calls]]></summary>
|
|
20
|
+
</entry>
|
|
21
|
+
<entry>
|
|
22
|
+
<title type=\\"html\\"><![CDATA[Full Blog Sample]]></title>
|
|
23
|
+
<id>/mdx-blog-post</id>
|
|
24
|
+
<link href=\\"https://docusaurus.io/myBaseUrl/blog/mdx-blog-post\\"/>
|
|
25
|
+
<updated>2021-03-05T00:00:00.000Z</updated>
|
|
26
|
+
<summary type=\\"html\\"><![CDATA[HTML Heading 1]]></summary>
|
|
27
|
+
<content type=\\"html\\"><![CDATA[<h1>HTML Heading 1</h1><h2>HTML Heading 2</h2><p>HTML Paragraph</p><div>Import DOM</div><h1>Heading 1</h1><h2>Heading 2</h2><h3>Heading 3</h3><h4>Heading 4</h4><h5>Heading 5</h5><ul><li>list1</li><li>list2</li><li>list3</li></ul><ul><li>list1</li><li>list2</li><li>list3</li></ul><p>Normal Text <em>Italics Text</em> <strong>Bold Text</strong></p><p><a href=\\"https://v2.docusaurus.io/\\">link</a>
|
|
28
|
+
<img src=\\"https://v2.docusaurus.io/\\" alt=\\"image\\"/></p>]]></content>
|
|
29
|
+
</entry>
|
|
30
|
+
<entry>
|
|
31
|
+
<title type=\\"html\\"><![CDATA[Complex Slug]]></title>
|
|
32
|
+
<id>/hey/my super path/héllô</id>
|
|
33
|
+
<link href=\\"https://docusaurus.io/myBaseUrl/blog/hey/my super path/héllô\\"/>
|
|
34
|
+
<updated>2020-08-16T00:00:00.000Z</updated>
|
|
35
|
+
<summary type=\\"html\\"><![CDATA[complex url slug]]></summary>
|
|
36
|
+
<content type=\\"html\\"><![CDATA[<p>complex url slug</p>]]></content>
|
|
37
|
+
</entry>
|
|
38
|
+
<entry>
|
|
39
|
+
<title type=\\"html\\"><![CDATA[Simple Slug]]></title>
|
|
40
|
+
<id>/simple/slug</id>
|
|
41
|
+
<link href=\\"https://docusaurus.io/myBaseUrl/blog/simple/slug\\"/>
|
|
42
|
+
<updated>2020-08-15T00:00:00.000Z</updated>
|
|
43
|
+
<summary type=\\"html\\"><![CDATA[simple url slug]]></summary>
|
|
44
|
+
<content type=\\"html\\"><![CDATA[<p>simple url slug</p>]]></content>
|
|
45
|
+
<author>
|
|
46
|
+
<name>Sébastien Lorber</name>
|
|
47
|
+
<uri>https://sebastienlorber.com</uri>
|
|
48
|
+
</author>
|
|
49
|
+
</entry>
|
|
50
|
+
<entry>
|
|
51
|
+
<title type=\\"html\\"><![CDATA[draft]]></title>
|
|
52
|
+
<id>/draft</id>
|
|
53
|
+
<link href=\\"https://docusaurus.io/myBaseUrl/blog/draft\\"/>
|
|
54
|
+
<updated>2020-02-27T00:00:00.000Z</updated>
|
|
55
|
+
<summary type=\\"html\\"><![CDATA[this post should not be published yet]]></summary>
|
|
56
|
+
<content type=\\"html\\"><![CDATA[<p>this post should not be published yet</p>]]></content>
|
|
57
|
+
</entry>
|
|
58
|
+
<entry>
|
|
59
|
+
<title type=\\"html\\"><![CDATA[some heading]]></title>
|
|
60
|
+
<id>/heading-as-title</id>
|
|
61
|
+
<link href=\\"https://docusaurus.io/myBaseUrl/blog/heading-as-title\\"/>
|
|
62
|
+
<updated>2019-01-02T00:00:00.000Z</updated>
|
|
63
|
+
</entry>
|
|
64
|
+
<entry>
|
|
65
|
+
<title type=\\"html\\"><![CDATA[date-matter]]></title>
|
|
66
|
+
<id>/date-matter</id>
|
|
67
|
+
<link href=\\"https://docusaurus.io/myBaseUrl/blog/date-matter\\"/>
|
|
68
|
+
<updated>2019-01-01T00:00:00.000Z</updated>
|
|
69
|
+
<summary type=\\"html\\"><![CDATA[date inside front matter]]></summary>
|
|
70
|
+
<content type=\\"html\\"><![CDATA[<p>date inside front matter</p>]]></content>
|
|
71
|
+
</entry>
|
|
72
|
+
<entry>
|
|
73
|
+
<title type=\\"html\\"><![CDATA[Happy 1st Birthday Slash! (translated)]]></title>
|
|
74
|
+
<id>/2018/12/14/Happy-First-Birthday-Slash</id>
|
|
75
|
+
<link href=\\"https://docusaurus.io/myBaseUrl/blog/2018/12/14/Happy-First-Birthday-Slash\\"/>
|
|
76
|
+
<updated>2018-12-14T00:00:00.000Z</updated>
|
|
77
|
+
<summary type=\\"html\\"><![CDATA[Happy birthday! (translated)]]></summary>
|
|
78
|
+
<content type=\\"html\\"><![CDATA[<p>Happy birthday! (translated)</p>]]></content>
|
|
79
|
+
<author>
|
|
80
|
+
<name>Yangshun Tay (translated)</name>
|
|
81
|
+
</author>
|
|
82
|
+
<author>
|
|
83
|
+
<name>Sébastien Lorber (translated)</name>
|
|
84
|
+
</author>
|
|
85
|
+
</entry>
|
|
86
|
+
</feed>"
|
|
87
|
+
`;
|
|
88
|
+
|
|
89
|
+
exports[`blogFeed rss shows feed item for each post 1`] = `
|
|
90
|
+
"<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
|
|
91
|
+
<rss version=\\"2.0\\" xmlns:dc=\\"http://purl.org/dc/elements/1.1/\\" xmlns:content=\\"http://purl.org/rss/1.0/modules/content/\\">
|
|
92
|
+
<channel>
|
|
93
|
+
<title>Hello Blog</title>
|
|
94
|
+
<link>https://docusaurus.io/myBaseUrl/blog</link>
|
|
95
|
+
<description>Hello Blog</description>
|
|
96
|
+
<lastBuildDate>Sat, 06 Mar 2021 00:00:00 GMT</lastBuildDate>
|
|
97
|
+
<docs>https://validator.w3.org/feed/docs/rss2.html</docs>
|
|
98
|
+
<generator>https://github.com/jpmonette/feed</generator>
|
|
99
|
+
<copyright>Copyright</copyright>
|
|
100
|
+
<item>
|
|
101
|
+
<title><![CDATA[MDX Blog Sample with require calls]]></title>
|
|
102
|
+
<link>https://docusaurus.io/myBaseUrl/blog/mdx-require-blog-post</link>
|
|
103
|
+
<guid>/mdx-require-blog-post</guid>
|
|
104
|
+
<pubDate>Sat, 06 Mar 2021 00:00:00 GMT</pubDate>
|
|
105
|
+
<description><![CDATA[Test MDX with require calls]]></description>
|
|
106
|
+
</item>
|
|
107
|
+
<item>
|
|
108
|
+
<title><![CDATA[Full Blog Sample]]></title>
|
|
109
|
+
<link>https://docusaurus.io/myBaseUrl/blog/mdx-blog-post</link>
|
|
110
|
+
<guid>/mdx-blog-post</guid>
|
|
111
|
+
<pubDate>Fri, 05 Mar 2021 00:00:00 GMT</pubDate>
|
|
112
|
+
<description><![CDATA[HTML Heading 1]]></description>
|
|
113
|
+
<content:encoded><![CDATA[<h1>HTML Heading 1</h1><h2>HTML Heading 2</h2><p>HTML Paragraph</p><div>Import DOM</div><h1>Heading 1</h1><h2>Heading 2</h2><h3>Heading 3</h3><h4>Heading 4</h4><h5>Heading 5</h5><ul><li>list1</li><li>list2</li><li>list3</li></ul><ul><li>list1</li><li>list2</li><li>list3</li></ul><p>Normal Text <em>Italics Text</em> <strong>Bold Text</strong></p><p><a href=\\"https://v2.docusaurus.io/\\">link</a>
|
|
114
|
+
<img src=\\"https://v2.docusaurus.io/\\" alt=\\"image\\"/></p>]]></content:encoded>
|
|
115
|
+
</item>
|
|
116
|
+
<item>
|
|
117
|
+
<title><![CDATA[Complex Slug]]></title>
|
|
118
|
+
<link>https://docusaurus.io/myBaseUrl/blog/hey/my super path/héllô</link>
|
|
119
|
+
<guid>/hey/my super path/héllô</guid>
|
|
120
|
+
<pubDate>Sun, 16 Aug 2020 00:00:00 GMT</pubDate>
|
|
121
|
+
<description><![CDATA[complex url slug]]></description>
|
|
122
|
+
<content:encoded><![CDATA[<p>complex url slug</p>]]></content:encoded>
|
|
123
|
+
</item>
|
|
124
|
+
<item>
|
|
125
|
+
<title><![CDATA[Simple Slug]]></title>
|
|
126
|
+
<link>https://docusaurus.io/myBaseUrl/blog/simple/slug</link>
|
|
127
|
+
<guid>/simple/slug</guid>
|
|
128
|
+
<pubDate>Sat, 15 Aug 2020 00:00:00 GMT</pubDate>
|
|
129
|
+
<description><![CDATA[simple url slug]]></description>
|
|
130
|
+
<content:encoded><![CDATA[<p>simple url slug</p>]]></content:encoded>
|
|
131
|
+
</item>
|
|
132
|
+
<item>
|
|
133
|
+
<title><![CDATA[draft]]></title>
|
|
134
|
+
<link>https://docusaurus.io/myBaseUrl/blog/draft</link>
|
|
135
|
+
<guid>/draft</guid>
|
|
136
|
+
<pubDate>Thu, 27 Feb 2020 00:00:00 GMT</pubDate>
|
|
137
|
+
<description><![CDATA[this post should not be published yet]]></description>
|
|
138
|
+
<content:encoded><![CDATA[<p>this post should not be published yet</p>]]></content:encoded>
|
|
139
|
+
</item>
|
|
140
|
+
<item>
|
|
141
|
+
<title><![CDATA[some heading]]></title>
|
|
142
|
+
<link>https://docusaurus.io/myBaseUrl/blog/heading-as-title</link>
|
|
143
|
+
<guid>/heading-as-title</guid>
|
|
144
|
+
<pubDate>Wed, 02 Jan 2019 00:00:00 GMT</pubDate>
|
|
145
|
+
</item>
|
|
146
|
+
<item>
|
|
147
|
+
<title><![CDATA[date-matter]]></title>
|
|
148
|
+
<link>https://docusaurus.io/myBaseUrl/blog/date-matter</link>
|
|
149
|
+
<guid>/date-matter</guid>
|
|
150
|
+
<pubDate>Tue, 01 Jan 2019 00:00:00 GMT</pubDate>
|
|
151
|
+
<description><![CDATA[date inside front matter]]></description>
|
|
152
|
+
<content:encoded><![CDATA[<p>date inside front matter</p>]]></content:encoded>
|
|
153
|
+
</item>
|
|
154
|
+
<item>
|
|
155
|
+
<title><![CDATA[Happy 1st Birthday Slash! (translated)]]></title>
|
|
156
|
+
<link>https://docusaurus.io/myBaseUrl/blog/2018/12/14/Happy-First-Birthday-Slash</link>
|
|
157
|
+
<guid>/2018/12/14/Happy-First-Birthday-Slash</guid>
|
|
158
|
+
<pubDate>Fri, 14 Dec 2018 00:00:00 GMT</pubDate>
|
|
159
|
+
<description><![CDATA[Happy birthday! (translated)]]></description>
|
|
160
|
+
<content:encoded><![CDATA[<p>Happy birthday! (translated)</p>]]></content:encoded>
|
|
161
|
+
</item>
|
|
162
|
+
</channel>
|
|
163
|
+
</rss>"
|
|
164
|
+
`;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`getContentTranslationFiles should return translation files matching snapshot 1`] = `
|
|
4
|
+
Array [
|
|
5
|
+
Object {
|
|
6
|
+
"content": Object {
|
|
7
|
+
"description": Object {
|
|
8
|
+
"description": "The description for the blog used in SEO",
|
|
9
|
+
"message": "Someone's random blog",
|
|
10
|
+
},
|
|
11
|
+
"sidebar.title": Object {
|
|
12
|
+
"description": "The label for the left sidebar",
|
|
13
|
+
"message": "All my posts",
|
|
14
|
+
},
|
|
15
|
+
"title": Object {
|
|
16
|
+
"description": "The title for the blog used in SEO",
|
|
17
|
+
"message": "My blog",
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
"path": "options",
|
|
21
|
+
},
|
|
22
|
+
]
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
exports[`translateContent should return translated loaded content matching snapshot 1`] = `
|
|
26
|
+
Object {
|
|
27
|
+
"blogListPaginated": Array [
|
|
28
|
+
Object {
|
|
29
|
+
"items": Array [
|
|
30
|
+
"hello",
|
|
31
|
+
],
|
|
32
|
+
"metadata": Object {
|
|
33
|
+
"blogDescription": "Someone's random blog (translated)",
|
|
34
|
+
"blogTitle": "My blog (translated)",
|
|
35
|
+
"nextPage": null,
|
|
36
|
+
"page": 1,
|
|
37
|
+
"permalink": "/",
|
|
38
|
+
"postsPerPage": 10,
|
|
39
|
+
"previousPage": null,
|
|
40
|
+
"totalCount": 1,
|
|
41
|
+
"totalPages": 1,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
"blogPosts": Array [
|
|
46
|
+
Object {
|
|
47
|
+
"id": "hello",
|
|
48
|
+
"metadata": Object {
|
|
49
|
+
"date": 2021-07-19T00:00:00.000Z,
|
|
50
|
+
"description": "/blog/2021/06/19/hello",
|
|
51
|
+
"formattedDate": "June 19, 2021",
|
|
52
|
+
"permalink": "/blog/2021/06/19/hello",
|
|
53
|
+
"source": "/blog/2021/06/19/hello",
|
|
54
|
+
"tags": Array [],
|
|
55
|
+
"title": "Hello",
|
|
56
|
+
"truncated": true,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
"blogSidebarTitle": "All my posts (translated)",
|
|
61
|
+
"blogTags": Object {},
|
|
62
|
+
"blogTagsListPath": "/tags",
|
|
63
|
+
}
|
|
64
|
+
`;
|