@docusaurus/theme-classic 3.1.1 → 3.2.1
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/BlogArchivePage/index.js +9 -1
- package/lib/theme/BlogLayout/index.js +1 -3
- package/lib/theme/BlogListPage/StructuredData/index.d.ts +10 -0
- package/lib/theme/BlogListPage/StructuredData/index.js +19 -0
- package/lib/theme/BlogListPage/index.js +2 -0
- package/lib/theme/BlogPostItem/Container/index.js +1 -26
- package/lib/theme/BlogPostItem/Content/index.js +1 -2
- package/lib/theme/BlogPostItem/Footer/index.js +61 -31
- package/lib/theme/BlogPostItem/Header/Author/index.js +5 -18
- package/lib/theme/BlogPostItem/Header/Info/index.js +15 -9
- package/lib/theme/BlogPostItem/Header/Title/index.js +2 -8
- package/lib/theme/{BlogPostItem/Footer/styles.module.css → BlogPostPage/StructuredData/index.d.ts} +2 -4
- package/lib/theme/BlogPostPage/StructuredData/index.js +19 -0
- package/lib/theme/BlogPostPage/index.js +3 -0
- package/lib/theme/DocCard/index.js +19 -12
- package/lib/theme/DocItem/Footer/index.js +17 -42
- package/lib/theme/DocSidebarItem/Category/index.js +3 -1
- package/lib/theme/EditMetaRow/index.d.ts +3 -0
- package/lib/theme/EditMetaRow/index.js +31 -0
- package/lib/theme/LastUpdated/index.d.ts +1 -1
- package/lib/theme/LastUpdated/index.js +17 -16
- package/package.json +14 -14
- package/src/theme/BlogArchivePage/index.tsx +11 -1
- package/src/theme/BlogLayout/index.tsx +1 -3
- package/src/theme/BlogListPage/StructuredData/index.tsx +22 -0
- package/src/theme/BlogListPage/index.tsx +2 -0
- package/src/theme/BlogPostItem/Container/index.tsx +1 -26
- package/src/theme/BlogPostItem/Content/index.tsx +1 -2
- package/src/theme/BlogPostItem/Footer/index.tsx +62 -32
- package/src/theme/BlogPostItem/Header/Author/index.tsx +5 -18
- package/src/theme/BlogPostItem/Header/Info/index.tsx +24 -9
- package/src/theme/BlogPostItem/Header/Title/index.tsx +2 -8
- package/src/theme/BlogPostPage/StructuredData/index.tsx +21 -0
- package/src/theme/BlogPostPage/index.tsx +3 -0
- package/src/theme/DocCard/index.tsx +20 -12
- package/src/theme/DocItem/Footer/index.tsx +19 -52
- package/src/theme/DocSidebarItem/Category/index.tsx +3 -1
- package/src/theme/EditMetaRow/index.tsx +34 -0
- package/src/theme/LastUpdated/index.tsx +18 -13
- package/src/theme-classic.d.ts +10 -1
- package/src/theme/BlogPostItem/Footer/styles.module.css +0 -10
- package/lib/theme/{DocItem/Footer → EditMetaRow}/styles.module.css +2 -2
- package/src/theme/{DocItem/Footer → EditMetaRow}/styles.module.css +2 -2
|
@@ -8,15 +8,25 @@
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import Translate from '@docusaurus/Translate';
|
|
10
10
|
import {ThemeClassNames} from '@docusaurus/theme-common';
|
|
11
|
+
import {useDateTimeFormat} from '@docusaurus/theme-common/internal';
|
|
11
12
|
import type {Props} from '@theme/LastUpdated';
|
|
12
13
|
|
|
13
14
|
function LastUpdatedAtDate({
|
|
14
15
|
lastUpdatedAt,
|
|
15
|
-
formattedLastUpdatedAt,
|
|
16
16
|
}: {
|
|
17
17
|
lastUpdatedAt: number;
|
|
18
|
-
formattedLastUpdatedAt: string;
|
|
19
18
|
}): JSX.Element {
|
|
19
|
+
const atDate = new Date(lastUpdatedAt);
|
|
20
|
+
|
|
21
|
+
const dateTimeFormat = useDateTimeFormat({
|
|
22
|
+
day: 'numeric',
|
|
23
|
+
month: 'short',
|
|
24
|
+
year: 'numeric',
|
|
25
|
+
timeZone: 'UTC',
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const formattedLastUpdatedAt = dateTimeFormat.format(atDate);
|
|
29
|
+
|
|
20
30
|
return (
|
|
21
31
|
<Translate
|
|
22
32
|
id="theme.lastUpdated.atDate"
|
|
@@ -24,7 +34,7 @@ function LastUpdatedAtDate({
|
|
|
24
34
|
values={{
|
|
25
35
|
date: (
|
|
26
36
|
<b>
|
|
27
|
-
<time dateTime={
|
|
37
|
+
<time dateTime={atDate.toISOString()} itemProp="dateModified">
|
|
28
38
|
{formattedLastUpdatedAt}
|
|
29
39
|
</time>
|
|
30
40
|
</b>
|
|
@@ -54,7 +64,6 @@ function LastUpdatedByUser({
|
|
|
54
64
|
|
|
55
65
|
export default function LastUpdated({
|
|
56
66
|
lastUpdatedAt,
|
|
57
|
-
formattedLastUpdatedAt,
|
|
58
67
|
lastUpdatedBy,
|
|
59
68
|
}: Props): JSX.Element {
|
|
60
69
|
return (
|
|
@@ -63,15 +72,11 @@ export default function LastUpdated({
|
|
|
63
72
|
id="theme.lastUpdated.lastUpdatedAtBy"
|
|
64
73
|
description="The sentence used to display when a page has been last updated, and by who"
|
|
65
74
|
values={{
|
|
66
|
-
atDate:
|
|
67
|
-
lastUpdatedAt
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
/>
|
|
72
|
-
) : (
|
|
73
|
-
''
|
|
74
|
-
),
|
|
75
|
+
atDate: lastUpdatedAt ? (
|
|
76
|
+
<LastUpdatedAtDate lastUpdatedAt={lastUpdatedAt} />
|
|
77
|
+
) : (
|
|
78
|
+
''
|
|
79
|
+
),
|
|
75
80
|
byUser: lastUpdatedBy ? (
|
|
76
81
|
<LastUpdatedByUser lastUpdatedBy={lastUpdatedBy} />
|
|
77
82
|
) : (
|
package/src/theme-classic.d.ts
CHANGED
|
@@ -676,6 +676,16 @@ declare module '@theme/DocVersionSuggestions' {
|
|
|
676
676
|
export default function DocVersionSuggestions(): JSX.Element;
|
|
677
677
|
}
|
|
678
678
|
|
|
679
|
+
declare module '@theme/EditMetaRow' {
|
|
680
|
+
export interface Props {
|
|
681
|
+
readonly className: string;
|
|
682
|
+
readonly editUrl: string | null | undefined;
|
|
683
|
+
readonly lastUpdatedAt: number | undefined;
|
|
684
|
+
readonly lastUpdatedBy: string | undefined;
|
|
685
|
+
}
|
|
686
|
+
export default function EditMetaRow(props: Props): JSX.Element;
|
|
687
|
+
}
|
|
688
|
+
|
|
679
689
|
declare module '@theme/EditThisPage' {
|
|
680
690
|
export interface Props {
|
|
681
691
|
readonly editUrl: string;
|
|
@@ -824,7 +834,6 @@ declare module '@theme/SearchMetadata' {
|
|
|
824
834
|
declare module '@theme/LastUpdated' {
|
|
825
835
|
export interface Props {
|
|
826
836
|
readonly lastUpdatedAt?: number;
|
|
827
|
-
readonly formattedLastUpdatedAt?: string;
|
|
828
837
|
readonly lastUpdatedBy?: string;
|
|
829
838
|
}
|
|
830
839
|
|