diff --git a/docs/src/theme/Layout/index.js b/docs/src/theme/Layout/index.js new file mode 100644 index 0000000..ed4021d --- /dev/null +++ b/docs/src/theme/Layout/index.js @@ -0,0 +1,91 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import React from "react"; +import Head from "@docusaurus/Head"; +import isInternalUrl from "@docusaurus/isInternalUrl"; +import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; +import useBaseUrl from "@docusaurus/useBaseUrl"; + +import ThemeProvider from "@theme/ThemeProvider"; +import TabGroupChoiceProvider from "@theme/TabGroupChoiceProvider"; +import AnnouncementBar from "@theme/AnnouncementBar"; +import Navbar from "@theme/Navbar"; +import Footer from "@theme/Footer"; + +import "./styles.css"; + +function Layout(props) { + const { siteConfig = {} } = useDocusaurusContext(); + const { + favicon, + title: siteTitle, + themeConfig: { image: defaultImage }, + url: siteUrl, + } = siteConfig; + const { + children, + title, + noFooter, + description, + image, + keywords, + permalink, + version, + } = props; + const metaTitle = title ? `${title} | ${siteTitle}` : siteTitle; + + const metaImage = image || defaultImage; + let metaImageUrl = siteUrl + useBaseUrl(metaImage); + if (!isInternalUrl(metaImage)) { + metaImageUrl = metaImage; + } + + const faviconUrl = useBaseUrl(favicon); + + return ( + + + + {/* TODO: Do not assume that it is in english language */} + + + {metaTitle && {metaTitle}} + {metaTitle && } + {favicon && } + {description && } + {description && ( + + )} + {version && } + {keywords && keywords.length && ( + + )} + {metaImage && } + {metaImage && ( + + )} + {metaImage && ( + + )} + {metaImage && } + {metaImage && } + {permalink && ( + + )} + + + + +
{children}
+ {!noFooter &&