@docusaurus/theme-classic 3.5.1 → 3.5.2-canary-6122
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/index.js +2 -5
- package/lib/theme/Blog/Components/Author/index.js +1 -1
- package/lib/theme/Blog/Components/Author/styles.module.css +3 -3
- package/lib/theme/Blog/Pages/BlogAuthorsPostsPage/index.js +12 -3
- package/lib/theme/BlogListPaginator/index.js +2 -2
- package/lib/theme/BlogPostItem/Footer/ReadMoreLink/index.js +1 -1
- package/lib/theme/BlogPostPaginator/index.js +2 -2
- package/lib/theme/ColorModeToggle/index.js +2 -1
- package/lib/theme/DocTagDocListPage/index.js +1 -1
- package/lib/theme/Heading/styles.module.css +1 -1
- package/package.json +16 -15
- package/src/index.ts +2 -11
- package/src/theme/Blog/Components/Author/index.tsx +1 -1
- package/src/theme/Blog/Components/Author/styles.module.css +3 -3
- package/src/theme/Blog/Pages/BlogAuthorsPostsPage/index.tsx +12 -3
- package/src/theme/BlogListPaginator/index.tsx +2 -2
- package/src/theme/BlogPostItem/Footer/ReadMoreLink/index.tsx +1 -1
- package/src/theme/BlogPostPaginator/index.tsx +2 -2
- package/src/theme/ColorModeToggle/index.tsx +2 -1
- package/src/theme/DocTagDocListPage/index.tsx +1 -1
- package/src/theme/Heading/styles.module.css +1 -1
package/lib/index.js
CHANGED
|
@@ -10,13 +10,10 @@ exports.validateOptions = exports.validateThemeConfig = exports.getSwizzleConfig
|
|
|
10
10
|
exports.default = themeClassic;
|
|
11
11
|
const tslib_1 = require("tslib");
|
|
12
12
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
13
|
-
const module_1 = require("module");
|
|
14
13
|
const rtlcss_1 = tslib_1.__importDefault(require("rtlcss"));
|
|
15
14
|
const theme_translations_1 = require("@docusaurus/theme-translations");
|
|
16
15
|
const translations_1 = require("./translations");
|
|
17
16
|
const inlineScripts_1 = require("./inlineScripts");
|
|
18
|
-
const requireFromDocusaurusCore = (0, module_1.createRequire)(require.resolve('@docusaurus/core/package.json'));
|
|
19
|
-
const ContextReplacementPlugin = requireFromDocusaurusCore('webpack/lib/ContextReplacementPlugin');
|
|
20
17
|
function getInfimaCSSFile(direction) {
|
|
21
18
|
return `infima/dist/css/default/default${direction === 'rtl' ? '-rtl' : ''}.css`;
|
|
22
19
|
}
|
|
@@ -54,7 +51,7 @@ function themeClassic(context, options) {
|
|
|
54
51
|
modules.push(...customCss.map((p) => path_1.default.resolve(context.siteDir, p)));
|
|
55
52
|
return modules;
|
|
56
53
|
},
|
|
57
|
-
configureWebpack() {
|
|
54
|
+
configureWebpack(__config, __isServer, { currentBundler }) {
|
|
58
55
|
const prismLanguages = additionalLanguages
|
|
59
56
|
.map((lang) => `prism-${lang}`)
|
|
60
57
|
.join('|');
|
|
@@ -63,7 +60,7 @@ function themeClassic(context, options) {
|
|
|
63
60
|
// This allows better optimization by only bundling those components
|
|
64
61
|
// that the user actually needs, because the modules are dynamically
|
|
65
62
|
// required and can't be known during compile time.
|
|
66
|
-
new ContextReplacementPlugin(/prismjs[\\/]components$/, new RegExp(`^./(${prismLanguages})$`)),
|
|
63
|
+
new currentBundler.instance.ContextReplacementPlugin(/prismjs[\\/]components$/, new RegExp(`^./(${prismLanguages})$`)),
|
|
67
64
|
],
|
|
68
65
|
};
|
|
69
66
|
},
|
|
@@ -70,7 +70,7 @@ export default function BlogAuthor({as, author, className, count}) {
|
|
|
70
70
|
<AuthorName name={name} as={as} />
|
|
71
71
|
</MaybeLink>
|
|
72
72
|
)}
|
|
73
|
-
{count && <AuthorBlogPostCount count={count} />}
|
|
73
|
+
{count !== undefined && <AuthorBlogPostCount count={count} />}
|
|
74
74
|
</div>
|
|
75
75
|
{!!title && <AuthorTitle title={title} />}
|
|
76
76
|
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
|
|
46
46
|
.authorTitle {
|
|
47
47
|
font-size: 0.8rem;
|
|
48
|
-
line-height:
|
|
48
|
+
line-height: 1rem;
|
|
49
49
|
display: -webkit-box;
|
|
50
50
|
overflow: hidden;
|
|
51
51
|
line-clamp: 1;
|
|
@@ -55,12 +55,12 @@
|
|
|
55
55
|
|
|
56
56
|
.author-as-h1 .authorTitle {
|
|
57
57
|
font-size: 1.2rem;
|
|
58
|
-
line-height: 1.
|
|
58
|
+
line-height: 1.6rem;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
.author-as-h2 .authorTitle {
|
|
62
62
|
font-size: 1rem;
|
|
63
|
-
line-height:
|
|
63
|
+
line-height: 1.3rem;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
.authorBlogPostCount {
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
useBlogAuthorPageTitle,
|
|
16
16
|
BlogAuthorsListViewAllLabel,
|
|
17
|
+
BlogAuthorNoPostsLabel,
|
|
17
18
|
} from '@docusaurus/theme-common/internal';
|
|
18
19
|
import Link from '@docusaurus/Link';
|
|
19
20
|
import {useBlogMetadata} from '@docusaurus/plugin-content-blog/client';
|
|
@@ -47,9 +48,17 @@ function Content({author, items, sidebar, listMetadata}) {
|
|
|
47
48
|
{author.description && <p>{author.description}</p>}
|
|
48
49
|
<ViewAllAuthorsLink />
|
|
49
50
|
</header>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
{items.length === 0 ? (
|
|
52
|
+
<p>
|
|
53
|
+
<BlogAuthorNoPostsLabel />
|
|
54
|
+
</p>
|
|
55
|
+
) : (
|
|
56
|
+
<>
|
|
57
|
+
<hr />
|
|
58
|
+
<BlogPostItems items={items} />
|
|
59
|
+
<BlogListPaginator metadata={listMetadata} />
|
|
60
|
+
</>
|
|
61
|
+
)}
|
|
53
62
|
</BlogLayout>
|
|
54
63
|
);
|
|
55
64
|
}
|
|
@@ -25,7 +25,7 @@ export default function BlogListPaginator(props) {
|
|
|
25
25
|
<Translate
|
|
26
26
|
id="theme.blog.paginator.newerEntries"
|
|
27
27
|
description="The label used to navigate to the newer blog posts page (previous page)">
|
|
28
|
-
Newer
|
|
28
|
+
Newer entries
|
|
29
29
|
</Translate>
|
|
30
30
|
}
|
|
31
31
|
/>
|
|
@@ -37,7 +37,7 @@ export default function BlogListPaginator(props) {
|
|
|
37
37
|
<Translate
|
|
38
38
|
id="theme.blog.paginator.olderEntries"
|
|
39
39
|
description="The label used to navigate to the older blog posts page (next page)">
|
|
40
|
-
Older
|
|
40
|
+
Older entries
|
|
41
41
|
</Translate>
|
|
42
42
|
}
|
|
43
43
|
isNext
|
|
@@ -24,7 +24,7 @@ export default function BlogPostPaginator(props) {
|
|
|
24
24
|
<Translate
|
|
25
25
|
id="theme.blog.post.paginator.newerPost"
|
|
26
26
|
description="The blog post button label to navigate to the newer/previous post">
|
|
27
|
-
Newer
|
|
27
|
+
Newer post
|
|
28
28
|
</Translate>
|
|
29
29
|
}
|
|
30
30
|
/>
|
|
@@ -36,7 +36,7 @@ export default function BlogPostPaginator(props) {
|
|
|
36
36
|
<Translate
|
|
37
37
|
id="theme.blog.post.paginator.olderPost"
|
|
38
38
|
description="The blog post button label to navigate to the older/next post">
|
|
39
|
-
Older
|
|
39
|
+
Older post
|
|
40
40
|
</Translate>
|
|
41
41
|
}
|
|
42
42
|
isNext
|
|
@@ -48,7 +48,8 @@ function ColorModeToggle({className, buttonClassName, value, onChange}) {
|
|
|
48
48
|
disabled={!isBrowser}
|
|
49
49
|
title={title}
|
|
50
50
|
aria-label={title}
|
|
51
|
-
aria-live="polite"
|
|
51
|
+
aria-live="polite"
|
|
52
|
+
aria-pressed={value === 'dark' ? 'true' : 'false'}>
|
|
52
53
|
<IconLightMode
|
|
53
54
|
className={clsx(styles.toggleIcon, styles.lightToggleIcon)}
|
|
54
55
|
/>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
/*
|
|
9
9
|
When the navbar is sticky, ensure that on anchor click,
|
|
10
10
|
the browser does not scroll that anchor behind the navbar
|
|
11
|
-
See https://
|
|
11
|
+
See https://x.com/JoshWComeau/status/1332015868725891076
|
|
12
12
|
*/
|
|
13
13
|
.anchorWithStickyNavbar {
|
|
14
14
|
scroll-margin-top: calc(var(--ifm-navbar-height) + 0.5rem);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/theme-classic",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.2-canary-6122",
|
|
4
4
|
"description": "Classic theme for Docusaurus",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "src/theme-classic.d.ts",
|
|
@@ -20,22 +20,23 @@
|
|
|
20
20
|
"copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@docusaurus/core": "3.5.
|
|
24
|
-
"@docusaurus/
|
|
25
|
-
"@docusaurus/
|
|
26
|
-
"@docusaurus/
|
|
27
|
-
"@docusaurus/plugin-content-
|
|
28
|
-
"@docusaurus/plugin-content-
|
|
29
|
-
"@docusaurus/
|
|
30
|
-
"@docusaurus/theme-
|
|
31
|
-
"@docusaurus/
|
|
32
|
-
"@docusaurus/
|
|
33
|
-
"@docusaurus/utils
|
|
34
|
-
"@docusaurus/utils-
|
|
23
|
+
"@docusaurus/core": "3.5.2-canary-6122",
|
|
24
|
+
"@docusaurus/logger": "3.5.2-canary-6122",
|
|
25
|
+
"@docusaurus/mdx-loader": "3.5.2-canary-6122",
|
|
26
|
+
"@docusaurus/module-type-aliases": "3.5.2-canary-6122",
|
|
27
|
+
"@docusaurus/plugin-content-blog": "3.5.2-canary-6122",
|
|
28
|
+
"@docusaurus/plugin-content-docs": "3.5.2-canary-6122",
|
|
29
|
+
"@docusaurus/plugin-content-pages": "3.5.2-canary-6122",
|
|
30
|
+
"@docusaurus/theme-common": "3.5.2-canary-6122",
|
|
31
|
+
"@docusaurus/theme-translations": "3.5.2-canary-6122",
|
|
32
|
+
"@docusaurus/types": "3.5.2-canary-6122",
|
|
33
|
+
"@docusaurus/utils": "3.5.2-canary-6122",
|
|
34
|
+
"@docusaurus/utils-common": "3.5.2-canary-6122",
|
|
35
|
+
"@docusaurus/utils-validation": "3.5.2-canary-6122",
|
|
35
36
|
"@mdx-js/react": "^3.0.0",
|
|
36
37
|
"clsx": "^2.0.0",
|
|
37
38
|
"copy-text-to-clipboard": "^3.2.0",
|
|
38
|
-
"infima": "0.2.0-alpha.
|
|
39
|
+
"infima": "0.2.0-alpha.45",
|
|
39
40
|
"lodash": "^4.17.21",
|
|
40
41
|
"nprogress": "^0.2.0",
|
|
41
42
|
"postcss": "^8.4.26",
|
|
@@ -61,5 +62,5 @@
|
|
|
61
62
|
"engines": {
|
|
62
63
|
"node": ">=18.0"
|
|
63
64
|
},
|
|
64
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "13455a98d6f59bad263db5629d67cbed578c4250"
|
|
65
66
|
}
|
package/src/index.ts
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import path from 'path';
|
|
9
|
-
import {createRequire} from 'module';
|
|
10
9
|
import rtlcss from 'rtlcss';
|
|
11
10
|
import {readDefaultCodeTranslationMessages} from '@docusaurus/theme-translations';
|
|
12
11
|
import {getTranslationFiles, translateThemeConfig} from './translations';
|
|
@@ -19,14 +18,6 @@ import type {LoadContext, Plugin} from '@docusaurus/types';
|
|
|
19
18
|
import type {ThemeConfig} from '@docusaurus/theme-common';
|
|
20
19
|
import type {Plugin as PostCssPlugin} from 'postcss';
|
|
21
20
|
import type {PluginOptions} from '@docusaurus/theme-classic';
|
|
22
|
-
import type webpack from 'webpack';
|
|
23
|
-
|
|
24
|
-
const requireFromDocusaurusCore = createRequire(
|
|
25
|
-
require.resolve('@docusaurus/core/package.json'),
|
|
26
|
-
);
|
|
27
|
-
const ContextReplacementPlugin = requireFromDocusaurusCore(
|
|
28
|
-
'webpack/lib/ContextReplacementPlugin',
|
|
29
|
-
) as typeof webpack.ContextReplacementPlugin;
|
|
30
21
|
|
|
31
22
|
function getInfimaCSSFile(direction: string) {
|
|
32
23
|
return `infima/dist/css/default/default${
|
|
@@ -89,7 +80,7 @@ export default function themeClassic(
|
|
|
89
80
|
return modules;
|
|
90
81
|
},
|
|
91
82
|
|
|
92
|
-
configureWebpack() {
|
|
83
|
+
configureWebpack(__config, __isServer, {currentBundler}) {
|
|
93
84
|
const prismLanguages = additionalLanguages
|
|
94
85
|
.map((lang) => `prism-${lang}`)
|
|
95
86
|
.join('|');
|
|
@@ -99,7 +90,7 @@ export default function themeClassic(
|
|
|
99
90
|
// This allows better optimization by only bundling those components
|
|
100
91
|
// that the user actually needs, because the modules are dynamically
|
|
101
92
|
// required and can't be known during compile time.
|
|
102
|
-
new ContextReplacementPlugin(
|
|
93
|
+
new currentBundler.instance.ContextReplacementPlugin(
|
|
103
94
|
/prismjs[\\/]components$/,
|
|
104
95
|
new RegExp(`^./(${prismLanguages})$`),
|
|
105
96
|
),
|
|
@@ -83,7 +83,7 @@ export default function BlogAuthor({
|
|
|
83
83
|
<AuthorName name={name} as={as} />
|
|
84
84
|
</MaybeLink>
|
|
85
85
|
)}
|
|
86
|
-
{count && <AuthorBlogPostCount count={count} />}
|
|
86
|
+
{count !== undefined && <AuthorBlogPostCount count={count} />}
|
|
87
87
|
</div>
|
|
88
88
|
{!!title && <AuthorTitle title={title} />}
|
|
89
89
|
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
|
|
46
46
|
.authorTitle {
|
|
47
47
|
font-size: 0.8rem;
|
|
48
|
-
line-height:
|
|
48
|
+
line-height: 1rem;
|
|
49
49
|
display: -webkit-box;
|
|
50
50
|
overflow: hidden;
|
|
51
51
|
line-clamp: 1;
|
|
@@ -55,12 +55,12 @@
|
|
|
55
55
|
|
|
56
56
|
.author-as-h1 .authorTitle {
|
|
57
57
|
font-size: 1.2rem;
|
|
58
|
-
line-height: 1.
|
|
58
|
+
line-height: 1.6rem;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
.author-as-h2 .authorTitle {
|
|
62
62
|
font-size: 1rem;
|
|
63
|
-
line-height:
|
|
63
|
+
line-height: 1.3rem;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
.authorBlogPostCount {
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
useBlogAuthorPageTitle,
|
|
17
17
|
BlogAuthorsListViewAllLabel,
|
|
18
|
+
BlogAuthorNoPostsLabel,
|
|
18
19
|
} from '@docusaurus/theme-common/internal';
|
|
19
20
|
import Link from '@docusaurus/Link';
|
|
20
21
|
import {useBlogMetadata} from '@docusaurus/plugin-content-blog/client';
|
|
@@ -52,9 +53,17 @@ function Content({author, items, sidebar, listMetadata}: Props): JSX.Element {
|
|
|
52
53
|
{author.description && <p>{author.description}</p>}
|
|
53
54
|
<ViewAllAuthorsLink />
|
|
54
55
|
</header>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
{items.length === 0 ? (
|
|
57
|
+
<p>
|
|
58
|
+
<BlogAuthorNoPostsLabel />
|
|
59
|
+
</p>
|
|
60
|
+
) : (
|
|
61
|
+
<>
|
|
62
|
+
<hr />
|
|
63
|
+
<BlogPostItems items={items} />
|
|
64
|
+
<BlogListPaginator metadata={listMetadata} />
|
|
65
|
+
</>
|
|
66
|
+
)}
|
|
58
67
|
</BlogLayout>
|
|
59
68
|
);
|
|
60
69
|
}
|
|
@@ -29,7 +29,7 @@ export default function BlogListPaginator(props: Props): JSX.Element {
|
|
|
29
29
|
<Translate
|
|
30
30
|
id="theme.blog.paginator.newerEntries"
|
|
31
31
|
description="The label used to navigate to the newer blog posts page (previous page)">
|
|
32
|
-
Newer
|
|
32
|
+
Newer entries
|
|
33
33
|
</Translate>
|
|
34
34
|
}
|
|
35
35
|
/>
|
|
@@ -41,7 +41,7 @@ export default function BlogListPaginator(props: Props): JSX.Element {
|
|
|
41
41
|
<Translate
|
|
42
42
|
id="theme.blog.paginator.olderEntries"
|
|
43
43
|
description="The label used to navigate to the older blog posts page (next page)">
|
|
44
|
-
Older
|
|
44
|
+
Older entries
|
|
45
45
|
</Translate>
|
|
46
46
|
}
|
|
47
47
|
isNext
|
|
@@ -28,7 +28,7 @@ export default function BlogPostPaginator(props: Props): JSX.Element {
|
|
|
28
28
|
<Translate
|
|
29
29
|
id="theme.blog.post.paginator.newerPost"
|
|
30
30
|
description="The blog post button label to navigate to the newer/previous post">
|
|
31
|
-
Newer
|
|
31
|
+
Newer post
|
|
32
32
|
</Translate>
|
|
33
33
|
}
|
|
34
34
|
/>
|
|
@@ -40,7 +40,7 @@ export default function BlogPostPaginator(props: Props): JSX.Element {
|
|
|
40
40
|
<Translate
|
|
41
41
|
id="theme.blog.post.paginator.olderPost"
|
|
42
42
|
description="The blog post button label to navigate to the older/next post">
|
|
43
|
-
Older
|
|
43
|
+
Older post
|
|
44
44
|
</Translate>
|
|
45
45
|
}
|
|
46
46
|
isNext
|
|
@@ -59,7 +59,8 @@ function ColorModeToggle({
|
|
|
59
59
|
disabled={!isBrowser}
|
|
60
60
|
title={title}
|
|
61
61
|
aria-label={title}
|
|
62
|
-
aria-live="polite"
|
|
62
|
+
aria-live="polite"
|
|
63
|
+
aria-pressed={value === 'dark' ? 'true' : 'false'}>
|
|
63
64
|
<IconLightMode
|
|
64
65
|
className={clsx(styles.toggleIcon, styles.lightToggleIcon)}
|
|
65
66
|
/>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
/*
|
|
9
9
|
When the navbar is sticky, ensure that on anchor click,
|
|
10
10
|
the browser does not scroll that anchor behind the navbar
|
|
11
|
-
See https://
|
|
11
|
+
See https://x.com/JoshWComeau/status/1332015868725891076
|
|
12
12
|
*/
|
|
13
13
|
.anchorWithStickyNavbar {
|
|
14
14
|
scroll-margin-top: calc(var(--ifm-navbar-height) + 0.5rem);
|