@docusaurus/theme-classic 0.0.0-4436 → 0.0.0-4441

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.
@@ -22,14 +22,14 @@ import {useLocation} from '@docusaurus/router'; // Useful for SEO
22
22
 
23
23
  function AlternateLangHeaders() {
24
24
  const {
25
- i18n: {defaultLocale, locales},
25
+ i18n: {defaultLocale, localeConfigs},
26
26
  } = useDocusaurusContext();
27
27
  const alternatePageUtils = useAlternatePageUtils(); // Note: it is fine to use both "x-default" and "en" to target the same url
28
28
  // See https://www.searchviu.com/en/multiple-hreflang-tags-one-url/
29
29
 
30
30
  return (
31
31
  <Head>
32
- {locales.map((locale) => (
32
+ {Object.entries(localeConfigs).map(([locale, {htmlLang}]) => (
33
33
  <link
34
34
  key={locale}
35
35
  rel="alternate"
@@ -37,7 +37,7 @@ function AlternateLangHeaders() {
37
37
  locale,
38
38
  fullyQualified: true,
39
39
  })}
40
- hrefLang={locale}
40
+ hrefLang={htmlLang}
41
41
  />
42
42
  ))}
43
43
  <link
@@ -84,12 +84,8 @@ export default function LayoutHead(props) {
84
84
  const {metadata, image: defaultImage} = useThemeConfig();
85
85
  const {title, description, image, keywords, searchMetadata} = props;
86
86
  const faviconUrl = useBaseUrl(favicon);
87
- const pageTitle = useTitleFormatter(title); // See https://github.com/facebook/docusaurus/issues/3317#issuecomment-754661855
88
- // const htmlLang = currentLocale.split('-')[0];
89
-
90
- const htmlLang = currentLocale; // should we allow the user to override htmlLang with localeConfig?
91
-
92
- const htmlDir = localeConfigs[currentLocale].direction;
87
+ const pageTitle = useTitleFormatter(title);
88
+ const {htmlLang, direction: htmlDir} = localeConfigs[currentLocale];
93
89
  return (
94
90
  <>
95
91
  <Head>
@@ -9,3 +9,7 @@ ul.contains-task-list {
9
9
  padding-left: 0;
10
10
  list-style: none;
11
11
  }
12
+
13
+ img {
14
+ height: auto;
15
+ }
@@ -16,17 +16,10 @@ import styles from './styles.module.css';
16
16
  function MDXPage(props) {
17
17
  const {content: MDXPageContent} = props;
18
18
  const {
19
- // TODO this frontmatter is not validated/normalized, it's the raw user-provided one. We should expose normalized one too!
20
- frontMatter,
21
- metadata,
19
+ metadata: {title, description, permalink, frontMatter},
22
20
  } = MDXPageContent;
23
- const {
24
- title,
25
- description,
26
- wrapperClassName,
27
- hide_table_of_contents: hideTableOfContents,
28
- } = frontMatter;
29
- const {permalink} = metadata;
21
+ const {wrapperClassName, hide_table_of_contents: hideTableOfContents} =
22
+ frontMatter;
30
23
  return (
31
24
  <Layout
32
25
  title={title}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/theme-classic",
3
- "version": "0.0.0-4436",
3
+ "version": "0.0.0-4441",
4
4
  "description": "Classic theme for Docusaurus",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/theme-classic.d.ts",
@@ -23,14 +23,14 @@
23
23
  "update-code-translations": "node -e 'require(\"./update-code-translations.js\").run()'"
24
24
  },
25
25
  "dependencies": {
26
- "@docusaurus/core": "0.0.0-4436",
27
- "@docusaurus/plugin-content-blog": "0.0.0-4436",
28
- "@docusaurus/plugin-content-docs": "0.0.0-4436",
29
- "@docusaurus/plugin-content-pages": "0.0.0-4436",
30
- "@docusaurus/theme-common": "0.0.0-4436",
31
- "@docusaurus/theme-translations": "0.0.0-4436",
32
- "@docusaurus/utils": "0.0.0-4436",
33
- "@docusaurus/utils-validation": "0.0.0-4436",
26
+ "@docusaurus/core": "0.0.0-4441",
27
+ "@docusaurus/plugin-content-blog": "0.0.0-4441",
28
+ "@docusaurus/plugin-content-docs": "0.0.0-4441",
29
+ "@docusaurus/plugin-content-pages": "0.0.0-4441",
30
+ "@docusaurus/theme-common": "0.0.0-4441",
31
+ "@docusaurus/theme-translations": "0.0.0-4441",
32
+ "@docusaurus/utils": "0.0.0-4441",
33
+ "@docusaurus/utils-validation": "0.0.0-4441",
34
34
  "@mdx-js/mdx": "^1.6.21",
35
35
  "@mdx-js/react": "^1.6.21",
36
36
  "clsx": "^1.1.1",
@@ -45,8 +45,8 @@
45
45
  "rtlcss": "^3.3.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@docusaurus/module-type-aliases": "0.0.0-4436",
49
- "@docusaurus/types": "0.0.0-4436",
48
+ "@docusaurus/module-type-aliases": "0.0.0-4441",
49
+ "@docusaurus/types": "0.0.0-4441",
50
50
  "@types/mdx-js__react": "^1.5.4",
51
51
  "@types/parse-numeric-range": "^0.0.1",
52
52
  "@types/rtlcss": "^3.1.1",
@@ -61,5 +61,5 @@
61
61
  "engines": {
62
62
  "node": ">=14"
63
63
  },
64
- "gitHead": "3b2e15935a716c69bd530fe10942e1620b36ddc4"
64
+ "gitHead": "43dbd283d8dbcab6ce2f3b1d2ebc0fe0334c77c9"
65
65
  }
@@ -25,7 +25,7 @@ import {useLocation} from '@docusaurus/router';
25
25
  // See https://github.com/facebook/docusaurus/issues/3317
26
26
  function AlternateLangHeaders(): JSX.Element {
27
27
  const {
28
- i18n: {defaultLocale, locales},
28
+ i18n: {defaultLocale, localeConfigs},
29
29
  } = useDocusaurusContext();
30
30
  const alternatePageUtils = useAlternatePageUtils();
31
31
 
@@ -33,7 +33,7 @@ function AlternateLangHeaders(): JSX.Element {
33
33
  // See https://www.searchviu.com/en/multiple-hreflang-tags-one-url/
34
34
  return (
35
35
  <Head>
36
- {locales.map((locale) => (
36
+ {Object.entries(localeConfigs).map(([locale, {htmlLang}]) => (
37
37
  <link
38
38
  key={locale}
39
39
  rel="alternate"
@@ -41,7 +41,7 @@ function AlternateLangHeaders(): JSX.Element {
41
41
  locale,
42
42
  fullyQualified: true,
43
43
  })}
44
- hrefLang={locale}
44
+ hrefLang={htmlLang}
45
45
  />
46
46
  ))}
47
47
  <link
@@ -91,11 +91,7 @@ export default function LayoutHead(props: Props): JSX.Element {
91
91
  const {title, description, image, keywords, searchMetadata} = props;
92
92
  const faviconUrl = useBaseUrl(favicon);
93
93
  const pageTitle = useTitleFormatter(title);
94
-
95
- // See https://github.com/facebook/docusaurus/issues/3317#issuecomment-754661855
96
- // const htmlLang = currentLocale.split('-')[0];
97
- const htmlLang = currentLocale; // should we allow the user to override htmlLang with localeConfig?
98
- const htmlDir = localeConfigs[currentLocale].direction;
94
+ const {htmlLang, direction: htmlDir} = localeConfigs[currentLocale];
99
95
 
100
96
  return (
101
97
  <>
@@ -9,3 +9,7 @@ ul.contains-task-list {
9
9
  padding-left: 0;
10
10
  list-style: none;
11
11
  }
12
+
13
+ img {
14
+ height: auto;
15
+ }
@@ -19,18 +19,10 @@ import styles from './styles.module.css';
19
19
  function MDXPage(props: Props): JSX.Element {
20
20
  const {content: MDXPageContent} = props;
21
21
  const {
22
- // TODO this frontmatter is not validated/normalized, it's the raw user-provided one. We should expose normalized one too!
23
- frontMatter,
24
- metadata,
22
+ metadata: {title, description, permalink, frontMatter},
25
23
  } = MDXPageContent;
26
-
27
- const {
28
- title,
29
- description,
30
- wrapperClassName,
31
- hide_table_of_contents: hideTableOfContents,
32
- } = frontMatter;
33
- const {permalink} = metadata;
24
+ const {wrapperClassName, hide_table_of_contents: hideTableOfContents} =
25
+ frontMatter;
34
26
 
35
27
  return (
36
28
  <Layout