[v2] how can i create a docsVersionDropdown
See original GitHub issueThis is my docusaurus.config.js
:
const path = require('path');
const versions = require('./versions.json');
const allDocHomesPaths = [
'/docs/',
'/docs/next',
...versions.map((version) => `/docs/${version}/`),
];
module.exports = {
title: 'anyRTC 实时音视频云Web SDK',
tagline: 'ArRTC for Web SDK',
url: 'http://docs.anyrtc.io',
baseUrl: '/v4/rtc-web/',
favicon: 'img/favicon.ico',
organizationName: 'anyRTC', // Usually your GitHub org/user name.
projectName: 'rtc-web', // Usually your repo name.
themeConfig: {
navbar: {
hideOnScroll: true,
title: 'anyRTC',
logo: {
alt: 'anyRTC Logo',
src: 'img/favicon.ico',
srcDark: 'img/docusaurus_keytar.svg',
},
items: [
// {
// label: versions[0],
// position: 'left', // or 'right'
// items: function (path) {
// // redirect to /docs from /docs/introduction,
// // as introduction has been made the home doc
// let itemsPath = [];
// versions.map((version) => {
// itemsPath.push({
// label: version,
// to: 'docs/' + version,
// })
// });
// return itemsPath;
// }(),
// },
{
type: 'docsVersionDropdown',
position: 'left',
nextVersionLabel: '2.0.0-next',
},
{
to: 'docs/',
activeBasePath: 'docs',
label: 'Docs',
position: 'right',
},
{
to: 'docs/api/overview',
activeBasePath: 'api',
label: 'API',
position: 'right',
},
// {to: 'blog', label: 'Blog', position: 'right'},
{
href: 'https://github.com/facebook/docusaurus',
label: 'GitHub',
position: 'right',
},
// {
// to: '/versions',
// label: 'All versions',
// position: 'right',
// },
]
},
algolia: {
apiKey: '5789ff188e53e9c3a53bf5a461bfeba4',
indexName: 'anyrtc',
appId: '3PL7UR0LOP', // Optional, if you run the DocSearch crawler on your own
algoliaOptions: {
// searchParameters: {
// facetFilters: [`version:${versions[0]}`],
// },
}, // Optional, if provided by Algolia
},
footer: {
style: 'dark',
links: [
{
title: '文档',
items: [
{
label: '产品概述',
to: 'docs/',
},
{
label: '快速开始',
to: 'docs/setup',
},
{
label: 'API',
to: 'docs/api/overview',
},
],
},
{
title: 'RTC其他平台',
items: [
{
label: 'RTC Web SDK',
href: 'https://docs.anyrtc.io/v4/rtc-web',
},
{
label: 'RTC Android SDK',
href: 'https://docs.anyrtc.io/v4/rtc-android',
},
{
label: 'RTC iOS&Mac SDK',
href: 'https://docs.anyrtc.io/v4/rtc-android',
},
{
label: 'RTC window SDK',
href: 'https://docs.anyrtc.io/v4/rtc-window',
},
],
},
{
title: 'RTM其他平台',
items: [
{
label: 'RTM Web SDK',
href: 'https://docs.anyrtc.io/v4/rtm-web',
},
{
label: 'RTM Android SDK',
href: 'https://docs.anyrtc.io/v4/rtm-android',
},
{
label: 'RTM iOS&Mac SDK',
href: 'https://docs.anyrtc.io/v4/rtm-android',
},
{
label: 'RTM window SDK',
href: 'https://docs.anyrtc.io/v4/rtm-window',
},
],
},
{
title: '更多',
items: [
{
label: 'GitHub',
href: 'https://github.com/facebook/docusaurus',
},
{
label: 'anyRTC',
href: 'https://www.anyrtc.io',
}
],
},
],
logo: {
alt: 'anyRTC Logo',
src: 'img/anyrtc_logo.png',
href: 'https://www.anyrtc.io',
},
copyright: `Copyright © ${new Date().getFullYear()} anyrtc.`,
},
},
plugins: [
[
'@docusaurus/plugin-client-redirects',
{
fromExtensions: ['html'],
createRedirects: function (path) {
// redirect to /docs from /docs/introduction,
// as introduction has been made the home doc
if (allDocHomesPaths.includes(path)) {
return [`${path}/introduction`];
}
},
},
]
],
presets: [
[
'@docusaurus/preset-classic',
{
docs: {
// It is recommended to set document id as docs home page (`docs/` path).
homePageId: 'overview',
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
// editUrl:
// 'https://github.com/facebook/docusaurus/edit/master/website/',
},
// blog: {
// showReadingTime: true,
// // Please change this to your repo.
// editUrl:
// 'https://github.com/facebook/docusaurus/edit/master/website/blog/',
// },
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
},
],
],
};
Has anyone come to help?
Issue Analytics
- State:
- Created 3 years ago
- Comments:17
Top Results From Across the Web
Versioning - Docusaurus
First, make sure the current docs version (the ./docs directory) is ready to be frozen. Enter a new version number. npm; Yarn. npm...
Read more >Add a Version Dropdown in Tutorial needs more explanation
The section Add a Version Dropdown in the Tutorial needs more explanation. It needs to be stressed that the changes to make to...
Read more >Manage Docs Versions | jsPlumb Documentation
Docusaurus can manage multiple versions of your docs. ... The docs folder is copied into versioned_docs/version-1.0 and versions.json is created.
Read more >Create an Application | BuildPiper Docs
Docs Version Dropdown. Here are the steps for creating an application. 1. Give a unique name to your application. 2. Enter the application...
Read more >docusaurus-plugin-typedoc-api - npm
Our API is unable to use the docsVersionDropdown navigation type, as it's hardcoded in Docusaurus core. However, you can create a custom version ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
sure,I really appreciate your help :), I’ll check the problem by my self. Keep safety.
Thanks for your reply. Because my English is not very good, So I can not find a good solution, but I will always pay attention to you and the official documents. : )
Thanks again.