@docusaurus/plugin-content-blog 0.0.0-4277 → 0.0.0-4285

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.
Files changed (49) hide show
  1. package/package.json +7 -7
  2. package/lib/.tsbuildinfo +0 -1
  3. package/src/__tests__/__fixtures__/authorsMapFiles/authors.json +0 -29
  4. package/src/__tests__/__fixtures__/authorsMapFiles/authors.yml +0 -27
  5. package/src/__tests__/__fixtures__/authorsMapFiles/authorsBad1.json +0 -5
  6. package/src/__tests__/__fixtures__/authorsMapFiles/authorsBad1.yml +0 -3
  7. package/src/__tests__/__fixtures__/authorsMapFiles/authorsBad2.json +0 -3
  8. package/src/__tests__/__fixtures__/authorsMapFiles/authorsBad2.yml +0 -2
  9. package/src/__tests__/__fixtures__/authorsMapFiles/authorsBad3.json +0 -8
  10. package/src/__tests__/__fixtures__/authorsMapFiles/authorsBad3.yml +0 -3
  11. package/src/__tests__/__fixtures__/component/Typography.tsx +0 -6
  12. package/src/__tests__/__fixtures__/getAuthorsMapFilePath/contentPathEmpty/empty +0 -0
  13. package/src/__tests__/__fixtures__/getAuthorsMapFilePath/contentPathJson1/authors.json +0 -0
  14. package/src/__tests__/__fixtures__/getAuthorsMapFilePath/contentPathJson2/authors.json +0 -0
  15. package/src/__tests__/__fixtures__/getAuthorsMapFilePath/contentPathNestedYml/sub/folder/authors.yml +0 -0
  16. package/src/__tests__/__fixtures__/getAuthorsMapFilePath/contentPathYml1/authors.yml +0 -0
  17. package/src/__tests__/__fixtures__/getAuthorsMapFilePath/contentPathYml2/authors.yml +0 -0
  18. package/src/__tests__/__fixtures__/website/blog/2018-12-14-Happy-First-Birthday-Slash.md +0 -8
  19. package/src/__tests__/__fixtures__/website/blog/_partials/somePartial.md +0 -3
  20. package/src/__tests__/__fixtures__/website/blog/_partials/subfolder/somePartial.md +0 -3
  21. package/src/__tests__/__fixtures__/website/blog/_somePartial.md +0 -3
  22. package/src/__tests__/__fixtures__/website/blog/authors.yml +0 -4
  23. package/src/__tests__/__fixtures__/website/blog/complex-slug.md +0 -7
  24. package/src/__tests__/__fixtures__/website/blog/date-matter.md +0 -5
  25. package/src/__tests__/__fixtures__/website/blog/draft.md +0 -6
  26. package/src/__tests__/__fixtures__/website/blog/heading-as-title.md +0 -5
  27. package/src/__tests__/__fixtures__/website/blog/mdx-blog-post.mdx +0 -36
  28. package/src/__tests__/__fixtures__/website/blog/mdx-require-blog-post.mdx +0 -14
  29. package/src/__tests__/__fixtures__/website/blog/simple-slug.md +0 -11
  30. package/src/__tests__/__fixtures__/website/blog-with-ref/2018-12-14-Happy-First-Birthday-Slash.md +0 -5
  31. package/src/__tests__/__fixtures__/website/blog-with-ref/post-with-broken-links.md +0 -11
  32. package/src/__tests__/__fixtures__/website/blog-with-ref/post.md +0 -5
  33. package/src/__tests__/__fixtures__/website/i18n/en/docusaurus-plugin-content-blog/2018-12-14-Happy-First-Birthday-Slash.md +0 -8
  34. package/src/__tests__/__fixtures__/website/i18n/en/docusaurus-plugin-content-blog/authors.yml +0 -5
  35. package/src/__tests__/__fixtures__/website/static/img/docusaurus.png +0 -0
  36. package/src/__tests__/__fixtures__/website-blog-without-date/blog/no date.md +0 -1
  37. package/src/__tests__/__snapshots__/feed.test.ts.snap +0 -164
  38. package/src/__tests__/__snapshots__/linkify.test.ts.snap +0 -24
  39. package/src/__tests__/__snapshots__/pluginOptionSchema.test.ts.snap +0 -5
  40. package/src/__tests__/__snapshots__/translations.test.ts.snap +0 -64
  41. package/src/__tests__/authors.test.ts +0 -608
  42. package/src/__tests__/blogFrontMatter.test.ts +0 -394
  43. package/src/__tests__/blogUtils.test.ts +0 -94
  44. package/src/__tests__/feed.test.ts +0 -126
  45. package/src/__tests__/index.test.ts +0 -408
  46. package/src/__tests__/linkify.test.ts +0 -93
  47. package/src/__tests__/pluginOptionSchema.test.ts +0 -150
  48. package/src/__tests__/translations.test.ts +0 -92
  49. package/tsconfig.json +0 -9
@@ -1,92 +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
-
8
- import {BlogPost, BlogContent, PluginOptions} from '../types';
9
- import {getTranslationFiles, translateContent} from '../translations';
10
- import {DEFAULT_OPTIONS} from '../pluginOptionSchema';
11
- import {updateTranslationFileMessages} from '@docusaurus/utils';
12
-
13
- const sampleBlogOptions: PluginOptions = {
14
- ...DEFAULT_OPTIONS,
15
- blogSidebarTitle: 'All my posts',
16
- blogTitle: 'My blog',
17
- blogDescription: "Someone's random blog",
18
- };
19
-
20
- const sampleBlogPosts: BlogPost[] = [
21
- {
22
- id: 'hello',
23
- metadata: {
24
- permalink: '/blog/2021/06/19/hello',
25
- source: '/blog/2021/06/19/hello',
26
- description: '/blog/2021/06/19/hello',
27
- date: new Date(2021, 6, 19),
28
- formattedDate: 'June 19, 2021',
29
- tags: [],
30
- title: 'Hello',
31
- truncated: true,
32
- },
33
- },
34
- ];
35
-
36
- const sampleBlogContent: BlogContent = {
37
- blogSidebarTitle: sampleBlogOptions.blogSidebarTitle,
38
- blogListPaginated: [
39
- {
40
- items: ['hello'],
41
- metadata: {
42
- permalink: '/',
43
- page: 1,
44
- postsPerPage: 10,
45
- totalPages: 1,
46
- totalCount: 1,
47
- previousPage: null,
48
- nextPage: null,
49
- blogTitle: sampleBlogOptions.blogTitle,
50
- blogDescription: sampleBlogOptions.blogDescription,
51
- },
52
- },
53
- ],
54
- blogPosts: sampleBlogPosts,
55
- blogTags: {},
56
- blogTagsListPath: '/tags',
57
- };
58
-
59
- function getSampleTranslationFiles() {
60
- return getTranslationFiles(sampleBlogOptions);
61
- }
62
- function getSampleTranslationFilesTranslated() {
63
- const translationFiles = getSampleTranslationFiles();
64
- return translationFiles.map((translationFile) =>
65
- updateTranslationFileMessages(
66
- translationFile,
67
- (message) => `${message} (translated)`,
68
- ),
69
- );
70
- }
71
-
72
- describe('getContentTranslationFiles', () => {
73
- test('should return translation files matching snapshot', async () => {
74
- expect(getSampleTranslationFiles()).toMatchSnapshot();
75
- });
76
- });
77
-
78
- describe('translateContent', () => {
79
- test('should not translate anything if translation files are untranslated', () => {
80
- const translationFiles = getSampleTranslationFiles();
81
- expect(translateContent(sampleBlogContent, translationFiles)).toEqual(
82
- sampleBlogContent,
83
- );
84
- });
85
-
86
- test('should return translated loaded content matching snapshot', () => {
87
- const translationFiles = getSampleTranslationFilesTranslated();
88
- expect(
89
- translateContent(sampleBlogContent, translationFiles),
90
- ).toMatchSnapshot();
91
- });
92
- });
package/tsconfig.json DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.json",
3
- "compilerOptions": {
4
- "incremental": true,
5
- "tsBuildInfoFile": "./lib/.tsbuildinfo",
6
- "rootDir": "src",
7
- "outDir": "lib"
8
- }
9
- }