mirror of
https://github.com/strapi/strapi.git
synced 2025-10-11 08:02:55 +00:00
added sidebar config and custom markdown directives
This commit is contained in:
parent
77e73cbc19
commit
add86f2597
@ -1,50 +1,86 @@
|
|||||||
|
const container = require('markdown-it-container')
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
markdown: {
|
||||||
|
anchor: {
|
||||||
|
permalink: false,
|
||||||
|
},
|
||||||
|
config: md => {
|
||||||
|
md
|
||||||
|
.use(require('markdown-it-decorate'))
|
||||||
|
.use(...createContainer('intro'))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
title: 'Strapi Docs',
|
||||||
|
description: 'API creation made simple, secure and fast.',
|
||||||
themeConfig: {
|
themeConfig: {
|
||||||
sidebar: [
|
// base: '/',
|
||||||
'/3.x.x/en/',
|
// host: 'localhost',
|
||||||
{
|
serviceWorker: true,
|
||||||
title: 'advanced',
|
sidebar: {
|
||||||
children: [
|
'/3.x.x/': [
|
||||||
'/3.x.x/en/advanced/customize-admin',
|
{
|
||||||
'/3.x.x/en/advanced/hooks',
|
collapsable: false,
|
||||||
'/3.x.x/en/advanced/logging',
|
title: 'UsefulLinks',
|
||||||
'/3.x.x/en/advanced/middlewares',
|
children: [
|
||||||
'/3.x.x/en/advanced/usage-tracking',
|
['/3.x.x/', 'Introduction'],
|
||||||
]
|
['https://strapi.io', 'Strapi Website'],
|
||||||
},
|
['https://github.com/strapi/strapi', 'GitHub Repository'],
|
||||||
{
|
['https://github.com/strapi/strapi/blob/master/CONTRIBUTING.md', 'Contribution Guide'],
|
||||||
title: 'api-reference',
|
],
|
||||||
children: [
|
},
|
||||||
'/3.x.x/en/api-reference/reference',
|
{
|
||||||
]
|
collapsable: false,
|
||||||
},
|
title: 'advanced',
|
||||||
'/3.x.x/en/cli/CLI',
|
children: [
|
||||||
'/3.x.x/en/concepts/concepts',
|
'/3.x.x/advanced/customize-admin',
|
||||||
'/3.x.x/en/configurations/configurations',
|
'/3.x.x/advanced/hooks',
|
||||||
{
|
'/3.x.x/advanced/logging',
|
||||||
title: 'Getting started',
|
'/3.x.x/advanced/middlewares',
|
||||||
children: [
|
'/3.x.x/advanced/usage-tracking',
|
||||||
'/3.x.x/en/getting-started/installation',
|
],
|
||||||
'/3.x.x/en/getting-started/quick-start',
|
},
|
||||||
]
|
'/3.x.x/api-reference/reference',
|
||||||
},
|
'/3.x.x/cli/CLI',
|
||||||
{
|
'/3.x.x/concepts/concepts',
|
||||||
title: 'Guides',
|
'/3.x.x/configurations/configurations',
|
||||||
children: [
|
{
|
||||||
'/3.x.x/en/guides/authentication',
|
collapsable: false,
|
||||||
'/3.x.x/en/guides/controllers',
|
title: 'Getting started',
|
||||||
'/3.x.x/en/guides/deployment',
|
children: ['/3.x.x/getting-started/installation', '/3.x.x/getting-started/quick-start'],
|
||||||
'/3.x.x/en/guides/email',
|
},
|
||||||
'/3.x.x/en/guides/filters',
|
{
|
||||||
'/3.x.x/en/guides/graphql',
|
collapsable: false,
|
||||||
'/3.x.x/en/guides/i18n',
|
title: 'Guides',
|
||||||
'/3.x.x/en/guides/models',
|
children: [
|
||||||
'/3.x.x/en/guides/policies',
|
'/3.x.x/guides/authentication',
|
||||||
'/3.x.x/en/guides/public-assets',
|
'/3.x.x/guides/controllers',
|
||||||
'/3.x.x/en/guides/requests',
|
'/3.x.x/guides/deployment',
|
||||||
'/3.x.x/en/guides/requests',
|
'/3.x.x/guides/email',
|
||||||
]
|
'/3.x.x/guides/filters',
|
||||||
},
|
'/3.x.x/guides/graphql',
|
||||||
],
|
'/3.x.x/guides/i18n',
|
||||||
|
'/3.x.x/guides/models',
|
||||||
|
'/3.x.x/guides/policies',
|
||||||
|
'/3.x.x/guides/public-assets',
|
||||||
|
'/3.x.x/guides/requests',
|
||||||
|
'/3.x.x/guides/requests',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function createContainer(className) {
|
||||||
|
return [container, className, {
|
||||||
|
render(tokens, idx) {
|
||||||
|
const token = tokens[idx]
|
||||||
|
if (token.nesting === 1) {
|
||||||
|
return `<div class="${className} custom-block">\n`
|
||||||
|
} else {
|
||||||
|
return `</div>\n`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
@ -10,6 +10,10 @@
|
|||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"directory-tree": "^2.1.0",
|
"directory-tree": "^2.1.0",
|
||||||
|
"markdown-it-decorate": "^1.2.2",
|
||||||
"vuepress": "^0.14.2"
|
"vuepress": "^0.14.2"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"markdown-it-container": "^2.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user