@docusaurus/theme-classic 0.0.0-5454 → 0.0.0-5456

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.
@@ -9,10 +9,13 @@ import Link from '@docusaurus/Link';
9
9
  import {translate} from '@docusaurus/Translate';
10
10
  import {PageMetadata} from '@docusaurus/theme-common';
11
11
  import Layout from '@theme/Layout';
12
+ import Heading from '@theme/Heading';
12
13
  function Year({year, posts}) {
13
14
  return (
14
15
  <>
15
- <h3>{year}</h3>
16
+ <Heading as="h3" id={year}>
17
+ {year}
18
+ </Heading>
16
19
  <ul>
17
20
  {posts.map((post) => (
18
21
  <li key={post.metadata.date}>
@@ -69,7 +72,9 @@ export default function BlogArchive({archive}) {
69
72
  <Layout>
70
73
  <header className="hero hero--primary">
71
74
  <div className="container">
72
- <h1 className="hero__title">{title}</h1>
75
+ <Heading as="h1" className="hero__title">
76
+ {title}
77
+ </Heading>
73
78
  <p className="hero__subtitle">{description}</p>
74
79
  </div>
75
80
  </header>
@@ -15,6 +15,7 @@ import {
15
15
  import BlogLayout from '@theme/BlogLayout';
16
16
  import TagsListByLetter from '@theme/TagsListByLetter';
17
17
  import SearchMetadata from '@theme/SearchMetadata';
18
+ import Heading from '@theme/Heading';
18
19
  export default function BlogTagsListPage({tags, sidebar}) {
19
20
  const title = translateTagsPageTitle();
20
21
  return (
@@ -26,7 +27,7 @@ export default function BlogTagsListPage({tags, sidebar}) {
26
27
  <PageMetadata title={title} />
27
28
  <SearchMetadata tag="blog_tags_list" />
28
29
  <BlogLayout sidebar={sidebar}>
29
- <h1>{title}</h1>
30
+ <Heading as="h1">{title}</Heading>
30
31
  <TagsListByLetter tags={tags} />
31
32
  </BlogLayout>
32
33
  </HtmlClassNameProvider>
@@ -19,6 +19,7 @@ import BlogListPaginator from '@theme/BlogListPaginator';
19
19
  import SearchMetadata from '@theme/SearchMetadata';
20
20
  import BlogPostItems from '@theme/BlogPostItems';
21
21
  import Unlisted from '@theme/Unlisted';
22
+ import Heading from '@theme/Heading';
22
23
  // Very simple pluralization: probably good enough for now
23
24
  function useBlogPostsPlural() {
24
25
  const {selectMessage} = usePluralForm();
@@ -62,7 +63,7 @@ function BlogTagsPostsPageContent({tag, items, sidebar, listMetadata}) {
62
63
  <BlogLayout sidebar={sidebar}>
63
64
  {tag.unlisted && <Unlisted />}
64
65
  <header className="margin-bottom--xl">
65
- <h1>{title}</h1>
66
+ <Heading as="h1">{title}</Heading>
66
67
  <Link href={tag.allTagsPath}>
67
68
  <Translate
68
69
  id="theme.tags.tagsPageLink"
@@ -13,6 +13,7 @@ import {
13
13
  } from '@docusaurus/theme-common/internal';
14
14
  import isInternalUrl from '@docusaurus/isInternalUrl';
15
15
  import {translate} from '@docusaurus/Translate';
16
+ import Heading from '@theme/Heading';
16
17
  import styles from './styles.module.css';
17
18
  function CardContainer({href, children}) {
18
19
  return (
@@ -26,9 +27,12 @@ function CardContainer({href, children}) {
26
27
  function CardLayout({href, icon, title, description}) {
27
28
  return (
28
29
  <CardContainer href={href}>
29
- <h2 className={clsx('text--truncate', styles.cardTitle)} title={title}>
30
+ <Heading
31
+ as="h2"
32
+ className={clsx('text--truncate', styles.cardTitle)}
33
+ title={title}>
30
34
  {icon} {title}
31
- </h2>
35
+ </Heading>
32
36
  {description && (
33
37
  <p
34
38
  className={clsx('text--truncate', styles.cardDescription)}
@@ -16,6 +16,7 @@ import {
16
16
  import Translate, {translate} from '@docusaurus/Translate';
17
17
  import SearchMetadata from '@theme/SearchMetadata';
18
18
  import Unlisted from '@theme/Unlisted';
19
+ import Heading from '@theme/Heading';
19
20
  // Very simple pluralization: probably good enough for now
20
21
  function useNDocsTaggedPlural() {
21
22
  const {selectMessage} = usePluralForm();
@@ -48,7 +49,7 @@ function DocItem({doc}) {
48
49
  return (
49
50
  <article className="margin-vert--lg">
50
51
  <Link to={doc.permalink}>
51
- <h2>{doc.title}</h2>
52
+ <Heading as="h2">{doc.title}</Heading>
52
53
  </Link>
53
54
  {doc.description && <p>{doc.description}</p>}
54
55
  </article>
@@ -71,7 +72,7 @@ function DocTagDocListPageContent({tag, title}) {
71
72
  <main className="col col--8 col--offset-2">
72
73
  {tag.unlisted && <Unlisted />}
73
74
  <header className="margin-bottom--xl">
74
- <h1>{title}</h1>
75
+ <Heading as="h1">{title}</Heading>
75
76
  <Link href={tag.allTagsPath}>
76
77
  <Translate
77
78
  id="theme.tags.tagsPageLink"
@@ -14,6 +14,7 @@ import {
14
14
  } from '@docusaurus/theme-common';
15
15
  import TagsListByLetter from '@theme/TagsListByLetter';
16
16
  import SearchMetadata from '@theme/SearchMetadata';
17
+ import Heading from '@theme/Heading';
17
18
  function DocTagsListPageMetadata({title}) {
18
19
  return (
19
20
  <>
@@ -29,7 +30,7 @@ function DocTagsListPageContent({tags, title}) {
29
30
  <div className="container margin-vert--lg">
30
31
  <div className="row">
31
32
  <main className="col col--8 col--offset-2">
32
- <h1>{title}</h1>
33
+ <Heading as="h1">{title}</Heading>
33
34
  <TagsListByLetter tags={tags} />
34
35
  </main>
35
36
  </div>
@@ -7,18 +7,19 @@
7
7
  import React from 'react';
8
8
  import Translate from '@docusaurus/Translate';
9
9
  import {ErrorBoundaryTryAgainButton} from '@docusaurus/theme-common';
10
+ import Heading from '@theme/Heading';
10
11
  export default function ErrorPageContent({error, tryAgain}) {
11
12
  return (
12
13
  <main className="container margin-vert--xl">
13
14
  <div className="row">
14
15
  <div className="col col--6 col--offset-3">
15
- <h1 className="hero__title">
16
+ <Heading as="h1" className="hero__title">
16
17
  <Translate
17
18
  id="theme.ErrorPageContent.title"
18
19
  description="The title of the fallback page when the page crashed">
19
20
  This page crashed.
20
21
  </Translate>
21
- </h1>
22
+ </Heading>
22
23
  <p>{error.message}</p>
23
24
  <div>
24
25
  <ErrorBoundaryTryAgainButton onClick={tryAgain} />
@@ -7,18 +7,19 @@
7
7
  import React from 'react';
8
8
  import clsx from 'clsx';
9
9
  import Translate from '@docusaurus/Translate';
10
+ import Heading from '@theme/Heading';
10
11
  export default function NotFoundContent({className}) {
11
12
  return (
12
13
  <main className={clsx('container margin-vert--xl', className)}>
13
14
  <div className="row">
14
15
  <div className="col col--6 col--offset-3">
15
- <h1 className="hero__title">
16
+ <Heading as="h1" className="hero__title">
16
17
  <Translate
17
18
  id="theme.NotFound.title"
18
19
  description="The title of the 404 page">
19
20
  Page Not Found
20
21
  </Translate>
21
- </h1>
22
+ </Heading>
22
23
  <p>
23
24
  <Translate
24
25
  id="theme.NotFound.p1"
@@ -7,11 +7,14 @@
7
7
  import React from 'react';
8
8
  import {listTagsByLetters} from '@docusaurus/theme-common';
9
9
  import Tag from '@theme/Tag';
10
+ import Heading from '@theme/Heading';
10
11
  import styles from './styles.module.css';
11
12
  function TagLetterEntryItem({letterEntry}) {
12
13
  return (
13
14
  <article>
14
- <h2>{letterEntry.letter}</h2>
15
+ <Heading as="h2" id={letterEntry.letter}>
16
+ {letterEntry.letter}
17
+ </Heading>
15
18
  <ul className="padding--none">
16
19
  {letterEntry.tags.map((tag) => (
17
20
  <li key={tag.permalink} className={styles.tag}>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/theme-classic",
3
- "version": "0.0.0-5454",
3
+ "version": "0.0.0-5456",
4
4
  "description": "Classic theme for Docusaurus",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/theme-classic.d.ts",
@@ -20,18 +20,18 @@
20
20
  "copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch"
21
21
  },
22
22
  "dependencies": {
23
- "@docusaurus/core": "0.0.0-5454",
24
- "@docusaurus/mdx-loader": "0.0.0-5454",
25
- "@docusaurus/module-type-aliases": "0.0.0-5454",
26
- "@docusaurus/plugin-content-blog": "0.0.0-5454",
27
- "@docusaurus/plugin-content-docs": "0.0.0-5454",
28
- "@docusaurus/plugin-content-pages": "0.0.0-5454",
29
- "@docusaurus/theme-common": "0.0.0-5454",
30
- "@docusaurus/theme-translations": "0.0.0-5454",
31
- "@docusaurus/types": "0.0.0-5454",
32
- "@docusaurus/utils": "0.0.0-5454",
33
- "@docusaurus/utils-common": "0.0.0-5454",
34
- "@docusaurus/utils-validation": "0.0.0-5454",
23
+ "@docusaurus/core": "0.0.0-5456",
24
+ "@docusaurus/mdx-loader": "0.0.0-5456",
25
+ "@docusaurus/module-type-aliases": "0.0.0-5456",
26
+ "@docusaurus/plugin-content-blog": "0.0.0-5456",
27
+ "@docusaurus/plugin-content-docs": "0.0.0-5456",
28
+ "@docusaurus/plugin-content-pages": "0.0.0-5456",
29
+ "@docusaurus/theme-common": "0.0.0-5456",
30
+ "@docusaurus/theme-translations": "0.0.0-5456",
31
+ "@docusaurus/types": "0.0.0-5456",
32
+ "@docusaurus/utils": "0.0.0-5456",
33
+ "@docusaurus/utils-common": "0.0.0-5456",
34
+ "@docusaurus/utils-validation": "0.0.0-5456",
35
35
  "@mdx-js/react": "^1.6.22",
36
36
  "clsx": "^1.2.1",
37
37
  "copy-text-to-clipboard": "^3.0.1",
@@ -62,5 +62,5 @@
62
62
  "engines": {
63
63
  "node": ">=16.14"
64
64
  },
65
- "gitHead": "420bebae1376648bc248021529a6fd1393caed97"
65
+ "gitHead": "ccafd006910933d7c754ee09e9871a401180361d"
66
66
  }
@@ -11,6 +11,7 @@ import {translate} from '@docusaurus/Translate';
11
11
  import {PageMetadata} from '@docusaurus/theme-common';
12
12
  import Layout from '@theme/Layout';
13
13
  import type {ArchiveBlogPost, Props} from '@theme/BlogArchivePage';
14
+ import Heading from '@theme/Heading';
14
15
 
15
16
  type YearProp = {
16
17
  year: string;
@@ -20,7 +21,9 @@ type YearProp = {
20
21
  function Year({year, posts}: YearProp) {
21
22
  return (
22
23
  <>
23
- <h3>{year}</h3>
24
+ <Heading as="h3" id={year}>
25
+ {year}
26
+ </Heading>
24
27
  <ul>
25
28
  {posts.map((post) => (
26
29
  <li key={post.metadata.date}>
@@ -81,7 +84,9 @@ export default function BlogArchive({archive}: Props): JSX.Element {
81
84
  <Layout>
82
85
  <header className="hero hero--primary">
83
86
  <div className="container">
84
- <h1 className="hero__title">{title}</h1>
87
+ <Heading as="h1" className="hero__title">
88
+ {title}
89
+ </Heading>
85
90
  <p className="hero__subtitle">{description}</p>
86
91
  </div>
87
92
  </header>
@@ -17,6 +17,7 @@ import BlogLayout from '@theme/BlogLayout';
17
17
  import TagsListByLetter from '@theme/TagsListByLetter';
18
18
  import type {Props} from '@theme/BlogTagsListPage';
19
19
  import SearchMetadata from '@theme/SearchMetadata';
20
+ import Heading from '@theme/Heading';
20
21
 
21
22
  export default function BlogTagsListPage({tags, sidebar}: Props): JSX.Element {
22
23
  const title = translateTagsPageTitle();
@@ -29,7 +30,7 @@ export default function BlogTagsListPage({tags, sidebar}: Props): JSX.Element {
29
30
  <PageMetadata title={title} />
30
31
  <SearchMetadata tag="blog_tags_list" />
31
32
  <BlogLayout sidebar={sidebar}>
32
- <h1>{title}</h1>
33
+ <Heading as="h1">{title}</Heading>
33
34
  <TagsListByLetter tags={tags} />
34
35
  </BlogLayout>
35
36
  </HtmlClassNameProvider>
@@ -21,6 +21,7 @@ import SearchMetadata from '@theme/SearchMetadata';
21
21
  import type {Props} from '@theme/BlogTagsPostsPage';
22
22
  import BlogPostItems from '@theme/BlogPostItems';
23
23
  import Unlisted from '@theme/Unlisted';
24
+ import Heading from '@theme/Heading';
24
25
 
25
26
  // Very simple pluralization: probably good enough for now
26
27
  function useBlogPostsPlural() {
@@ -73,7 +74,7 @@ function BlogTagsPostsPageContent({
73
74
  <BlogLayout sidebar={sidebar}>
74
75
  {tag.unlisted && <Unlisted />}
75
76
  <header className="margin-bottom--xl">
76
- <h1>{title}</h1>
77
+ <Heading as="h1">{title}</Heading>
77
78
  <Link href={tag.allTagsPath}>
78
79
  <Translate
79
80
  id="theme.tags.tagsPageLink"
@@ -16,6 +16,7 @@ import isInternalUrl from '@docusaurus/isInternalUrl';
16
16
  import {translate} from '@docusaurus/Translate';
17
17
 
18
18
  import type {Props} from '@theme/DocCard';
19
+ import Heading from '@theme/Heading';
19
20
  import type {
20
21
  PropSidebarItemCategory,
21
22
  PropSidebarItemLink,
@@ -52,9 +53,12 @@ function CardLayout({
52
53
  }): JSX.Element {
53
54
  return (
54
55
  <CardContainer href={href}>
55
- <h2 className={clsx('text--truncate', styles.cardTitle)} title={title}>
56
+ <Heading
57
+ as="h2"
58
+ className={clsx('text--truncate', styles.cardTitle)}
59
+ title={title}>
56
60
  {icon} {title}
57
- </h2>
61
+ </Heading>
58
62
  {description && (
59
63
  <p
60
64
  className={clsx('text--truncate', styles.cardDescription)}
@@ -18,6 +18,7 @@ import Translate, {translate} from '@docusaurus/Translate';
18
18
  import SearchMetadata from '@theme/SearchMetadata';
19
19
  import type {Props} from '@theme/DocTagDocListPage';
20
20
  import Unlisted from '@theme/Unlisted';
21
+ import Heading from '@theme/Heading';
21
22
 
22
23
  // Very simple pluralization: probably good enough for now
23
24
  function useNDocsTaggedPlural() {
@@ -53,7 +54,7 @@ function DocItem({doc}: {doc: Props['tag']['items'][number]}): JSX.Element {
53
54
  return (
54
55
  <article className="margin-vert--lg">
55
56
  <Link to={doc.permalink}>
56
- <h2>{doc.title}</h2>
57
+ <Heading as="h2">{doc.title}</Heading>
57
58
  </Link>
58
59
  {doc.description && <p>{doc.description}</p>}
59
60
  </article>
@@ -83,7 +84,7 @@ function DocTagDocListPageContent({
83
84
  <main className="col col--8 col--offset-2">
84
85
  {tag.unlisted && <Unlisted />}
85
86
  <header className="margin-bottom--xl">
86
- <h1>{title}</h1>
87
+ <Heading as="h1">{title}</Heading>
87
88
  <Link href={tag.allTagsPath}>
88
89
  <Translate
89
90
  id="theme.tags.tagsPageLink"
@@ -16,6 +16,7 @@ import {
16
16
  import TagsListByLetter from '@theme/TagsListByLetter';
17
17
  import SearchMetadata from '@theme/SearchMetadata';
18
18
  import type {Props} from '@theme/DocTagsListPage';
19
+ import Heading from '@theme/Heading';
19
20
 
20
21
  function DocTagsListPageMetadata({
21
22
  title,
@@ -38,7 +39,7 @@ function DocTagsListPageContent({
38
39
  <div className="container margin-vert--lg">
39
40
  <div className="row">
40
41
  <main className="col col--8 col--offset-2">
41
- <h1>{title}</h1>
42
+ <Heading as="h1">{title}</Heading>
42
43
  <TagsListByLetter tags={tags} />
43
44
  </main>
44
45
  </div>
@@ -9,6 +9,7 @@ import React from 'react';
9
9
  import Translate from '@docusaurus/Translate';
10
10
  import {ErrorBoundaryTryAgainButton} from '@docusaurus/theme-common';
11
11
  import type {Props} from '@theme/Error';
12
+ import Heading from '@theme/Heading';
12
13
 
13
14
  export default function ErrorPageContent({
14
15
  error,
@@ -18,13 +19,13 @@ export default function ErrorPageContent({
18
19
  <main className="container margin-vert--xl">
19
20
  <div className="row">
20
21
  <div className="col col--6 col--offset-3">
21
- <h1 className="hero__title">
22
+ <Heading as="h1" className="hero__title">
22
23
  <Translate
23
24
  id="theme.ErrorPageContent.title"
24
25
  description="The title of the fallback page when the page crashed">
25
26
  This page crashed.
26
27
  </Translate>
27
- </h1>
28
+ </Heading>
28
29
  <p>{error.message}</p>
29
30
  <div>
30
31
  <ErrorBoundaryTryAgainButton onClick={tryAgain} />
@@ -9,19 +9,20 @@ import React from 'react';
9
9
  import clsx from 'clsx';
10
10
  import Translate from '@docusaurus/Translate';
11
11
  import type {Props} from '@theme/NotFound/Content';
12
+ import Heading from '@theme/Heading';
12
13
 
13
14
  export default function NotFoundContent({className}: Props): JSX.Element {
14
15
  return (
15
16
  <main className={clsx('container margin-vert--xl', className)}>
16
17
  <div className="row">
17
18
  <div className="col col--6 col--offset-3">
18
- <h1 className="hero__title">
19
+ <Heading as="h1" className="hero__title">
19
20
  <Translate
20
21
  id="theme.NotFound.title"
21
22
  description="The title of the 404 page">
22
23
  Page Not Found
23
24
  </Translate>
24
- </h1>
25
+ </Heading>
25
26
  <p>
26
27
  <Translate
27
28
  id="theme.NotFound.p1"
@@ -9,13 +9,15 @@ import React from 'react';
9
9
  import {listTagsByLetters, type TagLetterEntry} from '@docusaurus/theme-common';
10
10
  import Tag from '@theme/Tag';
11
11
  import type {Props} from '@theme/TagsListByLetter';
12
-
12
+ import Heading from '@theme/Heading';
13
13
  import styles from './styles.module.css';
14
14
 
15
15
  function TagLetterEntryItem({letterEntry}: {letterEntry: TagLetterEntry}) {
16
16
  return (
17
17
  <article>
18
- <h2>{letterEntry.letter}</h2>
18
+ <Heading as="h2" id={letterEntry.letter}>
19
+ {letterEntry.letter}
20
+ </Heading>
19
21
  <ul className="padding--none">
20
22
  {letterEntry.tags.map((tag) => (
21
23
  <li key={tag.permalink} className={styles.tag}>