2018-10-25 20:03:19 -04:00
/ * *
2020-02-25 10:12:28 -05:00
* Copyright ( c ) Facebook , Inc . and its affiliates .
2018-10-25 20:03:19 -04:00
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* /
2021-09-30 11:49:44 -04:00
// @ts-check
2018-10-25 20:03:19 -04:00
2020-07-08 06:32:41 -04:00
const path = require ( 'path' ) ;
2022-05-14 11:39:50 -04:00
const npm2yarn = require ( '@docusaurus/remark-plugin-npm2yarn' ) ;
const versions = require ( './versions.json' ) ;
2021-06-18 11:27:13 -04:00
const VersionsArchived = require ( './versionsArchived.json' ) ;
2022-02-25 08:13:15 -05:00
const {
dogfoodingPluginInstances ,
dogfoodingThemeInstances ,
} = require ( './_dogfooding/dogfooding.config' ) ;
2021-11-06 07:04:45 -04:00
2023-02-24 08:19:39 -05:00
/** @type {Record<string,Record<string,string>>} */
const ConfigLocalized = require ( './docusaurus.config.localized.json' ) ;
2021-12-03 08:44:59 -05:00
const ArchivedVersionsDropdownItems = Object . entries ( VersionsArchived ) . splice (
0 ,
5 ,
) ;
2019-11-23 21:13:16 -05:00
2022-07-14 13:30:17 -04:00
// This probably only makes sense for the alpha/beta/rc phase, temporary
function getNextVersionName ( ) {
2022-08-01 04:24:49 -04:00
return 'Canary' ;
/ *
2022-07-14 13:30:17 -04:00
const expectedPrefix = '2.0.0-rc.' ;
2020-10-01 10:13:11 -04:00
const lastReleasedVersion = versions [ 0 ] ;
2022-05-23 00:54:25 -04:00
if ( ! lastReleasedVersion || ! lastReleasedVersion . includes ( expectedPrefix ) ) {
2020-10-01 10:13:11 -04:00
throw new Error (
2022-07-14 13:30:17 -04:00
'this code is only meant to be used during the 2.0 alpha/beta/rc phase.' ,
2020-10-01 10:13:11 -04:00
) ;
}
2021-05-12 10:07:15 -04:00
const version = parseInt ( lastReleasedVersion . replace ( expectedPrefix , '' ) , 10 ) ;
return ` ${ expectedPrefix } ${ version + 1 } ` ;
2022-08-01 04:24:49 -04:00
* /
2020-10-01 10:13:11 -04:00
}
2023-04-07 13:00:59 -04:00
// Artificial way to crash the SSR rendering and test errors
// See website/_dogfooding/_pages tests/crashTest.tsx
// Test with: DOCUSAURUS_CRASH_TEST=true yarn build:website:fast
const crashTest = process . env . DOCUSAURUS _CRASH _TEST === 'true' ;
2020-08-28 12:37:49 -04:00
const isDev = process . env . NODE _ENV === 'development' ;
const isDeployPreview =
2021-11-26 05:14:35 -05:00
! ! process . env . NETLIFY && process . env . CONTEXT === 'deploy-preview' ;
2020-08-28 12:37:49 -04:00
2022-07-15 09:39:55 -04:00
// Netlify branch deploy like "docusaurus-v2"
const isBranchDeploy =
! ! process . env . NETLIFY && process . env . CONTEXT === 'branch-deploy' ;
2021-10-21 11:17:03 -04:00
// Used to debug production build issues faster
const isBuildFast = ! ! process . env . BUILD _FAST ;
2022-05-24 03:40:26 -04:00
const baseUrl = process . env . BASE _URL ? ? '/' ;
2020-08-17 14:18:37 -04:00
2021-02-11 06:31:50 -05:00
// Special deployment for staging locales until they get enough translations
// https://app.netlify.com/sites/docusaurus-i18n-staging
// https://docusaurus-i18n-staging.netlify.app/
const isI18nStaging = process . env . I18N _STAGING === 'true' ;
2021-03-18 14:28:14 -04:00
const isVersioningDisabled = ! ! process . env . DISABLE _VERSIONING || isI18nStaging ;
2021-08-13 10:23:56 -04:00
const TwitterSvg =
2022-04-06 20:33:52 -04:00
'<svg style="fill: #1DA1F2; vertical-align: middle; margin-left: 3px;" width="16" height="16" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"></path></svg>' ;
2021-08-13 10:23:56 -04:00
2023-02-24 08:19:39 -05:00
const defaultLocale = 'en' ;
function getLocalizedConfigValue ( /** @type {string} */ key ) {
const currentLocale = process . env . DOCUSAURUS _CURRENT _LOCALE ? ? defaultLocale ;
const values = ConfigLocalized [ key ] ;
if ( ! values ) {
throw new Error ( ` Localized config key= ${ key } not found ` ) ;
}
const value = values [ currentLocale ] ? ? values [ defaultLocale ] ;
if ( ! value ) {
throw new Error (
` Localized value for config key= ${ key } not found for both currentLocale= ${ currentLocale } or defaultLocale= ${ defaultLocale } ` ,
) ;
}
return value ;
}
2023-04-21 06:00:09 -04:00
/** @returns {Promise<import('@docusaurus/types').Config>} */
module . exports = async function createConfigAsync ( ) {
return {
title : 'Docusaurus' ,
tagline : getLocalizedConfigValue ( 'tagline' ) ,
organizationName : 'facebook' ,
projectName : 'docusaurus' ,
baseUrl ,
baseUrlIssueBanner : true ,
url : 'https://docusaurus.io' ,
// Dogfood both settings:
// - force trailing slashes for deploy previews
// - avoid trailing slashes in prod
trailingSlash : isDeployPreview ,
stylesheets : [
2022-01-27 10:17:31 -05:00
{
2023-04-21 06:00:09 -04:00
href : '/katex/katex.min.css' ,
type : 'text/css' ,
2022-01-27 10:17:31 -05:00
} ,
] ,
2023-04-21 06:00:09 -04:00
i18n : {
defaultLocale ,
locales :
isDeployPreview || isBranchDeploy
? // Deploy preview and branch deploys: keep them fast!
[ defaultLocale ]
: isI18nStaging
? // Staging locales: https://docusaurus-i18n-staging.netlify.app/
[ defaultLocale , 'ja' ]
: // Production locales
[ defaultLocale , 'fr' , 'pt-BR' , 'ko' , 'zh-CN' ] ,
} ,
webpack : {
jsLoader : ( isServer ) => ( {
loader : require . resolve ( 'swc-loader' ) ,
options : {
jsc : {
parser : {
syntax : 'typescript' ,
tsx : true ,
} ,
target : 'es2017' ,
2020-08-05 12:27:55 -04:00
} ,
2023-04-21 06:00:09 -04:00
module : {
type : isServer ? 'commonjs' : 'es6' ,
2021-06-16 13:04:28 -04:00
} ,
2023-04-21 06:00:09 -04:00
} ,
2022-04-17 04:39:11 -04:00
} ) ,
2023-04-21 06:00:09 -04:00
} ,
markdown : {
mermaid : true ,
2023-04-21 13:48:57 -04:00
mdx1Compat : {
// comments: false,
} ,
preprocessor : ( { filePath , fileContent } ) => {
if ( isDev ) {
// "vscode://file/${projectPath}${filePath}:${line}:${column}",
// "webstorm://open?file=${projectPath}${filePath}&line=${line}&column=${column}",
const vscodeLink = ` vscode://file/ ${ filePath } ` ;
const webstormLink = ` webstorm://open?file= ${ filePath } ` ;
const intellijLink = ` idea://open?file= ${ filePath } ` ;
return ` ${ fileContent } \n \n --- \n \n **DEV**: open this file in [VSCode](< ${ vscodeLink } >) | [WebStorm](< ${ webstormLink } >) | [IntelliJ](< ${ intellijLink } >) \n ` ;
}
return fileContent ;
} ,
2023-04-21 06:00:09 -04:00
} ,
onBrokenLinks : 'throw' ,
onBrokenMarkdownLinks : 'warn' ,
favicon : 'img/docusaurus.ico' ,
customFields : {
crashTest ,
isDeployPreview ,
description :
'An optimized site generator in React. Docusaurus helps you to move fast and write content. Build documentation websites, blogs, marketing pages, and more.' ,
} ,
staticDirectories : [
'static' ,
path . join ( _ _dirname , '_dogfooding/_asset-tests' ) ,
// Adding a non-existent static directory. If user deleted `static`
// without specifying `staticDirectories: []`, build should still work
path . join ( _ _dirname , '_dogfooding/non-existent' ) ,
2019-07-17 09:53:40 -04:00
] ,
2023-04-21 06:00:09 -04:00
themes : [ 'live-codeblock' , ... dogfoodingThemeInstances ] ,
plugins : [
[
require . resolve ( './src/plugins/changelog/index.js' ) ,
{
blogTitle : 'Docusaurus changelog' ,
blogDescription :
'Keep yourself up-to-date about new features in every release' ,
blogSidebarCount : 'ALL' ,
blogSidebarTitle : 'Changelog' ,
routeBasePath : '/changelog' ,
showReadingTime : false ,
postsPerPage : 20 ,
archiveBasePath : null ,
authorsMapPath : 'authors.json' ,
feedOptions : {
type : 'all' ,
title : 'Docusaurus changelog' ,
description :
'Keep yourself up-to-date about new features in every release' ,
copyright : ` Copyright © ${ new Date ( ) . getFullYear ( ) } Facebook, Inc. ` ,
language : defaultLocale ,
2020-07-08 06:32:41 -04:00
} ,
2023-04-21 06:00:09 -04:00
} ,
] ,
[
'content-docs' ,
/** @type {import('@docusaurus/plugin-content-docs').Options} */
( {
id : 'community' ,
path : 'community' ,
routeBasePath : 'community' ,
editUrl : ( { locale , versionDocsDirPath , docPath } ) => {
2023-02-24 08:19:39 -05:00
if ( locale !== defaultLocale ) {
2021-01-29 09:35:25 -05:00
return ` https://crowdin.com/project/docusaurus-v2/ ${ locale } ` ;
}
2023-04-21 06:00:09 -04:00
return ` https://github.com/facebook/docusaurus/edit/main/website/ ${ versionDocsDirPath } / ${ docPath } ` ;
2022-09-07 11:49:44 -04:00
} ,
2023-04-21 06:00:09 -04:00
remarkPlugins : [ npm2yarn ] ,
editCurrentVersion : true ,
sidebarPath : require . resolve ( './sidebarsCommunity.js' ) ,
2019-10-11 00:45:39 -04:00
showLastUpdateAuthor : true ,
showLastUpdateTime : true ,
2023-04-21 06:00:09 -04:00
} ) ,
] ,
[
'client-redirects' ,
/** @type {import('@docusaurus/plugin-client-redirects').Options} */
( {
fromExtensions : [ 'html' ] ,
createRedirects ( routePath ) {
// Redirect to /docs from /docs/introduction (now docs root doc)
if ( routePath === '/docs' || routePath === '/docs/' ) {
return [ ` ${ routePath } /introduction ` ] ;
2021-12-16 22:00:12 -05:00
}
2023-04-21 06:00:09 -04:00
return [ ] ;
feat(v2): Implement plugin creating feed for blog posts (#1916)
* feat(v2): Implement feed for blog posts
Fixes: #1698
Test plan:
- added tests
Ran `yarn build` on website with the following config (and disabled blog
from preset-classic):
```js
[
'@docusaurus/plugin-content-blog',
{
path: '../website-1.x/blog',
feedOptions: {
copyright: 'Copy',
type: 'atom',
},
},
],
```
which genereted the following feed:
```xml
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<id>https://v2.docusaurus.io/blog</id>
<title>Docusaurus Blog</title>
<updated>2018-12-14T00:00:00.000Z</updated>
<generator>https://github.com/jpmonette/feed</generator>
<link rel="alternate" href="https://v2.docusaurus.io/blog"/>
<subtitle>Docusaurus Blog</subtitle>
<icon>https://v2.docusaurus.io/img/docusaurus.ico</icon>
<rights>Copy</rights>
<entry>
<title type="html"><![CDATA[Happy 1st Birthday Slash!]]></title>
<id>Happy 1st Birthday Slash!</id>
<link href="https://v2.docusaurus.io/blog/2018/12/14/Happy-First-Birthday-Slash"/>
<updated>2018-12-14T00:00:00.000Z</updated>
<summary type="html"><]]></summary>
</entry>
<entry>
<title type="html"><![CDATA[Towards Docusaurus 2]]></title>
<id>Towards Docusaurus 2</id>
<link href="https://v2.docusaurus.io/blog/2018/09/11/Towards-Docusaurus-2"/>
<updated>2018-09-11T00:00:00.000Z</updated>
<summary type="html">< over nine months ago as a way to easily build open source documentation websites. Since then, it has amassed over 8,600 GitHub Stars, and is used by many popular open source projects such as [React Native](https://facebook.github.io/react-native/), [Babel](https://babeljs.io/), [Jest](https://jestjs.io/), [Reason](https://reasonml.github.io/) and [Prettier](https://prettier.io/).]]></summary>
</entry>
<entry>
<title type="html"><![CDATA[How I Converted Profilo to Docusaurus in Under 2 Hours]]></title>
<id>How I Converted Profilo to Docusaurus in Under 2 Hours</id>
<link href="https://v2.docusaurus.io/blog/2018/04/30/How-I-Converted-Profilo-To-Docusaurus"/>
<updated>2018-04-30T00:00:00.000Z</updated>
<summary type="html"><![CDATA[> _“Joel and I were discussing having a website and how it would have been great to launch with it. So I challenged myself to add Docusaurus support. It took just over an hour and a half. I'm going to send you a PR with the addition so you can take a look and see if you like it. Your workflow for adding docs wouldn't be much different from editing those markdown files.”_]]></summary>
</entry>
<entry>
<title type="html"><![CDATA[Introducing Docusaurus]]></title>
<id>Introducing Docusaurus</id>
<link href="https://v2.docusaurus.io/blog/2017/12/14/introducing-docusaurus"/>
<updated>2017-12-14T00:00:00.000Z</updated>
<summary type="html"><]]></summary>
</entry>
</feed>
```
* new feedOptions type 'all' and use correct path
2019-11-06 02:45:31 -05:00
} ,
2023-04-21 06:00:09 -04:00
redirects : [
{
from : [ '/docs/support' , '/docs/next/support' ] ,
to : '/community/support' ,
} ,
{
from : [ '/docs/team' , '/docs/next/team' ] ,
to : '/community/team' ,
} ,
{
from : [ '/docs/resources' , '/docs/next/resources' ] ,
to : '/community/resources' ,
} ,
] ,
} ) ,
] ,
[
'ideal-image' ,
/** @type {import('@docusaurus/plugin-ideal-image').PluginOptions} */
( {
quality : 70 ,
max : 1030 ,
min : 640 ,
steps : 2 ,
// Use false to debug, but it incurs huge perf costs
disableInDev : true ,
} ) ,
] ,
[
'pwa' ,
{
debug : isDeployPreview ,
offlineModeActivationStrategies : [
'appInstalled' ,
'standalone' ,
'queryString' ,
] ,
// swRegister: false,
swCustom : require . resolve ( './src/sw.js' ) ,
pwaHead : [
{
tagName : 'link' ,
rel : 'icon' ,
href : 'img/docusaurus.png' ,
} ,
{
tagName : 'link' ,
rel : 'manifest' ,
href : 'manifest.json' ,
} ,
{
tagName : 'meta' ,
name : 'theme-color' ,
content : 'rgb(37, 194, 160)' ,
} ,
{
tagName : 'meta' ,
name : 'apple-mobile-web-app-capable' ,
content : 'yes' ,
} ,
{
tagName : 'meta' ,
name : 'apple-mobile-web-app-status-bar-style' ,
content : '#000' ,
} ,
{
tagName : 'link' ,
rel : 'apple-touch-icon' ,
href : 'img/docusaurus.png' ,
} ,
{
tagName : 'link' ,
rel : 'mask-icon' ,
href : 'img/docusaurus.png' ,
color : 'rgb(62, 204, 94)' ,
} ,
{
tagName : 'meta' ,
name : 'msapplication-TileImage' ,
content : 'img/docusaurus.png' ,
} ,
{
tagName : 'meta' ,
name : 'msapplication-TileColor' ,
content : '#000' ,
} ,
2022-03-18 13:53:00 -04:00
] ,
2019-06-10 02:21:36 -04:00
} ,
2023-04-21 06:00:09 -04:00
] ,
'@docusaurus/theme-mermaid' ,
( await import ( './src/plugins/featureRequests/FeatureRequestsPlugin.mjs' ) )
. default ,
... dogfoodingPluginInstances ,
2019-06-10 02:21:36 -04:00
] ,
2023-04-21 06:00:09 -04:00
presets : [
[
'classic' ,
/** @type {import('@docusaurus/preset-classic').Options} */
( {
debug : true , // force debug plugin usage
docs : {
// routeBasePath: '/',
path : 'docs' ,
sidebarPath : 'sidebars.js' ,
// sidebarCollapsible: false,
// sidebarCollapsed: true,
editUrl : ( { locale , docPath } ) => {
if ( locale !== defaultLocale ) {
return ` https://crowdin.com/project/docusaurus-v2/ ${ locale } ` ;
2022-12-22 12:24:28 -05:00
}
2023-04-21 06:00:09 -04:00
// We want users to submit updates to the upstream/next version!
// Otherwise we risk losing the update on the next release.
const nextVersionDocsDirPath = 'docs' ;
return ` https://github.com/facebook/docusaurus/edit/main/website/ ${ nextVersionDocsDirPath } / ${ docPath } ` ;
} ,
admonitions : {
keywords : [ 'my-custom-admonition' ] ,
} ,
showLastUpdateAuthor : true ,
showLastUpdateTime : true ,
remarkPlugins : [
[ npm2yarn , { sync : true } ] ,
2023-04-21 13:48:57 -04:00
( await import ( 'remark-math' ) ) . default ,
2023-04-21 06:00:09 -04:00
( await import ( './src/remark/configTabs.mjs' ) ) . default ,
2021-09-01 06:14:40 -04:00
] ,
2023-04-21 06:00:09 -04:00
rehypePlugins : [ ( await import ( 'rehype-katex' ) ) . default ] ,
disableVersioning : isVersioningDisabled ,
lastVersion :
isDev || isDeployPreview || isBranchDeploy
? 'current'
: undefined ,
2023-04-21 13:48:57 -04:00
2023-04-21 06:00:09 -04:00
onlyIncludeVersions : ( ( ) => {
if ( isBuildFast ) {
return [ 'current' ] ;
} else if (
! isVersioningDisabled &&
( isDev || isDeployPreview || isBranchDeploy )
) {
return [ 'current' , ... versions . slice ( 0 , 2 ) ] ;
}
return undefined ;
} ) ( ) ,
versions : {
current : {
label : ` ${ getNextVersionName ( ) } 🚧 ` ,
2021-09-01 06:14:40 -04:00
} ,
2023-04-21 06:00:09 -04:00
} ,
2021-09-01 06:14:40 -04:00
} ,
2023-04-21 06:00:09 -04:00
blog : {
// routeBasePath: '/',
path : 'blog' ,
editUrl : ( { locale , blogDirPath , blogPath } ) => {
if ( locale !== defaultLocale ) {
return ` https://crowdin.com/project/docusaurus-v2/ ${ locale } ` ;
}
return ` https://github.com/facebook/docusaurus/edit/main/website/ ${ blogDirPath } / ${ blogPath } ` ;
} ,
remarkPlugins : [ npm2yarn ] ,
postsPerPage : 5 ,
feedOptions : {
type : 'all' ,
copyright : ` Copyright © ${ new Date ( ) . getFullYear ( ) } Facebook, Inc. ` ,
} ,
blogSidebarCount : 'ALL' ,
blogSidebarTitle : 'All our posts' ,
2021-09-01 06:14:40 -04:00
} ,
2023-04-21 06:00:09 -04:00
pages : {
remarkPlugins : [ npm2yarn ] ,
2021-09-01 06:14:40 -04:00
} ,
2023-04-21 06:00:09 -04:00
theme : {
customCss : [
require . resolve ( './src/css/custom.css' ) ,
// relative paths are relative to site dir
'./_dogfooding/dogfooding.css' ,
2021-09-01 06:14:40 -04:00
] ,
} ,
2023-04-21 06:00:09 -04:00
gtag : ! ( isDeployPreview || isBranchDeploy )
? {
trackingID : [ 'G-E5CR2Q1NRE' , 'UA-141789564-1' ] ,
}
: undefined ,
sitemap : {
// Note: /tests/docs already has noIndex: true
ignorePatterns : [ '/tests/{blog,pages}/**' ] ,
} ,
} ) ,
] ,
] ,
themeConfig :
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
( {
liveCodeBlock : {
playgroundPosition : 'bottom' ,
} ,
docs : {
sidebar : {
hideable : true ,
autoCollapseCategories : true ,
} ,
} ,
colorMode : {
defaultMode : 'light' ,
disableSwitch : false ,
respectPrefersColorScheme : true ,
} ,
announcementBar : {
id : 'announcementBar-2' , // Increment on change
content : ` ⭐️ If you like Docusaurus, give it a star on <a target="_blank" rel="noopener noreferrer" href="https://github.com/facebook/docusaurus">GitHub</a> and follow us on <a target="_blank" rel="noopener noreferrer" href="https://twitter.com/docusaurus">Twitter ${ TwitterSvg } </a> ` ,
} ,
prism : {
additionalLanguages : [ 'java' , 'latex' ] ,
magicComments : [
{
className : 'theme-code-block-highlighted-line' ,
line : 'highlight-next-line' ,
block : { start : 'highlight-start' , end : 'highlight-end' } ,
} ,
{
className : 'code-block-error-line' ,
line : 'This will error' ,
} ,
] ,
theme : ( await import ( './src/utils/prismLight.mjs' ) ) . default ,
darkTheme : ( await import ( './src/utils/prismDark.mjs' ) ) . default ,
} ,
image : 'img/docusaurus-social-card.jpg' ,
// metadata: [{name: 'twitter:card', content: 'summary'}],
algolia : {
appId : 'X1Z85QJPUV' ,
apiKey : 'bf7211c161e8205da2f933a02534105a' ,
indexName : 'docusaurus-2' ,
replaceSearchResultPathname :
isDev || isDeployPreview
? {
from : /^\/docs\/next/g ,
to : '/docs' ,
}
: undefined ,
} ,
navbar : {
hideOnScroll : true ,
title : 'Docusaurus' ,
logo : {
alt : '' ,
src : 'img/docusaurus.svg' ,
srcDark : 'img/docusaurus_keytar.svg' ,
width : 32 ,
height : 32 ,
} ,
items : [
{
type : 'doc' ,
position : 'left' ,
docId : 'introduction' ,
label : 'Docs' ,
} ,
{
type : 'docSidebar' ,
position : 'left' ,
sidebarId : 'api' ,
label : 'API' ,
} ,
{ to : 'blog' , label : 'Blog' , position : 'left' } ,
{ to : 'showcase' , label : 'Showcase' , position : 'left' } ,
{
to : '/community/support' ,
label : 'Community' ,
position : 'left' ,
activeBaseRegex : ` /community/ ` ,
} ,
// This item links to a draft doc: only displayed in dev
{
type : 'doc' ,
docId : 'index' ,
label : 'Tests' ,
docsPluginId : 'docs-tests' ,
} ,
// This item links to an unlisted doc: only displayed
// in dev or when directly access
{
type : 'doc' ,
docId : 'tests/visibility/some-unlisteds/unlisted1' ,
label : 'Unlisted' ,
docsPluginId : 'docs-tests' ,
} ,
// Custom item for dogfooding: only displayed in /tests/ routes
{
type : 'custom-dogfood-navbar-item' ,
content : '😉' ,
} ,
// Right
{
type : 'docsVersionDropdown' ,
position : 'right' ,
dropdownActiveClassDisabled : true ,
dropdownItemsAfter : [
{
type : 'html' ,
value : '<hr class="dropdown-separator">' ,
} ,
{
type : 'html' ,
className : 'dropdown-archived-versions' ,
value : '<b>Archived versions</b>' ,
} ,
... ArchivedVersionsDropdownItems . map (
( [ versionName , versionUrl ] ) => ( {
label : versionName ,
href : versionUrl ,
} ) ,
) ,
{
href : 'https://v1.docusaurus.io' ,
label : '1.x.x' ,
} ,
{
type : 'html' ,
value : '<hr class="dropdown-separator">' ,
} ,
{
to : '/versions' ,
label : 'All versions' ,
} ,
] ,
} ,
{
type : 'localeDropdown' ,
position : 'right' ,
dropdownItemsAfter : [
{
type : 'html' ,
value : '<hr style="margin: 0.3rem 0;">' ,
} ,
{
href : 'https://github.com/facebook/docusaurus/issues/3526' ,
label : 'Help Us Translate' ,
} ,
] ,
} ,
{
href : 'https://github.com/facebook/docusaurus' ,
position : 'right' ,
className : 'header-github-link' ,
'aria-label' : 'GitHub repository' ,
} ,
] ,
} ,
footer : {
style : 'dark' ,
links : [
{
title : 'Learn' ,
items : [
{
label : 'Introduction' ,
to : 'docs' ,
} ,
{
label : 'Installation' ,
to : 'docs/installation' ,
} ,
{
label : 'Migration from v1 to v2' ,
to : 'docs/migration' ,
} ,
] ,
} ,
{
title : 'Community' ,
items : [
{
label : 'Stack Overflow' ,
href : 'https://stackoverflow.com/questions/tagged/docusaurus' ,
} ,
{
label : 'Feature Requests' ,
to : '/feature-requests' ,
} ,
{
label : 'Discord' ,
href : 'https://discordapp.com/invite/docusaurus' ,
} ,
{
label : 'Help' ,
to : '/community/support' ,
} ,
] ,
} ,
{
title : 'More' ,
items : [
{
label : 'Blog' ,
to : 'blog' ,
} ,
{
label : 'Changelog' ,
to : '/changelog' ,
} ,
{
label : 'GitHub' ,
href : 'https://github.com/facebook/docusaurus' ,
} ,
{
label : 'Twitter' ,
href : 'https://twitter.com/docusaurus' ,
} ,
{
html : `
2020-01-01 10:23:57 -05:00
< a href = "https://www.netlify.com" target = "_blank" rel = "noreferrer noopener" aria - label = "Deploys by Netlify" >
2022-01-22 20:57:31 -05:00
< img src = "https://www.netlify.com/img/global/badges/netlify-color-accent.svg" alt = "Deploys by Netlify" width = "114" height = "51" / >
2020-01-01 10:23:57 -05:00
< / a >
` ,
2023-04-21 06:00:09 -04:00
} ,
] ,
} ,
{
title : 'Legal' ,
// Please don't remove the privacy and terms, it's a legal
// requirement.
items : [
{
label : 'Privacy' ,
href : 'https://opensource.facebook.com/legal/privacy/' ,
} ,
{
label : 'Terms' ,
href : 'https://opensource.facebook.com/legal/terms/' ,
} ,
{
label : 'Data Policy' ,
href : 'https://opensource.facebook.com/legal/data-policy/' ,
} ,
{
label : 'Cookie Policy' ,
href : 'https://opensource.facebook.com/legal/cookie-policy/' ,
} ,
] ,
} ,
] ,
logo : {
alt : 'Meta Open Source Logo' ,
src : '/img/meta_opensource_logo_negative.svg' ,
href : 'https://opensource.fb.com' ,
2021-09-01 06:14:40 -04:00
} ,
2023-04-21 06:00:09 -04:00
copyright : ` Copyright © ${ new Date ( ) . getFullYear ( ) } Meta Platforms, Inc. Built with Docusaurus. ` ,
2020-04-22 00:30:03 -04:00
} ,
2023-04-21 06:00:09 -04:00
} ) ,
} ;
2021-09-30 11:49:44 -04:00
} ;