@docusaurus/theme-classic 0.0.0-4736 → 0.0.0-4739
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/theme-classic.d.ts +5 -33
- package/lib-next/theme/BlogArchivePage/index.js +13 -9
- package/lib-next/theme/BlogListPage/index.js +34 -13
- package/lib-next/theme/BlogPostPage/index.js +56 -45
- package/lib-next/theme/BlogTagsListPage/index.js +16 -12
- package/lib-next/theme/BlogTagsPostsPage/index.js +40 -33
- package/lib-next/theme/DocCategoryGeneratedIndexPage/index.js +27 -6
- package/lib-next/theme/DocItem/index.js +78 -63
- package/lib-next/theme/DocPage/index.js +85 -77
- package/lib-next/theme/DocPage/styles.module.css +0 -4
- package/lib-next/theme/DocTagDocListPage/index.js +38 -31
- package/lib-next/theme/DocTagsListPage/index.js +21 -16
- package/lib-next/theme/Layout/index.js +15 -10
- package/lib-next/theme/MDXPage/index.js +32 -26
- package/lib-next/theme/NotFound.js +38 -33
- package/lib-next/theme/{LayoutHead → SiteMetadata}/index.js +11 -26
- package/package.json +13 -13
- package/src/theme/BlogArchivePage/index.tsx +13 -9
- package/src/theme/BlogListPage/index.tsx +32 -13
- package/src/theme/BlogPostPage/index.tsx +55 -48
- package/src/theme/BlogTagsListPage/index.tsx +16 -12
- package/src/theme/BlogTagsPostsPage/index.tsx +39 -32
- package/src/theme/DocCategoryGeneratedIndexPage/index.tsx +31 -4
- package/src/theme/DocItem/index.tsx +65 -52
- package/src/theme/DocPage/index.tsx +85 -77
- package/src/theme/DocPage/styles.module.css +0 -4
- package/src/theme/DocTagDocListPage/index.tsx +38 -30
- package/src/theme/DocTagsListPage/index.tsx +21 -16
- package/src/theme/Layout/index.tsx +15 -10
- package/src/theme/MDXPage/index.tsx +32 -26
- package/src/theme/NotFound.tsx +38 -33
- package/src/theme/{LayoutHead → SiteMetadata}/index.tsx +11 -25
- package/src/theme-classic.d.ts +5 -33
- package/lib-next/theme/Seo/index.js +0 -40
- package/src/theme/Seo/index.tsx +0 -49
package/src/theme-classic.d.ts
CHANGED
|
@@ -364,31 +364,17 @@ declare module '@theme/Layout' {
|
|
|
364
364
|
|
|
365
365
|
export interface Props {
|
|
366
366
|
readonly children?: ReactNode;
|
|
367
|
-
readonly title?: string;
|
|
368
367
|
readonly noFooter?: boolean;
|
|
369
|
-
readonly description?: string;
|
|
370
|
-
readonly image?: string;
|
|
371
|
-
readonly keywords?: string | string[];
|
|
372
|
-
readonly permalink?: string;
|
|
373
368
|
readonly wrapperClassName?: string;
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
};
|
|
369
|
+
|
|
370
|
+
// Not really layout-related, but kept for convenience/retro-compatibility
|
|
371
|
+
readonly title?: string;
|
|
372
|
+
readonly description?: string;
|
|
379
373
|
}
|
|
380
374
|
|
|
381
375
|
export default function Layout(props: Props): JSX.Element;
|
|
382
376
|
}
|
|
383
377
|
|
|
384
|
-
declare module '@theme/LayoutHead' {
|
|
385
|
-
import type {Props as LayoutProps} from '@theme/Layout';
|
|
386
|
-
|
|
387
|
-
export interface Props extends Omit<LayoutProps, 'children'> {}
|
|
388
|
-
|
|
389
|
-
export default function LayoutHead(props: Props): JSX.Element;
|
|
390
|
-
}
|
|
391
|
-
|
|
392
378
|
declare module '@theme/LayoutProviders' {
|
|
393
379
|
import type {ReactNode} from 'react';
|
|
394
380
|
|
|
@@ -480,7 +466,7 @@ declare module '@theme/Navbar/Content' {
|
|
|
480
466
|
|
|
481
467
|
declare module '@theme/Navbar/Layout' {
|
|
482
468
|
export interface Props {
|
|
483
|
-
children: React.ReactNode;
|
|
469
|
+
readonly children: React.ReactNode;
|
|
484
470
|
}
|
|
485
471
|
|
|
486
472
|
export default function NavbarLayout(props: Props): JSX.Element;
|
|
@@ -927,17 +913,3 @@ declare module '@theme/prism-include-languages' {
|
|
|
927
913
|
PrismObject: typeof PrismNamespace,
|
|
928
914
|
): void;
|
|
929
915
|
}
|
|
930
|
-
|
|
931
|
-
declare module '@theme/Seo' {
|
|
932
|
-
import type {ReactNode} from 'react';
|
|
933
|
-
|
|
934
|
-
export interface Props {
|
|
935
|
-
readonly title?: string;
|
|
936
|
-
readonly description?: string;
|
|
937
|
-
readonly keywords?: readonly string[] | string;
|
|
938
|
-
readonly image?: string;
|
|
939
|
-
readonly children?: ReactNode;
|
|
940
|
-
}
|
|
941
|
-
|
|
942
|
-
export default function Seo(props: Props): JSX.Element;
|
|
943
|
-
}
|
|
@@ -1,40 +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
|
-
import React from 'react';
|
|
8
|
-
import Head from '@docusaurus/Head';
|
|
9
|
-
import {useTitleFormatter} from '@docusaurus/theme-common';
|
|
10
|
-
import {useBaseUrlUtils} from '@docusaurus/useBaseUrl';
|
|
11
|
-
export default function Seo({title, description, keywords, image, children}) {
|
|
12
|
-
const pageTitle = useTitleFormatter(title);
|
|
13
|
-
const {withBaseUrl} = useBaseUrlUtils();
|
|
14
|
-
const pageImage = image
|
|
15
|
-
? withBaseUrl(image, {
|
|
16
|
-
absolute: true,
|
|
17
|
-
})
|
|
18
|
-
: undefined;
|
|
19
|
-
return (
|
|
20
|
-
<Head>
|
|
21
|
-
{title && <title>{pageTitle}</title>}
|
|
22
|
-
{title && <meta property="og:title" content={pageTitle} />}
|
|
23
|
-
|
|
24
|
-
{description && <meta name="description" content={description} />}
|
|
25
|
-
{description && <meta property="og:description" content={description} />}
|
|
26
|
-
|
|
27
|
-
{keywords && (
|
|
28
|
-
<meta
|
|
29
|
-
name="keywords"
|
|
30
|
-
content={Array.isArray(keywords) ? keywords.join(',') : keywords}
|
|
31
|
-
/>
|
|
32
|
-
)}
|
|
33
|
-
|
|
34
|
-
{pageImage && <meta property="og:image" content={pageImage} />}
|
|
35
|
-
{pageImage && <meta name="twitter:image" content={pageImage} />}
|
|
36
|
-
|
|
37
|
-
{children}
|
|
38
|
-
</Head>
|
|
39
|
-
);
|
|
40
|
-
}
|
package/src/theme/Seo/index.tsx
DELETED
|
@@ -1,49 +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 React from 'react';
|
|
9
|
-
import Head from '@docusaurus/Head';
|
|
10
|
-
import {useTitleFormatter} from '@docusaurus/theme-common';
|
|
11
|
-
import {useBaseUrlUtils} from '@docusaurus/useBaseUrl';
|
|
12
|
-
|
|
13
|
-
import type {Props} from '@theme/Seo';
|
|
14
|
-
|
|
15
|
-
export default function Seo({
|
|
16
|
-
title,
|
|
17
|
-
description,
|
|
18
|
-
keywords,
|
|
19
|
-
image,
|
|
20
|
-
children,
|
|
21
|
-
}: Props): JSX.Element {
|
|
22
|
-
const pageTitle = useTitleFormatter(title);
|
|
23
|
-
const {withBaseUrl} = useBaseUrlUtils();
|
|
24
|
-
const pageImage = image ? withBaseUrl(image, {absolute: true}) : undefined;
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<Head>
|
|
28
|
-
{title && <title>{pageTitle}</title>}
|
|
29
|
-
{title && <meta property="og:title" content={pageTitle} />}
|
|
30
|
-
|
|
31
|
-
{description && <meta name="description" content={description} />}
|
|
32
|
-
{description && <meta property="og:description" content={description} />}
|
|
33
|
-
|
|
34
|
-
{keywords && (
|
|
35
|
-
<meta
|
|
36
|
-
name="keywords"
|
|
37
|
-
content={
|
|
38
|
-
(Array.isArray(keywords) ? keywords.join(',') : keywords) as string
|
|
39
|
-
}
|
|
40
|
-
/>
|
|
41
|
-
)}
|
|
42
|
-
|
|
43
|
-
{pageImage && <meta property="og:image" content={pageImage} />}
|
|
44
|
-
{pageImage && <meta name="twitter:image" content={pageImage} />}
|
|
45
|
-
|
|
46
|
-
{children}
|
|
47
|
-
</Head>
|
|
48
|
-
);
|
|
49
|
-
}
|