@docusaurus/theme-common 0.0.0-6012 → 0.0.0-6016
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/internal.d.ts +1 -0
- package/lib/internal.d.ts.map +1 -1
- package/lib/internal.js +1 -0
- package/lib/internal.js.map +1 -1
- package/lib/translations/blogTranslations.d.ts +19 -0
- package/lib/translations/blogTranslations.d.ts.map +1 -0
- package/lib/translations/blogTranslations.js +48 -0
- package/lib/translations/blogTranslations.js.map +1 -0
- package/lib/utils/ThemeClassNames.d.ts +2 -0
- package/lib/utils/ThemeClassNames.d.ts.map +1 -1
- package/lib/utils/ThemeClassNames.js +2 -0
- package/lib/utils/ThemeClassNames.js.map +1 -1
- package/package.json +8 -8
- package/src/internal.ts +7 -0
- package/src/translations/blogTranslations.tsx +79 -0
- package/src/utils/ThemeClassNames.ts +2 -0
package/lib/internal.d.ts
CHANGED
|
@@ -31,4 +31,5 @@ export { useLockBodyScroll } from './hooks/useLockBodyScroll';
|
|
|
31
31
|
export { useCodeWordWrap } from './hooks/useCodeWordWrap';
|
|
32
32
|
export { getPrismCssVariables } from './utils/codeBlockUtils';
|
|
33
33
|
export { useBackToTopButton } from './hooks/useBackToTopButton';
|
|
34
|
+
export { useBlogTagsPostsPageTitle, useBlogAuthorPageTitle, translateBlogAuthorsListPageTitle, BlogAuthorsListViewAllLabel, } from './translations/blogTranslations';
|
|
34
35
|
//# sourceMappingURL=internal.d.ts.map
|
package/lib/internal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAaH,cAAc,SAAS,CAAC;AAExB,OAAO,EACL,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAC,OAAO,EAAE,oBAAoB,EAAC,MAAM,mBAAmB,CAAC;AAChE,YAAY,EAA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e,EACf,KAAK,WAAW,GACjB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,EACjB,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAC,gBAAgB,EAAE,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAEjE,OAAO,EAAC,2BAA2B,EAAC,MAAM,uBAAuB,CAAC;AAElE,OAAO,EAAC,gBAAgB,EAAE,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAErE,OAAO,EACL,eAAe,EACf,KAAK,kBAAkB,GACxB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAC,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAC,iBAAiB,EAAC,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EACL,qBAAqB,EACrB,wBAAwB,GACzB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAC,iBAAiB,EAAC,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAC,oBAAoB,EAAC,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAC,kBAAkB,EAAC,MAAM,4BAA4B,CAAC;AAE9D,OAAO,EACL,yBAAyB,EACzB,sBAAsB,EACtB,iCAAiC,EACjC,2BAA2B,GAC5B,MAAM,iCAAiC,CAAC"}
|
package/lib/internal.js
CHANGED
|
@@ -41,4 +41,5 @@ export { useLockBodyScroll } from './hooks/useLockBodyScroll';
|
|
|
41
41
|
export { useCodeWordWrap } from './hooks/useCodeWordWrap';
|
|
42
42
|
export { getPrismCssVariables } from './utils/codeBlockUtils';
|
|
43
43
|
export { useBackToTopButton } from './hooks/useBackToTopButton';
|
|
44
|
+
export { useBlogTagsPostsPageTitle, useBlogAuthorPageTitle, translateBlogAuthorsListPageTitle, BlogAuthorsListViewAllLabel, } from './translations/blogTranslations';
|
|
44
45
|
//# sourceMappingURL=internal.js.map
|
package/lib/internal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,4EAA4E;AAC5E,6EAA6E;AAC7E,2EAA2E;AAC3E,uDAAuD;AACvD,EAAE;AACF,6DAA6D;AAC7D,gFAAgF;AAChF,yEAAyE;AACzE,oDAAoD;AACpD,EAAE;AACF,gDAAgD;AAChD,cAAc,SAAS,CAAC;AAExB,OAAO,EACL,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAC,OAAO,EAAE,oBAAoB,EAAC,MAAM,mBAAmB,CAAC;AAGhE,OAAO,EAAC,sBAAsB,EAAC,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAC,sBAAsB,EAAC,MAAM,wCAAwC,CAAC;AAE9E,OAAO,EAAC,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAC,qBAAqB,EAAC,MAAM,+BAA+B,CAAC;AAEpE,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,UAAU,EACV,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAC,kBAAkB,EAAC,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAC,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAEvD,OAAO,EAAC,iBAAiB,EAAC,MAAM,2BAA2B,CAAC;AAE5D,OAAO,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,0BAA0B,EAC1B,eAAe,GAEhB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,EACjB,wBAAwB,EACxB,iBAAiB,GAClB,MAA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,yBAAyB,EACzB,sBAAsB,EACtB,iCAAiC,EACjC,2BAA2B,GAC5B,MAAM,iCAAiC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
import { type ReactNode } from 'react';
|
|
8
|
+
export declare function useBlogTagsPostsPageTitle(tag: {
|
|
9
|
+
label: string;
|
|
10
|
+
count: number;
|
|
11
|
+
}): string;
|
|
12
|
+
export declare function useBlogAuthorPageTitle(author: {
|
|
13
|
+
key: string;
|
|
14
|
+
name?: string;
|
|
15
|
+
count: number;
|
|
16
|
+
}): string;
|
|
17
|
+
export declare const translateBlogAuthorsListPageTitle: () => string;
|
|
18
|
+
export declare function BlogAuthorsListViewAllLabel(): ReactNode;
|
|
19
|
+
//# sourceMappingURL=blogTranslations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blogTranslations.d.ts","sourceRoot":"","sources":["../../src/translations/blogTranslations.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAc,EAAC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAsB5C,wBAAgB,yBAAyB,CAAC,GAAG,EAAE;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,MAAM,CAUT;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,MAAM,CAaT;AAED,eAAO,MAAM,iCAAiC,QAAO,MAKjD,CAAC;AAEL,wBAAgB,2BAA2B,IAAI,SAAS,CAQvD"}
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
import React from 'react';
|
|
8
|
+
import Translate, { translate } from '@docusaurus/Translate';
|
|
9
|
+
import { usePluralForm } from '../utils/usePluralForm';
|
|
10
|
+
// Only used locally
|
|
11
|
+
function useBlogPostsPlural() {
|
|
12
|
+
const { selectMessage } = usePluralForm();
|
|
13
|
+
return (count) => selectMessage(count, translate({
|
|
14
|
+
id: 'theme.blog.post.plurals',
|
|
15
|
+
description: 'Pluralized label for "{count} posts". Use as much plural forms (separated by "|") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)',
|
|
16
|
+
message: 'One post|{count} posts',
|
|
17
|
+
}, { count }));
|
|
18
|
+
}
|
|
19
|
+
export function useBlogTagsPostsPageTitle(tag) {
|
|
20
|
+
const blogPostsPlural = useBlogPostsPlural();
|
|
21
|
+
return translate({
|
|
22
|
+
id: 'theme.blog.tagTitle',
|
|
23
|
+
description: 'The title of the page for a blog tag',
|
|
24
|
+
message: '{nPosts} tagged with "{tagName}"',
|
|
25
|
+
}, { nPosts: blogPostsPlural(tag.count), tagName: tag.label });
|
|
26
|
+
}
|
|
27
|
+
export function useBlogAuthorPageTitle(author) {
|
|
28
|
+
const blogPostsPlural = useBlogPostsPlural();
|
|
29
|
+
return translate({
|
|
30
|
+
id: 'theme.blog.author.pageTitle',
|
|
31
|
+
description: 'The title of the page for a blog author',
|
|
32
|
+
message: '{authorName} - {nPosts}',
|
|
33
|
+
}, {
|
|
34
|
+
nPosts: blogPostsPlural(author.count),
|
|
35
|
+
authorName: author.name || author.key,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
export const translateBlogAuthorsListPageTitle = () => translate({
|
|
39
|
+
id: 'theme.blog.authorsList.pageTitle',
|
|
40
|
+
message: 'Authors',
|
|
41
|
+
description: 'The title of the authors page',
|
|
42
|
+
});
|
|
43
|
+
export function BlogAuthorsListViewAllLabel() {
|
|
44
|
+
return (<Translate id="theme.blog.authorsList.viewAll" description="The label of the link targeting the blog authors page">
|
|
45
|
+
View All Authors
|
|
46
|
+
</Translate>);
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=blogTranslations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blogTranslations.js","sourceRoot":"","sources":["../../src/translations/blogTranslations.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAuB,MAAM,OAAO,CAAC;AAC5C,OAAO,SAAS,EAAE,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAC,aAAa,EAAC,MAAM,wBAAwB,CAAC;AAErD,oBAAoB;AACpB,SAAS,kBAAkB;IACzB,MAAM,EAAC,aAAa,EAAC,GAAG,aAAa,EAAE,CAAC;IACxC,OAAO,CAAC,KAAa,EAAE,EAAE,CACvB,aAAa,CACX,KAAK,EACL,SAAS,CACP;QACE,EAAE,EAAE,yBAAyB;QAC7B,WAAW,EACT,0MAA0M;QAC5M,OAAO,EAAE,wBAAwB;KAClC,EACD,EAAC,KAAK,EAAC,CACR,CACF,CAAC;AACN,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,GAGzC;IACC,MAAM,eAAe,GAAG,kBAAkB,EAAE,CAAC;IAC7C,OAAO,SAAS,CACd;QACE,EAAE,EAAE,qBAAqB;QACzB,WAAW,EAAE,sCAAsC;QACnD,OAAO,EAAE,kCAAkC;KAC5C,EACD,EAAC,MAAM,EAAE,eAAe,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,KAAK,EAAC,CACzD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,MAItC;IACC,MAAM,eAAe,GAAG,kBAAkB,EAAE,CAAC;IAC7C,OAAO,SAAS,CACd;QACE,EAAE,EAAE,6BAA6B;QACjC,WAAW,EAAE,yCAAyC;QACtD,OAAO,EAAE,yBAAyB;KACnC,EACD;QACE,MAAM,EAAE,eAAe,CAAC,MAAM,CAAC,KAAK,CAAC;QACrC,UAAU,EAAE,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,GAAG;KACtC,CACF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,iCAAiC,GAAG,GAAW,EAAE,CAC5D,SAAS,CAAC;IACR,EAAE,EAAE,kCAAkC;IACtC,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,+BAA+B;CAC7C,CAAC,CAAC;AAEL,MAAM,UAAU,2BAA2B;IACzC,OAAO,CACL,CAAC,SAAS,CACR,EAAE,CAAC,gCAAgC,CACnC,WAAW,CAAC,uDAAuD,CACnE;;IACF,EAAE,SAAS,CAAC,CACb,CAAC;AACJ,CAAC"}
|
|
@@ -14,6 +14,8 @@ export declare const ThemeClassNames: {
|
|
|
14
14
|
readonly blogPostPage: "blog-post-page";
|
|
15
15
|
readonly blogTagsListPage: "blog-tags-list-page";
|
|
16
16
|
readonly blogTagPostListPage: "blog-tags-post-list-page";
|
|
17
|
+
readonly blogAuthorsListPage: "blog-authors-list-page";
|
|
18
|
+
readonly blogAuthorsPostsPage: "blog-authors-posts-page";
|
|
17
19
|
readonly docsDocPage: "docs-doc-page";
|
|
18
20
|
readonly docsTagsListPage: "docs-tags-list-page";
|
|
19
21
|
readonly docsTagDocListPage: "docs-tags-doc-list-page";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeClassNames.d.ts","sourceRoot":"","sources":["../../src/utils/ThemeClassNames.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH;;;GAGG;AACH,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"ThemeClassNames.d.ts","sourceRoot":"","sources":["../../src/utils/ThemeClassNames.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;wCAgCD,MAAM;;;IAM/B;;OAEG;;;;;;;;;;;;;;;sDAeoC,MAAM;kDAEV,MAAM;;;;;;;;;CAYjC,CAAC"}
|
|
@@ -16,6 +16,8 @@ export const ThemeClassNames = {
|
|
|
16
16
|
blogPostPage: 'blog-post-page',
|
|
17
17
|
blogTagsListPage: 'blog-tags-list-page',
|
|
18
18
|
blogTagPostListPage: 'blog-tags-post-list-page',
|
|
19
|
+
blogAuthorsListPage: 'blog-authors-list-page',
|
|
20
|
+
blogAuthorsPostsPage: 'blog-authors-posts-page',
|
|
19
21
|
docsDocPage: 'docs-doc-page',
|
|
20
22
|
docsTagsListPage: 'docs-tags-list-page',
|
|
21
23
|
docsTagDocListPage: 'docs-tags-doc-list-page',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeClassNames.js","sourceRoot":"","sources":["../../src/utils/ThemeClassNames.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,+EAA+E;AAC/E,aAAa;AAEb;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE;QACJ,YAAY,EAAE,gBAAgB;QAC9B,YAAY,EAAE,gBAAgB;QAC9B,gBAAgB,EAAE,qBAAqB;QACvC,mBAAmB,EAAE,0BAA0B;QAE/C,WAAW,EAAE,eAAe;QAC5B,gBAAgB,EAAE,qBAAqB;QACvC,kBAAkB,EAAE,yBAAyB;QAE7C,OAAO,EAAE,UAAU;KACpB;IACD,OAAO,EAAE;QACP,IAAI,EAAE,cAAc;QACpB,uDAAuD;QACvD,uCAAuC;QACvC,+DAA+D;QAC/D,SAAS,EAAE,cAAc;QACzB,SAAS,EAAE,cAAc;QACzB,QAAQ,EAAE,aAAa;KACxB;IACD,MAAM,EAAE;QACN,YAAY,EAAE,sBAAsB;QACpC,WAAW,EAAE,oBAAoB;QACjC,eAAe,EAAE,0BAA0B;QAC3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,4BAA4B;QAC/C,qBAAqB,EAAE,iCAAiC;KACzD;IACD,KAAK,EAAE;QACL,qBAAqB,EAAE,kCAAkC;KAC1D;CACO,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/theme-common",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-6016",
|
|
4
4
|
"description": "Common code for Docusaurus themes.",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -30,10 +30,10 @@
|
|
|
30
30
|
},
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@docusaurus/mdx-loader": "0.0.0-
|
|
34
|
-
"@docusaurus/module-type-aliases": "0.0.0-
|
|
35
|
-
"@docusaurus/utils": "0.0.0-
|
|
36
|
-
"@docusaurus/utils-common": "0.0.0-
|
|
33
|
+
"@docusaurus/mdx-loader": "0.0.0-6016",
|
|
34
|
+
"@docusaurus/module-type-aliases": "0.0.0-6016",
|
|
35
|
+
"@docusaurus/utils": "0.0.0-6016",
|
|
36
|
+
"@docusaurus/utils-common": "0.0.0-6016",
|
|
37
37
|
"@types/history": "^4.7.11",
|
|
38
38
|
"@types/react": "*",
|
|
39
39
|
"@types/react-router-config": "*",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"utility-types": "^3.10.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@docusaurus/core": "0.0.0-
|
|
48
|
-
"@docusaurus/types": "0.0.0-
|
|
47
|
+
"@docusaurus/core": "0.0.0-6016",
|
|
48
|
+
"@docusaurus/types": "0.0.0-6016",
|
|
49
49
|
"fs-extra": "^11.1.1",
|
|
50
50
|
"lodash": "^4.17.21",
|
|
51
51
|
"schema-dts": "^1.1.2"
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": ">=18.0"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "c51435db0c58b94667da1c745f1635de65240c63"
|
|
62
62
|
}
|
package/src/internal.ts
CHANGED
|
@@ -90,3 +90,10 @@ export {useLockBodyScroll} from './hooks/useLockBodyScroll';
|
|
|
90
90
|
export {useCodeWordWrap} from './hooks/useCodeWordWrap';
|
|
91
91
|
export {getPrismCssVariables} from './utils/codeBlockUtils';
|
|
92
92
|
export {useBackToTopButton} from './hooks/useBackToTopButton';
|
|
93
|
+
|
|
94
|
+
export {
|
|
95
|
+
useBlogTagsPostsPageTitle,
|
|
96
|
+
useBlogAuthorPageTitle,
|
|
97
|
+
translateBlogAuthorsListPageTitle,
|
|
98
|
+
BlogAuthorsListViewAllLabel,
|
|
99
|
+
} from './translations/blogTranslations';
|
|
@@ -0,0 +1,79 @@
|
|
|
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 React, {type ReactNode} from 'react';
|
|
9
|
+
import Translate, {translate} from '@docusaurus/Translate';
|
|
10
|
+
import {usePluralForm} from '../utils/usePluralForm';
|
|
11
|
+
|
|
12
|
+
// Only used locally
|
|
13
|
+
function useBlogPostsPlural(): (count: number) => string {
|
|
14
|
+
const {selectMessage} = usePluralForm();
|
|
15
|
+
return (count: number) =>
|
|
16
|
+
selectMessage(
|
|
17
|
+
count,
|
|
18
|
+
translate(
|
|
19
|
+
{
|
|
20
|
+
id: 'theme.blog.post.plurals',
|
|
21
|
+
description:
|
|
22
|
+
'Pluralized label for "{count} posts". Use as much plural forms (separated by "|") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)',
|
|
23
|
+
message: 'One post|{count} posts',
|
|
24
|
+
},
|
|
25
|
+
{count},
|
|
26
|
+
),
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function useBlogTagsPostsPageTitle(tag: {
|
|
31
|
+
label: string;
|
|
32
|
+
count: number;
|
|
33
|
+
}): string {
|
|
34
|
+
const blogPostsPlural = useBlogPostsPlural();
|
|
35
|
+
return translate(
|
|
36
|
+
{
|
|
37
|
+
id: 'theme.blog.tagTitle',
|
|
38
|
+
description: 'The title of the page for a blog tag',
|
|
39
|
+
message: '{nPosts} tagged with "{tagName}"',
|
|
40
|
+
},
|
|
41
|
+
{nPosts: blogPostsPlural(tag.count), tagName: tag.label},
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function useBlogAuthorPageTitle(author: {
|
|
46
|
+
key: string;
|
|
47
|
+
name?: string;
|
|
48
|
+
count: number;
|
|
49
|
+
}): string {
|
|
50
|
+
const blogPostsPlural = useBlogPostsPlural();
|
|
51
|
+
return translate(
|
|
52
|
+
{
|
|
53
|
+
id: 'theme.blog.author.pageTitle',
|
|
54
|
+
description: 'The title of the page for a blog author',
|
|
55
|
+
message: '{authorName} - {nPosts}',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
nPosts: blogPostsPlural(author.count),
|
|
59
|
+
authorName: author.name || author.key,
|
|
60
|
+
},
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export const translateBlogAuthorsListPageTitle = (): string =>
|
|
65
|
+
translate({
|
|
66
|
+
id: 'theme.blog.authorsList.pageTitle',
|
|
67
|
+
message: 'Authors',
|
|
68
|
+
description: 'The title of the authors page',
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
export function BlogAuthorsListViewAllLabel(): ReactNode {
|
|
72
|
+
return (
|
|
73
|
+
<Translate
|
|
74
|
+
id="theme.blog.authorsList.viewAll"
|
|
75
|
+
description="The label of the link targeting the blog authors page">
|
|
76
|
+
View All Authors
|
|
77
|
+
</Translate>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
@@ -18,6 +18,8 @@ export const ThemeClassNames = {
|
|
|
18
18
|
blogPostPage: 'blog-post-page',
|
|
19
19
|
blogTagsListPage: 'blog-tags-list-page',
|
|
20
20
|
blogTagPostListPage: 'blog-tags-post-list-page',
|
|
21
|
+
blogAuthorsListPage: 'blog-authors-list-page',
|
|
22
|
+
blogAuthorsPostsPage: 'blog-authors-posts-page',
|
|
21
23
|
|
|
22
24
|
docsDocPage: 'docs-doc-page',
|
|
23
25
|
docsTagsListPage: 'docs-tags-list-page',
|