diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 910a12d1db..e930b13c73 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -1,50 +1,86 @@ +const container = require('markdown-it-container') + 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: { - sidebar: [ - '/3.x.x/en/', - { - title: 'advanced', - children: [ - '/3.x.x/en/advanced/customize-admin', - '/3.x.x/en/advanced/hooks', - '/3.x.x/en/advanced/logging', - '/3.x.x/en/advanced/middlewares', - '/3.x.x/en/advanced/usage-tracking', - ] - }, - { - title: 'api-reference', - children: [ - '/3.x.x/en/api-reference/reference', - ] - }, - '/3.x.x/en/cli/CLI', - '/3.x.x/en/concepts/concepts', - '/3.x.x/en/configurations/configurations', - { - title: 'Getting started', - children: [ - '/3.x.x/en/getting-started/installation', - '/3.x.x/en/getting-started/quick-start', - ] - }, - { - title: 'Guides', - children: [ - '/3.x.x/en/guides/authentication', - '/3.x.x/en/guides/controllers', - '/3.x.x/en/guides/deployment', - '/3.x.x/en/guides/email', - '/3.x.x/en/guides/filters', - '/3.x.x/en/guides/graphql', - '/3.x.x/en/guides/i18n', - '/3.x.x/en/guides/models', - '/3.x.x/en/guides/policies', - '/3.x.x/en/guides/public-assets', - '/3.x.x/en/guides/requests', - '/3.x.x/en/guides/requests', - ] - }, - ], + // base: '/', + // host: 'localhost', + serviceWorker: true, + sidebar: { + '/3.x.x/': [ + { + collapsable: false, + title: 'UsefulLinks', + children: [ + ['/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'], + ], + }, + { + collapsable: false, + title: 'advanced', + children: [ + '/3.x.x/advanced/customize-admin', + '/3.x.x/advanced/hooks', + '/3.x.x/advanced/logging', + '/3.x.x/advanced/middlewares', + '/3.x.x/advanced/usage-tracking', + ], + }, + '/3.x.x/api-reference/reference', + '/3.x.x/cli/CLI', + '/3.x.x/concepts/concepts', + '/3.x.x/configurations/configurations', + { + collapsable: false, + title: 'Getting started', + children: ['/3.x.x/getting-started/installation', '/3.x.x/getting-started/quick-start'], + }, + { + collapsable: false, + title: 'Guides', + children: [ + '/3.x.x/guides/authentication', + '/3.x.x/guides/controllers', + '/3.x.x/guides/deployment', + '/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 `
\n` + } else { + return `
\n` + } + } + }] +} diff --git a/docs/package.json b/docs/package.json index 149e5d6cc0..9fbfe0f51e 100644 --- a/docs/package.json +++ b/docs/package.json @@ -10,6 +10,10 @@ "license": "ISC", "dependencies": { "directory-tree": "^2.1.0", + "markdown-it-decorate": "^1.2.2", "vuepress": "^0.14.2" + }, + "devDependencies": { + "markdown-it-container": "^2.0.0" } }