From b30a1317eece40f7789d54aa197b67e4ff612d2f Mon Sep 17 00:00:00 2001 From: soupette Date: Wed, 8 Dec 2021 10:46:38 +0100 Subject: [PATCH 1/9] Init create config file Signed-off-by: soupette --- docs/.vuepress/config-backup.js | 926 +++++++++ docs/.vuepress/config.js | 1700 +++++++++-------- .../latest/developer-resources/cli/CLI.md | 2 +- docs/package.json | 3 +- docs/scripts/create-config-file.js | 951 +++++++++ docs/tmp.md | 7 + 6 files changed, 2743 insertions(+), 846 deletions(-) create mode 100644 docs/.vuepress/config-backup.js create mode 100644 docs/scripts/create-config-file.js create mode 100644 docs/tmp.md diff --git a/docs/.vuepress/config-backup.js b/docs/.vuepress/config-backup.js new file mode 100644 index 0000000000..661fbb9d2e --- /dev/null +++ b/docs/.vuepress/config-backup.js @@ -0,0 +1,926 @@ +const sidebar = { + developer: [ + { + title: '🚀 Getting Started', + collapsable: false, + children: [ + ['/developer-docs/latest/getting-started/introduction', 'Introduction'], + ['/developer-docs/latest/getting-started/quick-start', 'Quick Start Guide'], + ['/developer-docs/latest/getting-started/troubleshooting', 'Frequently Asked Questions'], + ['/developer-docs/latest/getting-started/usage-information', 'Usage Information'], + ], + }, + { + title: '⚙️ Setup & Deployment', + collapsable: false, + sidebarDepth: 0, + initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default + children: [ + { + title: 'Installation', + path: '/developer-docs/latest/setup-deployment-guides/installation.html', + collapsable: true, + sidebarDepth: 1, + children: [ + ['/developer-docs/latest/setup-deployment-guides/installation/cli.md', 'CLI'], + ['/developer-docs/latest/setup-deployment-guides/installation/docker.md', 'Docker'], + [ + '/developer-docs/latest/setup-deployment-guides/installation/digitalocean-one-click.md', + 'DigitalOcean One-Click', + ], + [ + '/developer-docs/latest/setup-deployment-guides/installation/platformsh.md', + 'Platform.sh One-Click', + ], + [ + '/developer-docs/latest/setup-deployment-guides/installation/render.md', + 'Render One-Click', + ], + ], + }, + ['/developer-docs/latest/setup-deployment-guides/file-structure.md', 'Project structure'], + { + title: 'Configurations', + path: '/developer-docs/latest/setup-deployment-guides/configurations.html', + collapsable: true, + children: [ + { + title: 'Required configurations', + collapsable: true, + children: [ + [ + '/developer-docs/latest/setup-deployment-guides/configurations/required/databases.md', + 'Database', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/required/server.md', + 'Server', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/required/admin-panel.md', + 'Admin panel', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/required/middlewares.md', + 'Middlewares', + ], + ], + }, + { + title: 'Optional configurations', + collapsable: true, + children: [ + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/api-tokens.md', + 'API tokens', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/functions.md', + 'Functions', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/cronjobs.md', + 'Cron jobs', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/api.md', + 'API', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/plugins.md', + 'Plugins', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.md', + 'Environment', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/public-assets.md', + 'Public Assets', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md', + 'Single Sign On (SSO)', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/rbac.md', + 'Role-Based Access Control (RBAC)', + ], + ], + }, + ], + }, + { + title: 'Deployment', + path: '/developer-docs/latest/setup-deployment-guides/deployment', + collapsable: true, + initialOpenGroupIndex: -1, // make sure that no subgroup is open by default — if set to 0, 'Hosting Provider Guides' is expanded + children: [ + { + title: 'Hosting Provider Guides', + path: + '/developer-docs/latest/setup-deployment-guides/deployment.html#hosting-provider-guides', + collapsable: true, + children: [ + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/21yunbox.md', + '21YunBox', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/amazon-aws.md', + 'Amazon AWS', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/azure.md', + 'Azure', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean-app-platform.md', + 'DigitalOcean App Platform', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean.md', + 'DigitalOcean Droplets', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/google-app-engine.md', + 'Google App Engine', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/heroku.md', + 'Heroku', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/qovery.md', + 'Qovery', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/render.md', + 'Render', + ], + ], + sidebarDepth: 2, + }, + { + title: 'Optional Software Guides', + path: + '/developer-docs/latest/setup-deployment-guides/deployment.html#optional-software-guides', + collapsable: true, + children: [ + [ + '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/caddy-proxy.md', + 'Caddy', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/haproxy-proxy.md', + 'HAProxy', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/nginx-proxy.md', + 'Nginx', + ], + ], + sidebarDepth: 2, + }, + ], + sidebarDepth: 0, + }, + ], + }, + { + title: '🔧 Development', + collapsable: false, + initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default + children: [ + { + title: 'Back-end customization', + collapsable: true, + path: '/developer-docs/latest/development/backend-customization', + children: [ + ['/developer-docs/latest/development/backend-customization/routes.md', 'Routes'], + ['/developer-docs/latest/development/backend-customization/policies.md', 'Policies'], + [ + '/developer-docs/latest/development/backend-customization/middlewares.md', + 'Middlewares', + ], + [ + '/developer-docs/latest/development/backend-customization/controllers.md', + 'Controllers', + ], + [ + '/developer-docs/latest/development/backend-customization/requests-responses.md', + 'Requests & Responses', + ], + ['/developer-docs/latest/development/backend-customization/services.md', 'Services'], + ['/developer-docs/latest/development/backend-customization/models.md', 'Models'], + ['/developer-docs/latest/development/backend-customization/webhooks.md', 'Webhooks'], + ], + }, + ['/developer-docs/latest/development/admin-customization', 'Admin panel customization'], + ['/developer-docs/latest/development/plugins-extension.md', 'Plugins extension'], + ['/developer-docs/latest/development/plugins-development.md', 'Plugins development'], + ], + }, + { + title: '💻 Developer Resources', + collapsable: false, + initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default + sidebarDepth: 2, + children: [ + { + title: 'APIs Reference', + collapsable: true, + sidebarDepth: 1, + children: [ + [ + '/developer-docs/latest/developer-resources/database-apis-reference/rest-api.md', + 'REST API', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/graphql-api.md', + 'GraphQL API', + ], + { + title: 'Query Engine API', + path: + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine-api.html', + collapsable: true, + // sidebarDepth: 3, + children: [ + [ + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/single-operations.md', + 'Single Operations', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/bulk-operations.md', + 'Bulk Operations', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/filtering.md', + 'Filtering', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/populating.md', + 'Populating', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/order-pagination.md', + 'Ordering & pagination', + ], + ], + }, + { + title: 'Entity Service API', + path: + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service-api', + collapsable: true, + children: [ + [ + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/crud.md', + 'CRUD operations', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/filter.md', + 'Filters', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/populate.md', + 'Populate', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/order-pagination.md', + 'Ordering & pagination', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/components-dynamic-zones.md', + 'Components and dynamic zones', + ], + ], + }, + { + title: 'Plugin APIs Reference', + collapsable: true, + children: [ + [ + '/developer-docs/latest/developer-resources/plugin-api-reference/server.md', + 'Server API for plugins', + ], + [ + '/developer-docs/latest/developer-resources/plugin-api-reference/admin-panel.md', + 'Admin Panel API for plugins', + ], + ], + }, + ], + }, + ['/developer-docs/latest/developer-resources/cli/CLI', 'Command Line Interface'], + ['/developer-docs/latest/developer-resources/error-handling.md', 'Error handling'], + { + title: 'Integrations', + path: '/developer-docs/latest/developer-resources/content-api/integrations.html', + collapsable: true, + sidebarDepth: 1, + children: [ + ['/developer-docs/latest/developer-resources/content-api/integrations/react', 'React'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/vue-js', + 'Vue.js', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/angular', + 'Angular', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/next-js', + 'Next.js', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/nuxt-js', + 'Nuxt.js', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/graphql', + 'GraphQL', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/gatsby', + 'Gatsby', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/gridsome', + 'Gridsome', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/jekyll', + 'Jekyll', + ], + ['/developer-docs/latest/developer-resources/content-api/integrations/11ty', '11ty'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/svelte', + 'Svelte', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/sapper', + 'Sapper', + ], + ['/developer-docs/latest/developer-resources/content-api/integrations/ruby', 'Ruby'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/python', + 'Python', + ], + ['/developer-docs/latest/developer-resources/content-api/integrations/dart', 'Dart'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/flutter', + 'Flutter', + ], + ['/developer-docs/latest/developer-resources/content-api/integrations/go', 'Go'], + ['/developer-docs/latest/developer-resources/content-api/integrations/php', 'PHP'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/laravel', + 'Laravel', + ], + ], + }, + ], + }, + { + title: '🧩 Strapi plugins', + path: '/developer-docs/latest/plugins/plugins-intro.html', + collapsable: false, + children: [ + ['/developer-docs/latest/plugins/graphql', 'GraphQL'], + ['/developer-docs/latest/plugins/i18n', 'Internationalization (i18n)'], + ['/developer-docs/latest/plugins/users-permissions', 'Users & Permissions'], + ['/developer-docs/latest/plugins/email', 'Email'], + ['/developer-docs/latest/plugins/upload', 'Upload'], + ['/developer-docs/latest/plugins/documentation', 'API Documentation'], + ], + sidebarDepth: 1, + }, + { + title: '♻️ Update & Migration', + collapsable: false, + children: [ + ['/developer-docs/latest/update-migration-guides/update-version.md', 'Update'], + ['/developer-docs/latest/update-migration-guides/migration-guides.md', 'Migration'], + ], + }, + { + title: '📚 Guides', + collapsable: true, + children: [ + ['/developer-docs/latest/guides/auth-request', 'Authenticated request'], + // ['/developer-docs/latest/guides/slug', 'Create a slug system'], + // ['/developer-docs/latest/guides/is-owner', 'Create is owner policy'], + // ['/developer-docs/latest/guides/custom-admin', 'Custom admin'], + // ['/developer-docs/latest/guides/custom-data-response', 'Custom data response'], + ['/developer-docs/latest/guides/draft', 'Draft system'], + // ['/developer-docs/latest/guides/error-catching', 'Error catching'], + // ['/developer-docs/latest/guides/external-data', 'Fetching external data'], + ['/developer-docs/latest/guides/jwt-validation', 'JWT validation'], + ['/developer-docs/latest/guides/process-manager', 'Process manager'], + ['/developer-docs/latest/guides/scheduled-publication', 'Scheduled publication'], + // ['/developer-docs/latest/guides/secure-your-app', 'Secure your application'], + // ['/developer-docs/latest/guides/send-email', 'Send email programmatically'], + // [ + // '/developer-docs/latest/guides/registering-a-field-in-admin', + // 'Registering a new field in the admin panel', + // ], + // ['/developer-docs/latest/guides/client', 'Setup a third party client'], + ['/developer-docs/latest/guides/unit-testing', 'Unit testing'], + ], + }, + ], + user: [ + { + collapsable: false, + title: '', + children: [ + ['/user-docs/latest/getting-started/introduction', 'Welcome to the Strapi user guide!'], + ], + }, + { + collapsable: false, + title: 'Content Manager', + children: [ + [ + '/user-docs/latest/content-manager/introduction-to-content-manager', + 'Introduction to the Content Manager', + ], + [ + '/user-docs/latest/content-manager/configuring-view-of-content-type', + 'Configuring the views of a content type', + ], + ['/user-docs/latest/content-manager/writing-content', 'Writing content'], + [ + '/user-docs/latest/content-manager/managing-relational-fields', + 'Managing relational fields', + ], + ['/user-docs/latest/content-manager/translating-content', 'Translating content'], + [ + '/user-docs/latest/content-manager/saving-and-publishing-content', + 'Saving, publishing and deleting content', + ], + ], + }, + { + collapsable: false, + title: 'Content-Type Builder', + children: [ + [ + '/user-docs/latest/content-types-builder/introduction-to-content-types-builder', + 'Introduction to the Content-Type Builder', + ], + [ + '/user-docs/latest/content-types-builder/creating-new-content-type', + 'Creating content types', + ], + [ + '/user-docs/latest/content-types-builder/managing-content-types', + 'Managing content types', + ], + [ + '/user-docs/latest/content-types-builder/configuring-fields-content-type', + 'Configuring fields for content types', + ], + ], + }, + { + collapsable: false, + title: 'Users, Roles & Permissions', + children: [ + [ + '/user-docs/latest/users-roles-permissions/introduction-to-users-roles-permissions', + 'Introduction to users, roles & permissions', + ], + [ + '/user-docs/latest/users-roles-permissions/configuring-administrator-roles', + 'Configuring administrator roles', + ], + [ + '/user-docs/latest/users-roles-permissions/managing-administrators', + 'Managing administrator accounts', + ], + [ + '/user-docs/latest/users-roles-permissions/configuring-end-users-roles', + 'Configuring end-users roles', + ], + [ + '/user-docs/latest/users-roles-permissions/managing-end-users', + 'Managing end-users accounts', + ], + ], + }, + { + collapsable: false, + title: 'Plugins', + children: [ + ['/user-docs/latest/plugins/introduction-to-plugins', 'Introduction to plugins'], + [ + '/user-docs/latest/plugins/installing-plugins-via-marketplace', + 'Installing plugins via the Marketplace', + ], + ['/user-docs/latest/plugins/strapi-plugins', 'List of Strapi plugins'], + ], + }, + { + collapsable: false, + title: 'General settings', + children: [ + ['/user-docs/latest/settings/managing-global-settings', 'Managing global settings'], + [ + '/user-docs/latest/settings/configuring-users-permissions-plugin-settings', + 'Configuring Users & Permissions plugin settings', + ], + ], + }, + ], +}; + +const checklinksIgnoredFiles = [ + '**/node_modules', // please never remove this one + /** + * Caution: Adding an individual file to this section + * will prevent the _whole_ file from being scanned for broken links. + * + * Currently, there is no easy way to ignore a specific link inside a file. + */ + + /** + * Files below give false positives + */ + '/developer-docs/latest/developer-resources/plugin-api-reference/admin-panel.md', + './developer-docs/latest/development/backend-customization/models.md', + './developer-docs/latest/guides/count-graphql.md', // might be removed once GraphQL customization is ready + './developer-docs/latest/setup-deployment-guides/configurations.md', // the script thinks filename[]() at line 977 is a real link + './developer-docs/latest/development/backend-customization/webhooks.md', // 'missing" links are in commented part of file +]; + +const plugins = [ + ['vuepress-plugin-element-tabs', {}], + [ + 'check-md', + { + ignore: checklinksIgnoredFiles, + }, + ], + [ + 'seo', + { + siteTitle: (_, $site) => $site.title, + title: $page => $page.title, + }, + ], + ['@vuepress/medium-zoom'], + [ + 'vuepress-plugin-code-copy', + { + color: '#ffffff', + successText: 'Copied to clipboard!', + }, + ], + ['@vuepress/back-to-top', {}], + [ + 'vuepress-plugin-container', + { + type: 'callout', + defaultTitle: '', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'strapi', + defaultTitle: '', + before: info => + `

🤓 ${info}

`, + after: '
', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'tip', + before: info => `

💡 ${info}

`, + after: '
', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'note', + before: info => `

✏️ ${info}

`, + after: '
', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'caution', + before: info => + `

✋ ${info}

`, + after: '
', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'warning', + before: info => + `

️❗️ ${info}

`, + after: '
', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'prerequisites', + defaultTitle: 'PREREQUISITES', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'api-call', + defaultTitle: '', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'request', + defaultTitle: 'Request', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'response', + defaultTitle: 'Response', + }, + ], +]; + +module.exports = { + title: '', + port: 8080, + description: 'The headless CMS developers love.', + base: '/', + plugins: plugins, + head: [ + [ + 'link', + { + rel: 'icon', + href: 'https://strapi.io/assets/favicon-32x32.png', + }, + ], + [ + 'meta', + { + property: 'og:title', + content: 'Strapi Documentation', + }, + ], + [ + 'meta', + { + property: 'og:type', + content: 'article', + }, + ], + [ + 'meta', + { + property: 'og:url', + content: 'https://strapi.io/documentation/', + }, + ], + [ + 'meta', + { + property: 'og:description', + content: 'The headless CMS developers love.', + }, + ], + [ + 'meta', + { + property: 'og:image', + content: 'https://strapi.io/documentation/assets/meta.png', + }, + ], + [ + 'meta', + { + property: 'og:article:author', + content: 'strapi', + }, + ], + + [ + 'meta', + { + property: 'twitter:card', + content: 'summary_large_image', + }, + ], + [ + 'meta', + { + property: 'twitter:url', + content: 'https://strapi.io/documentation/', + }, + ], + [ + 'meta', + { + property: 'twitter:site', + content: '@strapijs', + }, + ], + [ + 'meta', + { + property: 'twitter:title', + content: 'Strapi Documentation', + }, + ], + [ + 'meta', + { + property: 'twitter:description', + content: 'The headless CMS developers love.', + }, + ], + [ + 'meta', + { + property: 'twitter:image', + content: 'http://strapi.io/assets/images/strapi-website-preview.png', + }, + ], + [ + 'script', + {}, + `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-KN9JRWG');`, + ], + ], + themeConfig: { + logo: '/assets/logo.png', + nav: [ + { + text: 'Resource Center', + link: 'https://strapi.io/resource-center', + }, + { + text: 'v4 Documentation', + items: [ + { + text: 'Developer Docs', + items: [ + { + text: 'Getting Started', + link: '/developer-docs/latest/getting-started/introduction.html', + }, + { + text: 'Setup & Deployment', + link: '/developer-docs/latest/setup-deployment-guides/installation.html', + }, + { + text: 'Plugins', + link: '/developer-docs/latest/plugins/plugins-intro.html', + }, + { + text: 'Development', + link: '/developer-docs/latest/development/backend-customization.html', + }, + { + text: 'Update & Migration', + link: '/developer-docs/latest/update-migration-guides/update-version.html', + }, + { + text: 'Developer Resources', + link: '/developer-docs/latest/developer-resources/content-api/content-api.html', + }, + ], + }, + { + text: 'User Guide', + items: [ + { + text: 'Getting Started', + link: '/user-docs/latest/getting-started/introduction.html', + }, + { + text: 'Content Manager', + link: '/user-docs/latest/content-manager/introduction-to-content-manager.html', + }, + { + text: 'Content-Type Builder', + link: + '/user-docs/latest/content-types-builder/introduction-to-content-types-builder.html', + }, + { + text: 'Users, Roles, and Permissions', + link: + '/user-docs/latest/users-roles-permissions/introduction-to-users-roles-permissions.html', + }, + { + text: 'Plugins', + link: '/user-docs/latest/plugins/introduction-to-plugins.html', + }, + { + text: 'General Settings', + link: '/user-docs/latest/settings/managing-global-settings.html', + }, + ], + }, + ], + }, + { + text: 'v3 documentation', + link: 'https://docs-v3.strapi.io', + }, + { + text: 'Ecosystem', + items: [ + { + text: 'Strapi', + items: [ + { + text: 'Website', + link: 'https://strapi.io', + }, + { + text: 'Blog', + link: 'https://strapi.io/blog', + }, + { + text: 'StrapiConf 2021', + link: 'https://www.strapi.io/strapi-conf-2021', + }, + ], + }, + { + text: 'Community', + items: [ + { + text: 'Forum', + link: 'https://forum.strapi.io', + }, + { + text: 'Discord', + link: 'https://discord.strapi.io', + }, + { + text: 'Awesome-Strapi', + link: 'https://github.com/strapi/awesome-strapi', + }, + ], + }, + { + text: 'Resources', + items: [ + { + text: 'Tutorials', + link: 'https://strapi.io/tutorials', + }, + { + text: 'Academy', + link: 'https://academy.strapi.io/', + }, + ], + }, + ], + }, + { + text: "We're hiring!", + link: 'https://strapi.io/careers#open-positions', + }, + ], + repo: 'strapi/documentation', + docsDir: 'docs', + docsBranch: 'main', + algolia: { + appId: '9FTY6J9E4X', + apiKey: 'cf49c82a1865df2618a3d89e18657051', + indexName: 'documentation', + }, + editLinks: true, + editLinkText: 'Improve this page', + serviceWorker: true, + sidebarDepth: 1, + smoothScroll: false, + sidebar: { + '/developer-docs/latest/': sidebar.developer, + '/user-docs/latest/': sidebar.user, + }, + }, + markdown: { + extendMarkdown: md => { + // use more markdown-it plugins! + md.use(require('markdown-it-include')); + }, + }, +}; diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 06da6e6ee8..a4d39f5a52 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -1,926 +1,938 @@ -const sidebar = { - developer: [ - { - title: '🚀 Getting Started', - collapsable: false, - children: [ - ['/developer-docs/latest/getting-started/introduction', 'Introduction'], - ['/developer-docs/latest/getting-started/quick-start', 'Quick Start Guide'], - ['/developer-docs/latest/getting-started/troubleshooting', 'Frequently Asked Questions'], - ['/developer-docs/latest/getting-started/usage-information', 'Usage Information'], - ], - }, - { - title: '⚙️ Setup & Deployment', - collapsable: false, - sidebarDepth: 0, - initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default - children: [ - { - title: 'Installation', - path: '/developer-docs/latest/setup-deployment-guides/installation.html', - collapsable: true, - sidebarDepth: 1, - children: [ - ['/developer-docs/latest/setup-deployment-guides/installation/cli.md', 'CLI'], - ['/developer-docs/latest/setup-deployment-guides/installation/docker.md', 'Docker'], - [ - '/developer-docs/latest/setup-deployment-guides/installation/digitalocean-one-click.md', - 'DigitalOcean One-Click', - ], - [ - '/developer-docs/latest/setup-deployment-guides/installation/platformsh.md', - 'Platform.sh One-Click', - ], - [ - '/developer-docs/latest/setup-deployment-guides/installation/render.md', - 'Render One-Click', - ], - ], - }, - ['/developer-docs/latest/setup-deployment-guides/file-structure.md', 'Project structure'], - { - title: 'Configurations', - path: '/developer-docs/latest/setup-deployment-guides/configurations.html', - collapsable: true, - children: [ - { - title: 'Required configurations', - collapsable: true, - children: [ - [ - '/developer-docs/latest/setup-deployment-guides/configurations/required/databases.md', - 'Database', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/required/server.md', - 'Server', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/required/admin-panel.md', - 'Admin panel', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/required/middlewares.md', - 'Middlewares', - ], + + const sidebar = { + developer: [ + { + title: '🚀 Getting Started', + collapsable: false, + children: [ + ['/developer-docs/latest/getting-started/introduction', 'Introduction'], + ['/developer-docs/latest/getting-started/quick-start', 'Quick Start Guide'], + ['/developer-docs/latest/getting-started/troubleshooting', 'Frequently Asked Questions'], + ['/developer-docs/latest/getting-started/usage-information', 'Usage Information'], + ], + }, + { + title: '⚙️ Setup & Deployment', + collapsable: false, + sidebarDepth: 0, + initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default + children: [ + { + title: 'Installation', + path: '/developer-docs/latest/setup-deployment-guides/installation.html', + collapsable: true, + sidebarDepth: 1, + children: [ + ['/developer-docs/latest/setup-deployment-guides/installation/cli.md', 'CLI'], + ['/developer-docs/latest/setup-deployment-guides/installation/docker.md', 'Docker'], + [ + '/developer-docs/latest/setup-deployment-guides/installation/digitalocean-one-click.md', + 'DigitalOcean One-Click', ], - }, - { - title: 'Optional configurations', - collapsable: true, - children: [ - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/api-tokens.md', - 'API tokens', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/functions.md', - 'Functions', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/cronjobs.md', - 'Cron jobs', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/api.md', - 'API', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/plugins.md', - 'Plugins', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.md', - 'Environment', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/public-assets.md', - 'Public Assets', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md', - 'Single Sign On (SSO)', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/rbac.md', - 'Role-Based Access Control (RBAC)', - ], + [ + '/developer-docs/latest/setup-deployment-guides/installation/platformsh.md', + 'Platform.sh One-Click', ], - }, - ], - }, - { - title: 'Deployment', - path: '/developer-docs/latest/setup-deployment-guides/deployment', - collapsable: true, - initialOpenGroupIndex: -1, // make sure that no subgroup is open by default — if set to 0, 'Hosting Provider Guides' is expanded - children: [ - { - title: 'Hosting Provider Guides', - path: - '/developer-docs/latest/setup-deployment-guides/deployment.html#hosting-provider-guides', - collapsable: true, - children: [ - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/21yunbox.md', - '21YunBox', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/amazon-aws.md', - 'Amazon AWS', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/azure.md', - 'Azure', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean-app-platform.md', - 'DigitalOcean App Platform', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean.md', - 'DigitalOcean Droplets', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/google-app-engine.md', - 'Google App Engine', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/heroku.md', - 'Heroku', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/qovery.md', - 'Qovery', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/render.md', - 'Render', - ], + [ + '/developer-docs/latest/setup-deployment-guides/installation/render.md', + 'Render One-Click', ], - sidebarDepth: 2, - }, - { - title: 'Optional Software Guides', - path: - '/developer-docs/latest/setup-deployment-guides/deployment.html#optional-software-guides', - collapsable: true, - children: [ - [ - '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/caddy-proxy.md', - 'Caddy', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/haproxy-proxy.md', - 'HAProxy', + ], + }, + ['/developer-docs/latest/setup-deployment-guides/file-structure.md', 'Project structure'], + { + title: 'Configurations', + path: '/developer-docs/latest/setup-deployment-guides/configurations.html', + collapsable: true, + children: [ + { + title: 'Required configurations', + collapsable: true, + children: [ + [ + '/developer-docs/latest/setup-deployment-guides/configurations/required/databases.md', + 'Database', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/required/server.md', + 'Server', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/required/admin-panel.md', + 'Admin panel', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/required/middlewares.md', + 'Middlewares', + ], ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/nginx-proxy.md', - 'Nginx', + }, + { + title: 'Optional configurations', + collapsable: true, + children: [ + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/api-tokens.md', + 'API tokens', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/functions.md', + 'Functions', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/cronjobs.md', + 'Cron jobs', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/api.md', + 'API', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/plugins.md', + 'Plugins', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.md', + 'Environment', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/public-assets.md', + 'Public Assets', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md', + 'Single Sign On (SSO)', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/rbac.md', + 'Role-Based Access Control (RBAC)', + ], ], - ], - sidebarDepth: 2, - }, - ], - sidebarDepth: 0, - }, - ], - }, - { - title: '🔧 Development', - collapsable: false, - initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default - children: [ - { - title: 'Back-end customization', - collapsable: true, - path: '/developer-docs/latest/development/backend-customization', - children: [ - ['/developer-docs/latest/development/backend-customization/routes.md', 'Routes'], - ['/developer-docs/latest/development/backend-customization/policies.md', 'Policies'], - [ - '/developer-docs/latest/development/backend-customization/middlewares.md', - 'Middlewares', - ], - [ - '/developer-docs/latest/development/backend-customization/controllers.md', - 'Controllers', - ], - [ - '/developer-docs/latest/development/backend-customization/requests-responses.md', - 'Requests & Responses', + }, ], - ['/developer-docs/latest/development/backend-customization/services.md', 'Services'], - ['/developer-docs/latest/development/backend-customization/models.md', 'Models'], - ['/developer-docs/latest/development/backend-customization/webhooks.md', 'Webhooks'], - ], - }, - ['/developer-docs/latest/development/admin-customization', 'Admin panel customization'], - ['/developer-docs/latest/development/plugins-extension.md', 'Plugins extension'], - ['/developer-docs/latest/development/plugins-development.md', 'Plugins development'], - ], - }, - { - title: '💻 Developer Resources', - collapsable: false, - initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default - sidebarDepth: 2, - children: [ - { - title: 'APIs Reference', - collapsable: true, - sidebarDepth: 1, - children: [ - [ - '/developer-docs/latest/developer-resources/database-apis-reference/rest-api.md', - 'REST API', + }, + { + title: 'Deployment', + path: '/developer-docs/latest/setup-deployment-guides/deployment', + collapsable: true, + initialOpenGroupIndex: -1, // make sure that no subgroup is open by default — if set to 0, 'Hosting Provider Guides' is expanded + children: [ + { + title: 'Hosting Provider Guides', + path: + '/developer-docs/latest/setup-deployment-guides/deployment.html#hosting-provider-guides', + collapsable: true, + children: [ + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/21yunbox.md', + '21YunBox', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/amazon-aws.md', + 'Amazon AWS', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/azure.md', + 'Azure', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean-app-platform.md', + 'DigitalOcean App Platform', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean.md', + 'DigitalOcean Droplets', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/google-app-engine.md', + 'Google App Engine', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/heroku.md', + 'Heroku', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/qovery.md', + 'Qovery', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/render.md', + 'Render', + ], + ], + sidebarDepth: 2, + }, + { + title: 'Optional Software Guides', + path: + '/developer-docs/latest/setup-deployment-guides/deployment.html#optional-software-guides', + collapsable: true, + children: [ + [ + '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/caddy-proxy.md', + 'Caddy', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/haproxy-proxy.md', + 'HAProxy', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/nginx-proxy.md', + 'Nginx', + ], + ], + sidebarDepth: 2, + }, ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/graphql-api.md', - 'GraphQL API', + sidebarDepth: 0, + }, + ], + }, + { + title: '🔧 Development', + collapsable: false, + initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default + children: [ + { + title: 'Back-end customization', + collapsable: true, + path: '/developer-docs/latest/development/backend-customization', + children: [ + ['/developer-docs/latest/development/backend-customization/routes.md', 'Routes'], + ['/developer-docs/latest/development/backend-customization/policies.md', 'Policies'], + [ + '/developer-docs/latest/development/backend-customization/middlewares.md', + 'Middlewares', + ], + [ + '/developer-docs/latest/development/backend-customization/controllers.md', + 'Controllers', + ], + [ + '/developer-docs/latest/development/backend-customization/requests-responses.md', + 'Requests & Responses', + ], + ['/developer-docs/latest/development/backend-customization/services.md', 'Services'], + ['/developer-docs/latest/development/backend-customization/models.md', 'Models'], + ['/developer-docs/latest/development/backend-customization/webhooks.md', 'Webhooks'], ], - { - title: 'Query Engine API', - path: - '/developer-docs/latest/developer-resources/database-apis-reference/query-engine-api.html', - collapsable: true, - // sidebarDepth: 3, - children: [ - [ - '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/single-operations.md', - 'Single Operations', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/bulk-operations.md', - 'Bulk Operations', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/filtering.md', - 'Filtering', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/populating.md', - 'Populating', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/order-pagination.md', - 'Ordering & pagination', - ], + }, + ['/developer-docs/latest/development/admin-customization', 'Admin panel customization'], + ['/developer-docs/latest/development/plugins-extension.md', 'Plugins extension'], + ['/developer-docs/latest/development/plugins-development.md', 'Plugins development'], + ], + }, + { + title: '💻 Developer Resources', + collapsable: false, + initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default + sidebarDepth: 2, + children: [ + { + title: 'APIs Reference', + collapsable: true, + sidebarDepth: 1, + children: [ + [ + '/developer-docs/latest/developer-resources/database-apis-reference/rest-api.md', + 'REST API', ], - }, - { - title: 'Entity Service API', - path: - '/developer-docs/latest/developer-resources/database-apis-reference/entity-service-api', - collapsable: true, - children: [ - [ - '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/crud.md', - 'CRUD operations', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/filter.md', - 'Filters', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/populate.md', - 'Populate', + [ + '/developer-docs/latest/developer-resources/database-apis-reference/graphql-api.md', + 'GraphQL API', + ], + { + title: 'Query Engine API', + path: + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine-api.html', + collapsable: true, + // sidebarDepth: 3, + children: [ + [ + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/single-operations.md', + 'Single Operations', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/bulk-operations.md', + 'Bulk Operations', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/filtering.md', + 'Filtering', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/populating.md', + 'Populating', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/order-pagination.md', + 'Ordering & pagination', + ], ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/order-pagination.md', - 'Ordering & pagination', + }, + { + title: 'Entity Service API', + path: + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service-api', + collapsable: true, + children: [ + [ + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/crud.md', + 'CRUD operations', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/filter.md', + 'Filters', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/populate.md', + 'Populate', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/order-pagination.md', + 'Ordering & pagination', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/components-dynamic-zones.md', + 'Components and dynamic zones', + ], ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/components-dynamic-zones.md', - 'Components and dynamic zones', + }, + { + title: 'Plugin APIs Reference', + collapsable: true, + children: [ + [ + '/developer-docs/latest/developer-resources/plugin-api-reference/server.md', + 'Server API for plugins', + ], + [ + '/developer-docs/latest/developer-resources/plugin-api-reference/admin-panel.md', + 'Admin Panel API for plugins', + ], ], + }, + ], + }, + ['/developer-docs/latest/developer-resources/cli/CLI', 'Command Line Interface'], + ['/developer-docs/latest/developer-resources/error-handling.md', 'Error handling'], + { + title: 'Integrations', + path: '/developer-docs/latest/developer-resources/content-api/integrations.html', + collapsable: true, + sidebarDepth: 1, + children: [ + ['/developer-docs/latest/developer-resources/content-api/integrations/react', 'React'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/vue-js', + 'Vue.js', ], - }, - { - title: 'Plugin APIs Reference', - collapsable: true, - children: [ - [ - '/developer-docs/latest/developer-resources/plugin-api-reference/server.md', - 'Server API for plugins', - ], - [ - '/developer-docs/latest/developer-resources/plugin-api-reference/admin-panel.md', - 'Admin Panel API for plugins', - ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/angular', + 'Angular', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/next-js', + 'Next.js', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/nuxt-js', + 'Nuxt.js', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/graphql', + 'GraphQL', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/gatsby', + 'Gatsby', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/gridsome', + 'Gridsome', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/jekyll', + 'Jekyll', + ], + ['/developer-docs/latest/developer-resources/content-api/integrations/11ty', '11ty'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/svelte', + 'Svelte', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/sapper', + 'Sapper', + ], + ['/developer-docs/latest/developer-resources/content-api/integrations/ruby', 'Ruby'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/python', + 'Python', + ], + ['/developer-docs/latest/developer-resources/content-api/integrations/dart', 'Dart'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/flutter', + 'Flutter', + ], + ['/developer-docs/latest/developer-resources/content-api/integrations/go', 'Go'], + ['/developer-docs/latest/developer-resources/content-api/integrations/php', 'PHP'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/laravel', + 'Laravel', ], - }, - ], - }, - ['/developer-docs/latest/developer-resources/cli/CLI', 'Command Line Interface'], - ['/developer-docs/latest/developer-resources/error-handling.md', 'Error handling'], - { - title: 'Integrations', - path: '/developer-docs/latest/developer-resources/content-api/integrations.html', - collapsable: true, - sidebarDepth: 1, - children: [ - ['/developer-docs/latest/developer-resources/content-api/integrations/react', 'React'], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/vue-js', - 'Vue.js', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/angular', - 'Angular', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/next-js', - 'Next.js', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/nuxt-js', - 'Nuxt.js', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/graphql', - 'GraphQL', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/gatsby', - 'Gatsby', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/gridsome', - 'Gridsome', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/jekyll', - 'Jekyll', - ], - ['/developer-docs/latest/developer-resources/content-api/integrations/11ty', '11ty'], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/svelte', - 'Svelte', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/sapper', - 'Sapper', - ], - ['/developer-docs/latest/developer-resources/content-api/integrations/ruby', 'Ruby'], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/python', - 'Python', - ], - ['/developer-docs/latest/developer-resources/content-api/integrations/dart', 'Dart'], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/flutter', - 'Flutter', - ], - ['/developer-docs/latest/developer-resources/content-api/integrations/go', 'Go'], - ['/developer-docs/latest/developer-resources/content-api/integrations/php', 'PHP'], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/laravel', - 'Laravel', ], - ], - }, - ], - }, - { - title: '🧩 Strapi plugins', - path: '/developer-docs/latest/plugins/plugins-intro.html', - collapsable: false, - children: [ - ['/developer-docs/latest/plugins/graphql', 'GraphQL'], - ['/developer-docs/latest/plugins/i18n', 'Internationalization (i18n)'], - ['/developer-docs/latest/plugins/users-permissions', 'Users & Permissions'], - ['/developer-docs/latest/plugins/email', 'Email'], - ['/developer-docs/latest/plugins/upload', 'Upload'], - ['/developer-docs/latest/plugins/documentation', 'API Documentation'], - ], - sidebarDepth: 1, - }, - { - title: '♻️ Update & Migration', - collapsable: false, - children: [ - ['/developer-docs/latest/update-migration-guides/update-version.md', 'Update'], - ['/developer-docs/latest/update-migration-guides/migration-guides.md', 'Migration'], - ], - }, - { - title: '📚 Guides', - collapsable: true, - children: [ - ['/developer-docs/latest/guides/auth-request', 'Authenticated request'], - // ['/developer-docs/latest/guides/slug', 'Create a slug system'], - // ['/developer-docs/latest/guides/is-owner', 'Create is owner policy'], - // ['/developer-docs/latest/guides/custom-admin', 'Custom admin'], - // ['/developer-docs/latest/guides/custom-data-response', 'Custom data response'], - ['/developer-docs/latest/guides/draft', 'Draft system'], - // ['/developer-docs/latest/guides/error-catching', 'Error catching'], - // ['/developer-docs/latest/guides/external-data', 'Fetching external data'], - ['/developer-docs/latest/guides/jwt-validation', 'JWT validation'], - ['/developer-docs/latest/guides/process-manager', 'Process manager'], - ['/developer-docs/latest/guides/scheduled-publication', 'Scheduled publication'], - // ['/developer-docs/latest/guides/secure-your-app', 'Secure your application'], - // ['/developer-docs/latest/guides/send-email', 'Send email programmatically'], - // [ - // '/developer-docs/latest/guides/registering-a-field-in-admin', - // 'Registering a new field in the admin panel', - // ], - // ['/developer-docs/latest/guides/client', 'Setup a third party client'], - ['/developer-docs/latest/guides/unit-testing', 'Unit testing'], - ], - }, - ], - user: [ - { - collapsable: false, - title: '', - children: [ - ['/user-docs/latest/getting-started/introduction', 'Welcome to the Strapi user guide!'], - ], - }, - { - collapsable: false, - title: 'Content Manager', - children: [ - [ - '/user-docs/latest/content-manager/introduction-to-content-manager', - 'Introduction to the Content Manager', - ], - [ - '/user-docs/latest/content-manager/configuring-view-of-content-type', - 'Configuring the views of a content type', - ], - ['/user-docs/latest/content-manager/writing-content', 'Writing content'], - [ - '/user-docs/latest/content-manager/managing-relational-fields', - 'Managing relational fields', - ], - ['/user-docs/latest/content-manager/translating-content', 'Translating content'], - [ - '/user-docs/latest/content-manager/saving-and-publishing-content', - 'Saving, publishing and deleting content', - ], - ], - }, - { - collapsable: false, - title: 'Content-Type Builder', - children: [ - [ - '/user-docs/latest/content-types-builder/introduction-to-content-types-builder', - 'Introduction to the Content-Type Builder', - ], - [ - '/user-docs/latest/content-types-builder/creating-new-content-type', - 'Creating content types', - ], - [ - '/user-docs/latest/content-types-builder/managing-content-types', - 'Managing content types', + }, ], - [ - '/user-docs/latest/content-types-builder/configuring-fields-content-type', - 'Configuring fields for content types', + }, + { + title: '🧩 Strapi plugins', + path: '/developer-docs/latest/plugins/plugins-intro.html', + collapsable: false, + children: [ + ['/developer-docs/latest/plugins/graphql', 'GraphQL'], + ['/developer-docs/latest/plugins/i18n', 'Internationalization (i18n)'], + ['/developer-docs/latest/plugins/users-permissions', 'Users & Permissions'], + ['/developer-docs/latest/plugins/email', 'Email'], + ['/developer-docs/latest/plugins/upload', 'Upload'], + ['/developer-docs/latest/plugins/documentation', 'API Documentation'], ], - ], - }, - { - collapsable: false, - title: 'Users, Roles & Permissions', - children: [ - [ - '/user-docs/latest/users-roles-permissions/introduction-to-users-roles-permissions', - 'Introduction to users, roles & permissions', + sidebarDepth: 1, + }, + { + title: '♻️ Update & Migration', + collapsable: false, + children: [ + ['/developer-docs/latest/update-migration-guides/update-version.md', 'Update'], + ['/developer-docs/latest/update-migration-guides/migration-guides.md', 'Migration'], ], - [ - '/user-docs/latest/users-roles-permissions/configuring-administrator-roles', - 'Configuring administrator roles', + }, + { + title: '📚 Guides', + collapsable: true, + children: [ + ['/developer-docs/latest/guides/auth-request', 'Authenticated request'], + // ['/developer-docs/latest/guides/slug', 'Create a slug system'], + // ['/developer-docs/latest/guides/is-owner', 'Create is owner policy'], + // ['/developer-docs/latest/guides/custom-admin', 'Custom admin'], + // ['/developer-docs/latest/guides/custom-data-response', 'Custom data response'], + ['/developer-docs/latest/guides/draft', 'Draft system'], + // ['/developer-docs/latest/guides/error-catching', 'Error catching'], + // ['/developer-docs/latest/guides/external-data', 'Fetching external data'], + ['/developer-docs/latest/guides/jwt-validation', 'JWT validation'], + ['/developer-docs/latest/guides/process-manager', 'Process manager'], + ['/developer-docs/latest/guides/scheduled-publication', 'Scheduled publication'], + // ['/developer-docs/latest/guides/secure-your-app', 'Secure your application'], + // ['/developer-docs/latest/guides/send-email', 'Send email programmatically'], + // [ + // '/developer-docs/latest/guides/registering-a-field-in-admin', + // 'Registering a new field in the admin panel', + // ], + // ['/developer-docs/latest/guides/client', 'Setup a third party client'], + ['/developer-docs/latest/guides/unit-testing', 'Unit testing'], ], - [ - '/user-docs/latest/users-roles-permissions/managing-administrators', - 'Managing administrator accounts', + }, + ], + user: [ + { + collapsable: false, + title: '', + children: [ + ['/user-docs/latest/getting-started/introduction', 'Welcome to the Strapi user guide!'], ], - [ - '/user-docs/latest/users-roles-permissions/configuring-end-users-roles', - 'Configuring end-users roles', + }, + { + collapsable: false, + title: 'Content Manager', + children: [ + [ + '/user-docs/latest/content-manager/introduction-to-content-manager', + 'Introduction to the Content Manager', + ], + [ + '/user-docs/latest/content-manager/configuring-view-of-content-type', + 'Configuring the views of a content type', + ], + ['/user-docs/latest/content-manager/writing-content', 'Writing content'], + [ + '/user-docs/latest/content-manager/managing-relational-fields', + 'Managing relational fields', + ], + ['/user-docs/latest/content-manager/translating-content', 'Translating content'], + [ + '/user-docs/latest/content-manager/saving-and-publishing-content', + 'Saving, publishing and deleting content', + ], ], - [ - '/user-docs/latest/users-roles-permissions/managing-end-users', - 'Managing end-users accounts', + }, + { + collapsable: false, + title: 'Content-Type Builder', + children: [ + [ + '/user-docs/latest/content-types-builder/introduction-to-content-types-builder', + 'Introduction to the Content-Type Builder', + ], + [ + '/user-docs/latest/content-types-builder/creating-new-content-type', + 'Creating content types', + ], + [ + '/user-docs/latest/content-types-builder/managing-content-types', + 'Managing content types', + ], + [ + '/user-docs/latest/content-types-builder/configuring-fields-content-type', + 'Configuring fields for content types', + ], ], - ], - }, - { - collapsable: false, - title: 'Plugins', - children: [ - ['/user-docs/latest/plugins/introduction-to-plugins', 'Introduction to plugins'], - [ - '/user-docs/latest/plugins/installing-plugins-via-marketplace', - 'Installing plugins via the Marketplace', + }, + { + collapsable: false, + title: 'Users, Roles & Permissions', + children: [ + [ + '/user-docs/latest/users-roles-permissions/introduction-to-users-roles-permissions', + 'Introduction to users, roles & permissions', + ], + [ + '/user-docs/latest/users-roles-permissions/configuring-administrator-roles', + 'Configuring administrator roles', + ], + [ + '/user-docs/latest/users-roles-permissions/managing-administrators', + 'Managing administrator accounts', + ], + [ + '/user-docs/latest/users-roles-permissions/configuring-end-users-roles', + 'Configuring end-users roles', + ], + [ + '/user-docs/latest/users-roles-permissions/managing-end-users', + 'Managing end-users accounts', + ], ], - ['/user-docs/latest/plugins/strapi-plugins', 'List of Strapi plugins'], - ], - }, - { - collapsable: false, - title: 'General settings', - children: [ - ['/user-docs/latest/settings/managing-global-settings', 'Managing global settings'], - [ - '/user-docs/latest/settings/configuring-users-permissions-plugin-settings', - 'Configuring Users & Permissions plugin settings', + }, + { + collapsable: false, + title: 'Plugins', + children: [ + ['/user-docs/latest/plugins/introduction-to-plugins', 'Introduction to plugins'], + [ + '/user-docs/latest/plugins/installing-plugins-via-marketplace', + 'Installing plugins via the Marketplace', + ], + ['/user-docs/latest/plugins/strapi-plugins', 'List of Strapi plugins'], ], - ], - }, - ], -}; - -const checklinksIgnoredFiles = [ - '**/node_modules', // please never remove this one - /** - * Caution: Adding an individual file to this section - * will prevent the _whole_ file from being scanned for broken links. - * - * Currently, there is no easy way to ignore a specific link inside a file. - */ - - /** - * Files below give false positives - */ - '/developer-docs/latest/developer-resources/plugin-api-reference/admin-panel.md', - './developer-docs/latest/development/backend-customization/models.md', - './developer-docs/latest/guides/count-graphql.md', // might be removed once GraphQL customization is ready - './developer-docs/latest/setup-deployment-guides/configurations.md', // the script thinks filename[]() at line 977 is a real link - './developer-docs/latest/development/backend-customization/webhooks.md', // 'missing" links are in commented part of file -]; - -const plugins = [ - ['vuepress-plugin-element-tabs', {}], - [ - 'check-md', - { - ignore: checklinksIgnoredFiles, - }, - ], - [ - 'seo', - { - siteTitle: (_, $site) => $site.title, - title: $page => $page.title, - }, - ], - ['@vuepress/medium-zoom'], - [ - 'vuepress-plugin-code-copy', - { - color: '#ffffff', - successText: 'Copied to clipboard!', - }, - ], - ['@vuepress/back-to-top', {}], - [ - 'vuepress-plugin-container', - { - type: 'callout', - defaultTitle: '', - }, - ], - [ - 'vuepress-plugin-container', - { - type: 'strapi', - defaultTitle: '', - before: info => - `

🤓 ${info}

`, - after: '
', - }, - ], - [ - 'vuepress-plugin-container', - { - type: 'tip', - before: info => `

💡 ${info}

`, - after: '
', - }, - ], - [ - 'vuepress-plugin-container', - { - type: 'note', - before: info => `

✏️ ${info}

`, - after: '
', - }, - ], - [ - 'vuepress-plugin-container', - { - type: 'caution', - before: info => - `

✋ ${info}

`, - after: '
', - }, - ], - [ - 'vuepress-plugin-container', - { - type: 'warning', - before: info => - `

️❗️ ${info}

`, - after: '
', - }, - ], - [ - 'vuepress-plugin-container', - { - type: 'prerequisites', - defaultTitle: 'PREREQUISITES', - }, - ], - [ - 'vuepress-plugin-container', - { - type: 'api-call', - defaultTitle: '', - }, - ], - [ - 'vuepress-plugin-container', - { - type: 'request', - defaultTitle: 'Request', - }, - ], - [ - 'vuepress-plugin-container', - { - type: 'response', - defaultTitle: 'Response', - }, - ], -]; - -module.exports = { - title: '', - port: 8080, - description: 'The headless CMS developers love.', - base: '/', - plugins: plugins, - head: [ - [ - 'link', + }, { - rel: 'icon', - href: 'https://strapi.io/assets/favicon-32x32.png', + collapsable: false, + title: 'General settings', + children: [ + ['/user-docs/latest/settings/managing-global-settings', 'Managing global settings'], + [ + '/user-docs/latest/settings/configuring-users-permissions-plugin-settings', + 'Configuring Users & Permissions plugin settings', + ], + ], }, ], + }; + + const checklinksIgnoredFiles = [ + '**/node_modules', // please never remove this one + /** + * Caution: Adding an individual file to this section + * will prevent the _whole_ file from being scanned for broken links. + * + * Currently, there is no easy way to ignore a specific link inside a file. + */ + + /** + * Files below give false positives + */ + '/developer-docs/latest/developer-resources/plugin-api-reference/admin-panel.md', + './developer-docs/latest/development/backend-customization/models.md', + './developer-docs/latest/guides/count-graphql.md', // might be removed once GraphQL customization is ready + './developer-docs/latest/setup-deployment-guides/configurations.md', // the script thinks filename[]() at line 977 is a real link + './developer-docs/latest/development/backend-customization/webhooks.md', // 'missing" links are in commented part of file + ]; + + const plugins = [ + ['vuepress-plugin-element-tabs', {}], [ - 'meta', + 'check-md', { - property: 'og:title', - content: 'Strapi Documentation', + ignore: checklinksIgnoredFiles, }, ], [ - 'meta', + 'seo', { - property: 'og:type', - content: 'article', + siteTitle: (_, $site) => $site.title, + title: $page => $page.title, }, ], + ['@vuepress/medium-zoom'], [ - 'meta', + 'vuepress-plugin-code-copy', { - property: 'og:url', - content: 'https://strapi.io/documentation/', + color: '#ffffff', + successText: 'Copied to clipboard!', }, ], + ['@vuepress/back-to-top', {}], [ - 'meta', + 'vuepress-plugin-container', { - property: 'og:description', - content: 'The headless CMS developers love.', + type: 'callout', + defaultTitle: '', }, ], [ - 'meta', + 'vuepress-plugin-container', { - property: 'og:image', - content: 'https://strapi.io/documentation/assets/meta.png', + type: 'strapi', + defaultTitle: '', + before: info => + `

🤓 ${info}

`, + after: '
', }, ], [ - 'meta', + 'vuepress-plugin-container', { - property: 'og:article:author', - content: 'strapi', + type: 'tip', + before: info => `

💡 ${info}

`, + after: '
', }, ], - [ - 'meta', + 'vuepress-plugin-container', { - property: 'twitter:card', - content: 'summary_large_image', + type: 'note', + before: info => `

✏️ ${info}

`, + after: '
', }, ], [ - 'meta', + 'vuepress-plugin-container', { - property: 'twitter:url', - content: 'https://strapi.io/documentation/', + type: 'caution', + before: info => + `

✋ ${info}

`, + after: '
', }, ], [ - 'meta', + 'vuepress-plugin-container', { - property: 'twitter:site', - content: '@strapijs', + type: 'warning', + before: info => + `

️❗️ ${info}

`, + after: '
', }, ], [ - 'meta', + 'vuepress-plugin-container', { - property: 'twitter:title', - content: 'Strapi Documentation', + type: 'prerequisites', + defaultTitle: 'PREREQUISITES', }, ], [ - 'meta', + 'vuepress-plugin-container', { - property: 'twitter:description', - content: 'The headless CMS developers love.', + type: 'api-call', + defaultTitle: '', }, ], [ - 'meta', + 'vuepress-plugin-container', { - property: 'twitter:image', - content: 'http://strapi.io/assets/images/strapi-website-preview.png', + type: 'request', + defaultTitle: 'Request', }, ], [ - 'script', - {}, - `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-KN9JRWG');`, - ], - ], - themeConfig: { - logo: '/assets/logo.png', - nav: [ - { - text: 'Resource Center', - link: 'https://strapi.io/resource-center', - }, + 'vuepress-plugin-container', { - text: 'v4 Documentation', - items: [ - { - text: 'Developer Docs', - items: [ - { - text: 'Getting Started', - link: '/developer-docs/latest/getting-started/introduction.html', - }, - { - text: 'Setup & Deployment', - link: '/developer-docs/latest/setup-deployment-guides/installation.html', - }, - { - text: 'Plugins', - link: '/developer-docs/latest/plugins/plugins-intro.html', - }, - { - text: 'Development', - link: '/developer-docs/latest/development/backend-customization.html', - }, - { - text: 'Update & Migration', - link: '/developer-docs/latest/update-migration-guides/update-version.html', - }, - { - text: 'Developer Resources', - link: '/developer-docs/latest/developer-resources/content-api/content-api.html', - }, - ], - }, - { - text: 'User Guide', - items: [ - { - text: 'Getting Started', - link: '/user-docs/latest/getting-started/introduction.html', - }, - { - text: 'Content Manager', - link: '/user-docs/latest/content-manager/introduction-to-content-manager.html', - }, - { - text: 'Content-Type Builder', - link: - '/user-docs/latest/content-types-builder/introduction-to-content-types-builder.html', - }, - { - text: 'Users, Roles, and Permissions', - link: - '/user-docs/latest/users-roles-permissions/introduction-to-users-roles-permissions.html', - }, - { - text: 'Plugins', - link: '/user-docs/latest/plugins/introduction-to-plugins.html', - }, - { - text: 'General Settings', - link: '/user-docs/latest/settings/managing-global-settings.html', - }, - ], - }, - ], + type: 'response', + defaultTitle: 'Response', }, - { - text: 'v3 documentation', - link: 'https://docs-v3.strapi.io' - }, - { - text: 'Ecosystem', - items: [ - { - text: 'Strapi', - items: [ - { - text: 'Website', - link: 'https://strapi.io', - }, - { - text: 'Blog', - link: 'https://strapi.io/blog', - }, - { - text: 'StrapiConf 2021', - link: 'https://www.strapi.io/strapi-conf-2021', - }, - ], - }, - { - text: 'Community', - items: [ - { - text: 'Forum', - link: 'https://forum.strapi.io', - }, - { - text: 'Discord', - link: 'https://discord.strapi.io', - }, - { - text: 'Awesome-Strapi', - link: 'https://github.com/strapi/awesome-strapi', - }, - ], - }, - { - text: 'Resources', - items: [ - { - text: 'Tutorials', - link: 'https://strapi.io/tutorials', - }, - { - text: 'Academy', - link: 'https://academy.strapi.io/', - }, - ], - }, - ], + ], + ]; + + module.exports = { + title: '', + port: 8080, + description: 'The headless CMS developers love.', + base: '/', + plugins: plugins, + head: [ + [ + 'link', + { + rel: 'icon', + href: 'https://strapi.io/assets/favicon-32x32.png', + }, + ], + [ + 'meta', + { + property: 'og:title', + content: 'Strapi Documentation', + }, + ], + [ + 'meta', + { + property: 'og:type', + content: 'article', + }, + ], + [ + 'meta', + { + property: 'og:url', + content: 'https://strapi.io/documentation/', + }, + ], + [ + 'meta', + { + property: 'og:description', + content: 'The headless CMS developers love.', + }, + ], + [ + 'meta', + { + property: 'og:image', + content: 'https://strapi.io/documentation/assets/meta.png', + }, + ], + [ + 'meta', + { + property: 'og:article:author', + content: 'strapi', + }, + ], + + [ + 'meta', + { + property: 'twitter:card', + content: 'summary_large_image', + }, + ], + [ + 'meta', + { + property: 'twitter:url', + content: 'https://strapi.io/documentation/', + }, + ], + [ + 'meta', + { + property: 'twitter:site', + content: '@strapijs', + }, + ], + [ + 'meta', + { + property: 'twitter:title', + content: 'Strapi Documentation', + }, + ], + [ + 'meta', + { + property: 'twitter:description', + content: 'The headless CMS developers love.', + }, + ], + [ + 'meta', + { + property: 'twitter:image', + content: 'http://strapi.io/assets/images/strapi-website-preview.png', + }, + ], + [ + 'script', + {}, + `(function(w, d, s, l, i) { + w[l] = w[l] || []; + w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' }); + var f = d.getElementsByTagName(s)[0], + j = d.createElement(s), + dl = l != 'dataLayer' ? '&l=' + l : ''; + j.async = true; + j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; + f.parentNode.insertBefore(j, f); + })(window, document, 'script', 'dataLayer', 'GTM-KN9JRWG'); + `, + ], + ], + themeConfig: { + logo: '/assets/logo.png', + nav: [ + { + text: 'Resource Center', + link: 'https://strapi.io/resource-center', + }, + { + text: 'v4 Documentation', + items: [ + { + text: 'Developer Docs', + items: [ + { + text: 'Getting Started', + link: '/developer-docs/latest/getting-started/introduction.html', + }, + { + text: 'Setup & Deployment', + link: '/developer-docs/latest/setup-deployment-guides/installation.html', + }, + { + text: 'Plugins', + link: '/developer-docs/latest/plugins/plugins-intro.html', + }, + { + text: 'Development', + link: '/developer-docs/latest/development/backend-customization.html', + }, + { + text: 'Update & Migration', + link: '/developer-docs/latest/update-migration-guides/update-version.html', + }, + { + text: 'Developer Resources', + link: '/developer-docs/latest/developer-resources/content-api/content-api.html', + }, + ], + }, + { + text: 'User Guide', + items: [ + { + text: 'Getting Started', + link: '/user-docs/latest/getting-started/introduction.html', + }, + { + text: 'Content Manager', + link: '/user-docs/latest/content-manager/introduction-to-content-manager.html', + }, + { + text: 'Content-Type Builder', + link: + '/user-docs/latest/content-types-builder/introduction-to-content-types-builder.html', + }, + { + text: 'Users, Roles, and Permissions', + link: + '/user-docs/latest/users-roles-permissions/introduction-to-users-roles-permissions.html', + }, + { + text: 'Plugins', + link: '/user-docs/latest/plugins/introduction-to-plugins.html', + }, + { + text: 'General Settings', + link: '/user-docs/latest/settings/managing-global-settings.html', + }, + ], + }, + ], + }, + { + text: 'v3 documentation', + link: 'https://docs-v3.strapi.io' + }, + { + text: 'Ecosystem', + items: [ + { + text: 'Strapi', + items: [ + { + text: 'Website', + link: 'https://strapi.io', + }, + { + text: 'Blog', + link: 'https://strapi.io/blog', + }, + { + text: 'StrapiConf 2021', + link: 'https://www.strapi.io/strapi-conf-2021', + }, + ], + }, + { + text: 'Community', + items: [ + { + text: 'Forum', + link: 'https://forum.strapi.io', + }, + { + text: 'Discord', + link: 'https://discord.strapi.io', + }, + { + text: 'Awesome-Strapi', + link: 'https://github.com/strapi/awesome-strapi', + }, + ], + }, + { + text: 'Resources', + items: [ + { + text: 'Tutorials', + link: 'https://strapi.io/tutorials', + }, + { + text: 'Academy', + link: 'https://academy.strapi.io/', + }, + ], + }, + ], + }, + { + text: "We're hiring!", + link: 'https://strapi.io/careers#open-positions', + }, + ], + repo: 'strapi/documentation', + docsDir: 'docs', + docsBranch: 'main', + algolia: { + appId: '9FTY6J9E4X', + apiKey: 'cf49c82a1865df2618a3d89e18657051', + indexName: 'documentation', }, - { - text: "We're hiring!", - link: 'https://strapi.io/careers#open-positions', + editLinks: true, + editLinkText: 'Improve this page', + serviceWorker: true, + sidebarDepth: 1, + smoothScroll: false, + sidebar: { + '/developer-docs/latest/': sidebar.developer, + '/user-docs/latest/': sidebar.user, }, - ], - repo: 'strapi/documentation', - docsDir: 'docs', - docsBranch: 'main', - algolia: { - appId: '9FTY6J9E4X', - apiKey: 'cf49c82a1865df2618a3d89e18657051', - indexName: 'documentation', }, - editLinks: true, - editLinkText: 'Improve this page', - serviceWorker: true, - sidebarDepth: 1, - smoothScroll: false, - sidebar: { - '/developer-docs/latest/': sidebar.developer, - '/user-docs/latest/': sidebar.user, - }, - }, - markdown: { - extendMarkdown: md => { - // use more markdown-it plugins! - md.use(require('markdown-it-include')); + markdown: { + extendMarkdown: md => { + // use more markdown-it plugins! + md.use(require('markdown-it-include')); + }, }, - }, -}; + }; + \ No newline at end of file diff --git a/docs/developer-docs/latest/developer-resources/cli/CLI.md b/docs/developer-docs/latest/developer-resources/cli/CLI.md index 88914eea5e..315ff8d249 100644 --- a/docs/developer-docs/latest/developer-resources/cli/CLI.md +++ b/docs/developer-docs/latest/developer-resources/cli/CLI.md @@ -98,7 +98,7 @@ options: [--no-optimization] ## strapi watch-admin -Starts the admin server. Strapi should already be running with `strapi develop`. +Starts the admin server. Strapi should already be running with `strapi develop`. ```sh strapi watch-admin diff --git a/docs/package.json b/docs/package.json index c9c0801e03..6229ce4ede 100644 --- a/docs/package.json +++ b/docs/package.json @@ -5,7 +5,8 @@ "scripts": { "dev": "vuepress dev", "build": "vuepress build", - "check-links": "vuepress check-md" + "check-links": "vuepress check-md", + "create:config-file": "node ./scripts/create-config-file.js" }, "license": "SEE LICENSE IN LICENSE", "dependencies": { diff --git a/docs/scripts/create-config-file.js b/docs/scripts/create-config-file.js new file mode 100644 index 0000000000..c8b3d40a75 --- /dev/null +++ b/docs/scripts/create-config-file.js @@ -0,0 +1,951 @@ +'use strict'; + +const path = require('path'); +const fs = require('fs-extra'); + +const createConfigFile = async () => { + const content = ` + const sidebar = { + developer: [ + { + title: '🚀 Getting Started', + collapsable: false, + children: [ + ['/developer-docs/latest/getting-started/introduction', 'Introduction'], + ['/developer-docs/latest/getting-started/quick-start', 'Quick Start Guide'], + ['/developer-docs/latest/getting-started/troubleshooting', 'Frequently Asked Questions'], + ['/developer-docs/latest/getting-started/usage-information', 'Usage Information'], + ], + }, + { + title: '⚙️ Setup & Deployment', + collapsable: false, + sidebarDepth: 0, + initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default + children: [ + { + title: 'Installation', + path: '/developer-docs/latest/setup-deployment-guides/installation.html', + collapsable: true, + sidebarDepth: 1, + children: [ + ['/developer-docs/latest/setup-deployment-guides/installation/cli.md', 'CLI'], + ['/developer-docs/latest/setup-deployment-guides/installation/docker.md', 'Docker'], + [ + '/developer-docs/latest/setup-deployment-guides/installation/digitalocean-one-click.md', + 'DigitalOcean One-Click', + ], + [ + '/developer-docs/latest/setup-deployment-guides/installation/platformsh.md', + 'Platform.sh One-Click', + ], + [ + '/developer-docs/latest/setup-deployment-guides/installation/render.md', + 'Render One-Click', + ], + ], + }, + ['/developer-docs/latest/setup-deployment-guides/file-structure.md', 'Project structure'], + { + title: 'Configurations', + path: '/developer-docs/latest/setup-deployment-guides/configurations.html', + collapsable: true, + children: [ + { + title: 'Required configurations', + collapsable: true, + children: [ + [ + '/developer-docs/latest/setup-deployment-guides/configurations/required/databases.md', + 'Database', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/required/server.md', + 'Server', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/required/admin-panel.md', + 'Admin panel', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/required/middlewares.md', + 'Middlewares', + ], + ], + }, + { + title: 'Optional configurations', + collapsable: true, + children: [ + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/api-tokens.md', + 'API tokens', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/functions.md', + 'Functions', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/cronjobs.md', + 'Cron jobs', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/api.md', + 'API', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/plugins.md', + 'Plugins', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.md', + 'Environment', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/public-assets.md', + 'Public Assets', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md', + 'Single Sign On (SSO)', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/rbac.md', + 'Role-Based Access Control (RBAC)', + ], + ], + }, + ], + }, + { + title: 'Deployment', + path: '/developer-docs/latest/setup-deployment-guides/deployment', + collapsable: true, + initialOpenGroupIndex: -1, // make sure that no subgroup is open by default — if set to 0, 'Hosting Provider Guides' is expanded + children: [ + { + title: 'Hosting Provider Guides', + path: + '/developer-docs/latest/setup-deployment-guides/deployment.html#hosting-provider-guides', + collapsable: true, + children: [ + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/21yunbox.md', + '21YunBox', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/amazon-aws.md', + 'Amazon AWS', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/azure.md', + 'Azure', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean-app-platform.md', + 'DigitalOcean App Platform', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean.md', + 'DigitalOcean Droplets', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/google-app-engine.md', + 'Google App Engine', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/heroku.md', + 'Heroku', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/qovery.md', + 'Qovery', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/render.md', + 'Render', + ], + ], + sidebarDepth: 2, + }, + { + title: 'Optional Software Guides', + path: + '/developer-docs/latest/setup-deployment-guides/deployment.html#optional-software-guides', + collapsable: true, + children: [ + [ + '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/caddy-proxy.md', + 'Caddy', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/haproxy-proxy.md', + 'HAProxy', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/nginx-proxy.md', + 'Nginx', + ], + ], + sidebarDepth: 2, + }, + ], + sidebarDepth: 0, + }, + ], + }, + { + title: '🔧 Development', + collapsable: false, + initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default + children: [ + { + title: 'Back-end customization', + collapsable: true, + path: '/developer-docs/latest/development/backend-customization', + children: [ + ['/developer-docs/latest/development/backend-customization/routes.md', 'Routes'], + ['/developer-docs/latest/development/backend-customization/policies.md', 'Policies'], + [ + '/developer-docs/latest/development/backend-customization/middlewares.md', + 'Middlewares', + ], + [ + '/developer-docs/latest/development/backend-customization/controllers.md', + 'Controllers', + ], + [ + '/developer-docs/latest/development/backend-customization/requests-responses.md', + 'Requests & Responses', + ], + ['/developer-docs/latest/development/backend-customization/services.md', 'Services'], + ['/developer-docs/latest/development/backend-customization/models.md', 'Models'], + ['/developer-docs/latest/development/backend-customization/webhooks.md', 'Webhooks'], + ], + }, + ['/developer-docs/latest/development/admin-customization', 'Admin panel customization'], + ['/developer-docs/latest/development/plugins-extension.md', 'Plugins extension'], + ['/developer-docs/latest/development/plugins-development.md', 'Plugins development'], + ], + }, + { + title: '💻 Developer Resources', + collapsable: false, + initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default + sidebarDepth: 2, + children: [ + { + title: 'APIs Reference', + collapsable: true, + sidebarDepth: 1, + children: [ + [ + '/developer-docs/latest/developer-resources/database-apis-reference/rest-api.md', + 'REST API', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/graphql-api.md', + 'GraphQL API', + ], + { + title: 'Query Engine API', + path: + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine-api.html', + collapsable: true, + // sidebarDepth: 3, + children: [ + [ + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/single-operations.md', + 'Single Operations', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/bulk-operations.md', + 'Bulk Operations', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/filtering.md', + 'Filtering', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/populating.md', + 'Populating', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/order-pagination.md', + 'Ordering & pagination', + ], + ], + }, + { + title: 'Entity Service API', + path: + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service-api', + collapsable: true, + children: [ + [ + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/crud.md', + 'CRUD operations', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/filter.md', + 'Filters', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/populate.md', + 'Populate', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/order-pagination.md', + 'Ordering & pagination', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/components-dynamic-zones.md', + 'Components and dynamic zones', + ], + ], + }, + { + title: 'Plugin APIs Reference', + collapsable: true, + children: [ + [ + '/developer-docs/latest/developer-resources/plugin-api-reference/server.md', + 'Server API for plugins', + ], + [ + '/developer-docs/latest/developer-resources/plugin-api-reference/admin-panel.md', + 'Admin Panel API for plugins', + ], + ], + }, + ], + }, + ['/developer-docs/latest/developer-resources/cli/CLI', 'Command Line Interface'], + ['/developer-docs/latest/developer-resources/error-handling.md', 'Error handling'], + { + title: 'Integrations', + path: '/developer-docs/latest/developer-resources/content-api/integrations.html', + collapsable: true, + sidebarDepth: 1, + children: [ + ['/developer-docs/latest/developer-resources/content-api/integrations/react', 'React'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/vue-js', + 'Vue.js', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/angular', + 'Angular', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/next-js', + 'Next.js', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/nuxt-js', + 'Nuxt.js', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/graphql', + 'GraphQL', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/gatsby', + 'Gatsby', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/gridsome', + 'Gridsome', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/jekyll', + 'Jekyll', + ], + ['/developer-docs/latest/developer-resources/content-api/integrations/11ty', '11ty'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/svelte', + 'Svelte', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/sapper', + 'Sapper', + ], + ['/developer-docs/latest/developer-resources/content-api/integrations/ruby', 'Ruby'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/python', + 'Python', + ], + ['/developer-docs/latest/developer-resources/content-api/integrations/dart', 'Dart'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/flutter', + 'Flutter', + ], + ['/developer-docs/latest/developer-resources/content-api/integrations/go', 'Go'], + ['/developer-docs/latest/developer-resources/content-api/integrations/php', 'PHP'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/laravel', + 'Laravel', + ], + ], + }, + ], + }, + { + title: '🧩 Strapi plugins', + path: '/developer-docs/latest/plugins/plugins-intro.html', + collapsable: false, + children: [ + ['/developer-docs/latest/plugins/graphql', 'GraphQL'], + ['/developer-docs/latest/plugins/i18n', 'Internationalization (i18n)'], + ['/developer-docs/latest/plugins/users-permissions', 'Users & Permissions'], + ['/developer-docs/latest/plugins/email', 'Email'], + ['/developer-docs/latest/plugins/upload', 'Upload'], + ['/developer-docs/latest/plugins/documentation', 'API Documentation'], + ], + sidebarDepth: 1, + }, + { + title: '♻️ Update & Migration', + collapsable: false, + children: [ + ['/developer-docs/latest/update-migration-guides/update-version.md', 'Update'], + ['/developer-docs/latest/update-migration-guides/migration-guides.md', 'Migration'], + ], + }, + { + title: '📚 Guides', + collapsable: true, + children: [ + ['/developer-docs/latest/guides/auth-request', 'Authenticated request'], + // ['/developer-docs/latest/guides/slug', 'Create a slug system'], + // ['/developer-docs/latest/guides/is-owner', 'Create is owner policy'], + // ['/developer-docs/latest/guides/custom-admin', 'Custom admin'], + // ['/developer-docs/latest/guides/custom-data-response', 'Custom data response'], + ['/developer-docs/latest/guides/draft', 'Draft system'], + // ['/developer-docs/latest/guides/error-catching', 'Error catching'], + // ['/developer-docs/latest/guides/external-data', 'Fetching external data'], + ['/developer-docs/latest/guides/jwt-validation', 'JWT validation'], + ['/developer-docs/latest/guides/process-manager', 'Process manager'], + ['/developer-docs/latest/guides/scheduled-publication', 'Scheduled publication'], + // ['/developer-docs/latest/guides/secure-your-app', 'Secure your application'], + // ['/developer-docs/latest/guides/send-email', 'Send email programmatically'], + // [ + // '/developer-docs/latest/guides/registering-a-field-in-admin', + // 'Registering a new field in the admin panel', + // ], + // ['/developer-docs/latest/guides/client', 'Setup a third party client'], + ['/developer-docs/latest/guides/unit-testing', 'Unit testing'], + ], + }, + ], + user: [ + { + collapsable: false, + title: '', + children: [ + ['/user-docs/latest/getting-started/introduction', 'Welcome to the Strapi user guide!'], + ], + }, + { + collapsable: false, + title: 'Content Manager', + children: [ + [ + '/user-docs/latest/content-manager/introduction-to-content-manager', + 'Introduction to the Content Manager', + ], + [ + '/user-docs/latest/content-manager/configuring-view-of-content-type', + 'Configuring the views of a content type', + ], + ['/user-docs/latest/content-manager/writing-content', 'Writing content'], + [ + '/user-docs/latest/content-manager/managing-relational-fields', + 'Managing relational fields', + ], + ['/user-docs/latest/content-manager/translating-content', 'Translating content'], + [ + '/user-docs/latest/content-manager/saving-and-publishing-content', + 'Saving, publishing and deleting content', + ], + ], + }, + { + collapsable: false, + title: 'Content-Type Builder', + children: [ + [ + '/user-docs/latest/content-types-builder/introduction-to-content-types-builder', + 'Introduction to the Content-Type Builder', + ], + [ + '/user-docs/latest/content-types-builder/creating-new-content-type', + 'Creating content types', + ], + [ + '/user-docs/latest/content-types-builder/managing-content-types', + 'Managing content types', + ], + [ + '/user-docs/latest/content-types-builder/configuring-fields-content-type', + 'Configuring fields for content types', + ], + ], + }, + { + collapsable: false, + title: 'Users, Roles & Permissions', + children: [ + [ + '/user-docs/latest/users-roles-permissions/introduction-to-users-roles-permissions', + 'Introduction to users, roles & permissions', + ], + [ + '/user-docs/latest/users-roles-permissions/configuring-administrator-roles', + 'Configuring administrator roles', + ], + [ + '/user-docs/latest/users-roles-permissions/managing-administrators', + 'Managing administrator accounts', + ], + [ + '/user-docs/latest/users-roles-permissions/configuring-end-users-roles', + 'Configuring end-users roles', + ], + [ + '/user-docs/latest/users-roles-permissions/managing-end-users', + 'Managing end-users accounts', + ], + ], + }, + { + collapsable: false, + title: 'Plugins', + children: [ + ['/user-docs/latest/plugins/introduction-to-plugins', 'Introduction to plugins'], + [ + '/user-docs/latest/plugins/installing-plugins-via-marketplace', + 'Installing plugins via the Marketplace', + ], + ['/user-docs/latest/plugins/strapi-plugins', 'List of Strapi plugins'], + ], + }, + { + collapsable: false, + title: 'General settings', + children: [ + ['/user-docs/latest/settings/managing-global-settings', 'Managing global settings'], + [ + '/user-docs/latest/settings/configuring-users-permissions-plugin-settings', + 'Configuring Users & Permissions plugin settings', + ], + ], + }, + ], + }; + + const checklinksIgnoredFiles = [ + '**/node_modules', // please never remove this one + /** + * Caution: Adding an individual file to this section + * will prevent the _whole_ file from being scanned for broken links. + * + * Currently, there is no easy way to ignore a specific link inside a file. + */ + + /** + * Files below give false positives + */ + '/developer-docs/latest/developer-resources/plugin-api-reference/admin-panel.md', + './developer-docs/latest/development/backend-customization/models.md', + './developer-docs/latest/guides/count-graphql.md', // might be removed once GraphQL customization is ready + './developer-docs/latest/setup-deployment-guides/configurations.md', // the script thinks filename[]() at line 977 is a real link + './developer-docs/latest/development/backend-customization/webhooks.md', // 'missing" links are in commented part of file + ]; + + const plugins = [ + ['vuepress-plugin-element-tabs', {}], + [ + 'check-md', + { + ignore: checklinksIgnoredFiles, + }, + ], + [ + 'seo', + { + siteTitle: (_, $site) => $site.title, + title: $page => $page.title, + }, + ], + ['@vuepress/medium-zoom'], + [ + 'vuepress-plugin-code-copy', + { + color: '#ffffff', + successText: 'Copied to clipboard!', + }, + ], + ['@vuepress/back-to-top', {}], + [ + 'vuepress-plugin-container', + { + type: 'callout', + defaultTitle: '', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'strapi', + defaultTitle: '', + before: info => + \`

🤓 \${info}

\`, + after: '
', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'tip', + before: info => \`

💡 \${info}

\`, + after: '
', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'note', + before: info => \`

✏️ \${info}

\`, + after: '
', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'caution', + before: info => + \`

✋ \${info}

\`, + after: '
', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'warning', + before: info => + \`

️❗️ \${info}

\`, + after: '
', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'prerequisites', + defaultTitle: 'PREREQUISITES', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'api-call', + defaultTitle: '', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'request', + defaultTitle: 'Request', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'response', + defaultTitle: 'Response', + }, + ], + ]; + + module.exports = { + title: '', + port: 8080, + description: 'The headless CMS developers love.', + base: '/', + plugins: plugins, + head: [ + [ + 'link', + { + rel: 'icon', + href: 'https://strapi.io/assets/favicon-32x32.png', + }, + ], + [ + 'meta', + { + property: 'og:title', + content: 'Strapi Documentation', + }, + ], + [ + 'meta', + { + property: 'og:type', + content: 'article', + }, + ], + [ + 'meta', + { + property: 'og:url', + content: 'https://strapi.io/documentation/', + }, + ], + [ + 'meta', + { + property: 'og:description', + content: 'The headless CMS developers love.', + }, + ], + [ + 'meta', + { + property: 'og:image', + content: 'https://strapi.io/documentation/assets/meta.png', + }, + ], + [ + 'meta', + { + property: 'og:article:author', + content: 'strapi', + }, + ], + + [ + 'meta', + { + property: 'twitter:card', + content: 'summary_large_image', + }, + ], + [ + 'meta', + { + property: 'twitter:url', + content: 'https://strapi.io/documentation/', + }, + ], + [ + 'meta', + { + property: 'twitter:site', + content: '@strapijs', + }, + ], + [ + 'meta', + { + property: 'twitter:title', + content: 'Strapi Documentation', + }, + ], + [ + 'meta', + { + property: 'twitter:description', + content: 'The headless CMS developers love.', + }, + ], + [ + 'meta', + { + property: 'twitter:image', + content: 'http://strapi.io/assets/images/strapi-website-preview.png', + }, + ], + [ + 'script', + {}, + \`(function(w, d, s, l, i) { + w[l] = w[l] || []; + w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' }); + var f = d.getElementsByTagName(s)[0], + j = d.createElement(s), + dl = l != 'dataLayer' ? '&l=' + l : ''; + j.async = true; + j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; + f.parentNode.insertBefore(j, f); + })(window, document, 'script', 'dataLayer', 'GTM-KN9JRWG'); + \`, + ], + ], + themeConfig: { + logo: '/assets/logo.png', + nav: [ + { + text: 'Resource Center', + link: 'https://strapi.io/resource-center', + }, + { + text: 'v4 Documentation', + items: [ + { + text: 'Developer Docs', + items: [ + { + text: 'Getting Started', + link: '/developer-docs/latest/getting-started/introduction.html', + }, + { + text: 'Setup & Deployment', + link: '/developer-docs/latest/setup-deployment-guides/installation.html', + }, + { + text: 'Plugins', + link: '/developer-docs/latest/plugins/plugins-intro.html', + }, + { + text: 'Development', + link: '/developer-docs/latest/development/backend-customization.html', + }, + { + text: 'Update & Migration', + link: '/developer-docs/latest/update-migration-guides/update-version.html', + }, + { + text: 'Developer Resources', + link: '/developer-docs/latest/developer-resources/content-api/content-api.html', + }, + ], + }, + { + text: 'User Guide', + items: [ + { + text: 'Getting Started', + link: '/user-docs/latest/getting-started/introduction.html', + }, + { + text: 'Content Manager', + link: '/user-docs/latest/content-manager/introduction-to-content-manager.html', + }, + { + text: 'Content-Type Builder', + link: + '/user-docs/latest/content-types-builder/introduction-to-content-types-builder.html', + }, + { + text: 'Users, Roles, and Permissions', + link: + '/user-docs/latest/users-roles-permissions/introduction-to-users-roles-permissions.html', + }, + { + text: 'Plugins', + link: '/user-docs/latest/plugins/introduction-to-plugins.html', + }, + { + text: 'General Settings', + link: '/user-docs/latest/settings/managing-global-settings.html', + }, + ], + }, + ], + }, + { + text: 'v3 documentation', + link: 'https://docs-v3.strapi.io' + }, + { + text: 'Ecosystem', + items: [ + { + text: 'Strapi', + items: [ + { + text: 'Website', + link: 'https://strapi.io', + }, + { + text: 'Blog', + link: 'https://strapi.io/blog', + }, + { + text: 'StrapiConf 2021', + link: 'https://www.strapi.io/strapi-conf-2021', + }, + ], + }, + { + text: 'Community', + items: [ + { + text: 'Forum', + link: 'https://forum.strapi.io', + }, + { + text: 'Discord', + link: 'https://discord.strapi.io', + }, + { + text: 'Awesome-Strapi', + link: 'https://github.com/strapi/awesome-strapi', + }, + ], + }, + { + text: 'Resources', + items: [ + { + text: 'Tutorials', + link: 'https://strapi.io/tutorials', + }, + { + text: 'Academy', + link: 'https://academy.strapi.io/', + }, + ], + }, + ], + }, + { + text: "We're hiring!", + link: 'https://strapi.io/careers#open-positions', + }, + ], + repo: 'strapi/documentation', + docsDir: 'docs', + docsBranch: 'main', + algolia: { + appId: '9FTY6J9E4X', + apiKey: 'cf49c82a1865df2618a3d89e18657051', + indexName: 'documentation', + }, + editLinks: true, + editLinkText: 'Improve this page', + serviceWorker: true, + sidebarDepth: 1, + smoothScroll: false, + sidebar: { + '/developer-docs/latest/': sidebar.developer, + '/user-docs/latest/': sidebar.user, + }, + }, + markdown: { + extendMarkdown: md => { + // use more markdown-it plugins! + md.use(require('markdown-it-include')); + }, + }, + }; + `; + + const destination = path.resolve(__dirname, '..', '.vuepress', 'config.js'); + + await fs.writeFile(destination, content); +}; + +createConfigFile(); diff --git a/docs/tmp.md b/docs/tmp.md new file mode 100644 index 0000000000..c7216153f2 --- /dev/null +++ b/docs/tmp.md @@ -0,0 +1,7 @@ +1. Split la config +2. Ecrire le fichier config.js +3. Checker le hot reload +4. Checker la doc vue press => exclure certaine parties de la doc +5. Switch to monorepo + +WARNING: exp de dev doit etre pareil From c265acafac6a9e9d008b02790335ee9d0074096e Mon Sep 17 00:00:00 2001 From: soupette Date: Wed, 8 Dec 2021 10:55:34 +0100 Subject: [PATCH 2/9] Split sidebar Signed-off-by: soupette --- docs/.vuepress/config.js | 1707 ++++++++++++++-------------- docs/.vuepress/sidebar.js | 538 +++++++++ docs/package.json | 2 +- docs/scripts/create-config-file.js | 1220 ++++++-------------- 4 files changed, 1736 insertions(+), 1731 deletions(-) create mode 100644 docs/.vuepress/sidebar.js diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index a4d39f5a52..5b0645282b 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -1,938 +1,939 @@ - const sidebar = { - developer: [ - { - title: '🚀 Getting Started', - collapsable: false, - children: [ - ['/developer-docs/latest/getting-started/introduction', 'Introduction'], - ['/developer-docs/latest/getting-started/quick-start', 'Quick Start Guide'], - ['/developer-docs/latest/getting-started/troubleshooting', 'Frequently Asked Questions'], - ['/developer-docs/latest/getting-started/usage-information', 'Usage Information'], - ], - }, - { - title: '⚙️ Setup & Deployment', - collapsable: false, - sidebarDepth: 0, - initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default - children: [ - { - title: 'Installation', - path: '/developer-docs/latest/setup-deployment-guides/installation.html', - collapsable: true, - sidebarDepth: 1, - children: [ - ['/developer-docs/latest/setup-deployment-guides/installation/cli.md', 'CLI'], - ['/developer-docs/latest/setup-deployment-guides/installation/docker.md', 'Docker'], - [ - '/developer-docs/latest/setup-deployment-guides/installation/digitalocean-one-click.md', - 'DigitalOcean One-Click', +const sidebar = { + developer: [ + { + title: '🚀 Getting Started', + collapsable: false, + children: [ + ['/developer-docs/latest/getting-started/introduction', 'Introduction'], + ['/developer-docs/latest/getting-started/quick-start', 'Quick Start Guide'], + ['/developer-docs/latest/getting-started/troubleshooting', 'Frequently Asked Questions'], + ['/developer-docs/latest/getting-started/usage-information', 'Usage Information'], + ], + }, + { + title: '⚙️ Setup & Deployment', + collapsable: false, + sidebarDepth: 0, + initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default + children: [ + { + title: 'Installation', + path: '/developer-docs/latest/setup-deployment-guides/installation.html', + collapsable: true, + sidebarDepth: 1, + children: [ + ['/developer-docs/latest/setup-deployment-guides/installation/cli.md', 'CLI'], + ['/developer-docs/latest/setup-deployment-guides/installation/docker.md', 'Docker'], + [ + '/developer-docs/latest/setup-deployment-guides/installation/digitalocean-one-click.md', + 'DigitalOcean One-Click', + ], + [ + '/developer-docs/latest/setup-deployment-guides/installation/platformsh.md', + 'Platform.sh One-Click', + ], + [ + '/developer-docs/latest/setup-deployment-guides/installation/render.md', + 'Render One-Click', + ], + ], + }, + ['/developer-docs/latest/setup-deployment-guides/file-structure.md', 'Project structure'], + { + title: 'Configurations', + path: '/developer-docs/latest/setup-deployment-guides/configurations.html', + collapsable: true, + children: [ + { + title: 'Required configurations', + collapsable: true, + children: [ + [ + '/developer-docs/latest/setup-deployment-guides/configurations/required/databases.md', + 'Database', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/required/server.md', + 'Server', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/required/admin-panel.md', + 'Admin panel', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/required/middlewares.md', + 'Middlewares', + ], ], - [ - '/developer-docs/latest/setup-deployment-guides/installation/platformsh.md', - 'Platform.sh One-Click', + }, + { + title: 'Optional configurations', + collapsable: true, + children: [ + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/api-tokens.md', + 'API tokens', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/functions.md', + 'Functions', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/cronjobs.md', + 'Cron jobs', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/api.md', + 'API', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/plugins.md', + 'Plugins', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.md', + 'Environment', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/public-assets.md', + 'Public Assets', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md', + 'Single Sign On (SSO)', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/rbac.md', + 'Role-Based Access Control (RBAC)', + ], ], - [ - '/developer-docs/latest/setup-deployment-guides/installation/render.md', - 'Render One-Click', + }, + ], + }, + { + title: 'Deployment', + path: '/developer-docs/latest/setup-deployment-guides/deployment', + collapsable: true, + initialOpenGroupIndex: -1, // make sure that no subgroup is open by default — if set to 0, 'Hosting Provider Guides' is expanded + children: [ + { + title: 'Hosting Provider Guides', + path: + '/developer-docs/latest/setup-deployment-guides/deployment.html#hosting-provider-guides', + collapsable: true, + children: [ + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/21yunbox.md', + '21YunBox', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/amazon-aws.md', + 'Amazon AWS', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/azure.md', + 'Azure', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean-app-platform.md', + 'DigitalOcean App Platform', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean.md', + 'DigitalOcean Droplets', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/google-app-engine.md', + 'Google App Engine', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/heroku.md', + 'Heroku', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/qovery.md', + 'Qovery', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/render.md', + 'Render', + ], ], - ], - }, - ['/developer-docs/latest/setup-deployment-guides/file-structure.md', 'Project structure'], - { - title: 'Configurations', - path: '/developer-docs/latest/setup-deployment-guides/configurations.html', - collapsable: true, - children: [ - { - title: 'Required configurations', - collapsable: true, - children: [ - [ - '/developer-docs/latest/setup-deployment-guides/configurations/required/databases.md', - 'Database', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/required/server.md', - 'Server', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/required/admin-panel.md', - 'Admin panel', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/required/middlewares.md', - 'Middlewares', - ], + sidebarDepth: 2, + }, + { + title: 'Optional Software Guides', + path: + '/developer-docs/latest/setup-deployment-guides/deployment.html#optional-software-guides', + collapsable: true, + children: [ + [ + '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/caddy-proxy.md', + 'Caddy', ], - }, - { - title: 'Optional configurations', - collapsable: true, - children: [ - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/api-tokens.md', - 'API tokens', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/functions.md', - 'Functions', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/cronjobs.md', - 'Cron jobs', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/api.md', - 'API', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/plugins.md', - 'Plugins', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.md', - 'Environment', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/public-assets.md', - 'Public Assets', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md', - 'Single Sign On (SSO)', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/rbac.md', - 'Role-Based Access Control (RBAC)', - ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/haproxy-proxy.md', + 'HAProxy', ], - }, + [ + '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/nginx-proxy.md', + 'Nginx', + ], + ], + sidebarDepth: 2, + }, + ], + sidebarDepth: 0, + }, + ], + }, + { + title: '🔧 Development', + collapsable: false, + initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default + children: [ + { + title: 'Back-end customization', + collapsable: true, + path: '/developer-docs/latest/development/backend-customization', + children: [ + ['/developer-docs/latest/development/backend-customization/routes.md', 'Routes'], + ['/developer-docs/latest/development/backend-customization/policies.md', 'Policies'], + [ + '/developer-docs/latest/development/backend-customization/middlewares.md', + 'Middlewares', ], - }, - { - title: 'Deployment', - path: '/developer-docs/latest/setup-deployment-guides/deployment', - collapsable: true, - initialOpenGroupIndex: -1, // make sure that no subgroup is open by default — if set to 0, 'Hosting Provider Guides' is expanded - children: [ - { - title: 'Hosting Provider Guides', - path: - '/developer-docs/latest/setup-deployment-guides/deployment.html#hosting-provider-guides', - collapsable: true, - children: [ - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/21yunbox.md', - '21YunBox', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/amazon-aws.md', - 'Amazon AWS', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/azure.md', - 'Azure', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean-app-platform.md', - 'DigitalOcean App Platform', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean.md', - 'DigitalOcean Droplets', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/google-app-engine.md', - 'Google App Engine', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/heroku.md', - 'Heroku', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/qovery.md', - 'Qovery', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/render.md', - 'Render', - ], - ], - sidebarDepth: 2, - }, - { - title: 'Optional Software Guides', - path: - '/developer-docs/latest/setup-deployment-guides/deployment.html#optional-software-guides', - collapsable: true, - children: [ - [ - '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/caddy-proxy.md', - 'Caddy', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/haproxy-proxy.md', - 'HAProxy', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/nginx-proxy.md', - 'Nginx', - ], - ], - sidebarDepth: 2, - }, + [ + '/developer-docs/latest/development/backend-customization/controllers.md', + 'Controllers', ], - sidebarDepth: 0, - }, - ], - }, - { - title: '🔧 Development', - collapsable: false, - initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default - children: [ - { - title: 'Back-end customization', - collapsable: true, - path: '/developer-docs/latest/development/backend-customization', - children: [ - ['/developer-docs/latest/development/backend-customization/routes.md', 'Routes'], - ['/developer-docs/latest/development/backend-customization/policies.md', 'Policies'], - [ - '/developer-docs/latest/development/backend-customization/middlewares.md', - 'Middlewares', - ], - [ - '/developer-docs/latest/development/backend-customization/controllers.md', - 'Controllers', - ], - [ - '/developer-docs/latest/development/backend-customization/requests-responses.md', - 'Requests & Responses', - ], - ['/developer-docs/latest/development/backend-customization/services.md', 'Services'], - ['/developer-docs/latest/development/backend-customization/models.md', 'Models'], - ['/developer-docs/latest/development/backend-customization/webhooks.md', 'Webhooks'], + [ + '/developer-docs/latest/development/backend-customization/requests-responses.md', + 'Requests & Responses', ], - }, - ['/developer-docs/latest/development/admin-customization', 'Admin panel customization'], - ['/developer-docs/latest/development/plugins-extension.md', 'Plugins extension'], - ['/developer-docs/latest/development/plugins-development.md', 'Plugins development'], - ], - }, - { - title: '💻 Developer Resources', - collapsable: false, - initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default - sidebarDepth: 2, - children: [ - { - title: 'APIs Reference', - collapsable: true, - sidebarDepth: 1, - children: [ - [ - '/developer-docs/latest/developer-resources/database-apis-reference/rest-api.md', - 'REST API', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/graphql-api.md', - 'GraphQL API', - ], - { - title: 'Query Engine API', - path: - '/developer-docs/latest/developer-resources/database-apis-reference/query-engine-api.html', - collapsable: true, - // sidebarDepth: 3, - children: [ - [ - '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/single-operations.md', - 'Single Operations', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/bulk-operations.md', - 'Bulk Operations', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/filtering.md', - 'Filtering', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/populating.md', - 'Populating', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/order-pagination.md', - 'Ordering & pagination', - ], + ['/developer-docs/latest/development/backend-customization/services.md', 'Services'], + ['/developer-docs/latest/development/backend-customization/models.md', 'Models'], + ['/developer-docs/latest/development/backend-customization/webhooks.md', 'Webhooks'], + ], + }, + ['/developer-docs/latest/development/admin-customization', 'Admin panel customization'], + ['/developer-docs/latest/development/plugins-extension.md', 'Plugins extension'], + ['/developer-docs/latest/development/plugins-development.md', 'Plugins development'], + ], + }, + { + title: '💻 Developer Resources', + collapsable: false, + initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default + sidebarDepth: 2, + children: [ + { + title: 'APIs Reference', + collapsable: true, + sidebarDepth: 1, + children: [ + [ + '/developer-docs/latest/developer-resources/database-apis-reference/rest-api.md', + 'REST API', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/graphql-api.md', + 'GraphQL API', + ], + { + title: 'Query Engine API', + path: + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine-api.html', + collapsable: true, + // sidebarDepth: 3, + children: [ + [ + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/single-operations.md', + 'Single Operations', ], - }, - { - title: 'Entity Service API', - path: - '/developer-docs/latest/developer-resources/database-apis-reference/entity-service-api', - collapsable: true, - children: [ - [ - '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/crud.md', - 'CRUD operations', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/filter.md', - 'Filters', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/populate.md', - 'Populate', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/order-pagination.md', - 'Ordering & pagination', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/components-dynamic-zones.md', - 'Components and dynamic zones', - ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/bulk-operations.md', + 'Bulk Operations', ], - }, - { - title: 'Plugin APIs Reference', - collapsable: true, - children: [ - [ - '/developer-docs/latest/developer-resources/plugin-api-reference/server.md', - 'Server API for plugins', - ], - [ - '/developer-docs/latest/developer-resources/plugin-api-reference/admin-panel.md', - 'Admin Panel API for plugins', - ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/filtering.md', + 'Filtering', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/populating.md', + 'Populating', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/order-pagination.md', + 'Ordering & pagination', ], - }, - ], - }, - ['/developer-docs/latest/developer-resources/cli/CLI', 'Command Line Interface'], - ['/developer-docs/latest/developer-resources/error-handling.md', 'Error handling'], - { - title: 'Integrations', - path: '/developer-docs/latest/developer-resources/content-api/integrations.html', - collapsable: true, - sidebarDepth: 1, - children: [ - ['/developer-docs/latest/developer-resources/content-api/integrations/react', 'React'], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/vue-js', - 'Vue.js', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/angular', - 'Angular', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/next-js', - 'Next.js', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/nuxt-js', - 'Nuxt.js', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/graphql', - 'GraphQL', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/gatsby', - 'Gatsby', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/gridsome', - 'Gridsome', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/jekyll', - 'Jekyll', - ], - ['/developer-docs/latest/developer-resources/content-api/integrations/11ty', '11ty'], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/svelte', - 'Svelte', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/sapper', - 'Sapper', - ], - ['/developer-docs/latest/developer-resources/content-api/integrations/ruby', 'Ruby'], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/python', - 'Python', ], - ['/developer-docs/latest/developer-resources/content-api/integrations/dart', 'Dart'], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/flutter', - 'Flutter', + }, + { + title: 'Entity Service API', + path: + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service-api', + collapsable: true, + children: [ + [ + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/crud.md', + 'CRUD operations', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/filter.md', + 'Filters', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/populate.md', + 'Populate', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/order-pagination.md', + 'Ordering & pagination', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/components-dynamic-zones.md', + 'Components and dynamic zones', + ], ], - ['/developer-docs/latest/developer-resources/content-api/integrations/go', 'Go'], - ['/developer-docs/latest/developer-resources/content-api/integrations/php', 'PHP'], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/laravel', - 'Laravel', + }, + { + title: 'Plugin APIs Reference', + collapsable: true, + children: [ + [ + '/developer-docs/latest/developer-resources/plugin-api-reference/server.md', + 'Server API for plugins', + ], + [ + '/developer-docs/latest/developer-resources/plugin-api-reference/admin-panel.md', + 'Admin Panel API for plugins', + ], ], + }, + ], + }, + ['/developer-docs/latest/developer-resources/cli/CLI', 'Command Line Interface'], + ['/developer-docs/latest/developer-resources/error-handling.md', 'Error handling'], + { + title: 'Integrations', + path: '/developer-docs/latest/developer-resources/content-api/integrations.html', + collapsable: true, + sidebarDepth: 1, + children: [ + ['/developer-docs/latest/developer-resources/content-api/integrations/react', 'React'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/vue-js', + 'Vue.js', ], - }, + [ + '/developer-docs/latest/developer-resources/content-api/integrations/angular', + 'Angular', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/next-js', + 'Next.js', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/nuxt-js', + 'Nuxt.js', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/graphql', + 'GraphQL', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/gatsby', + 'Gatsby', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/gridsome', + 'Gridsome', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/jekyll', + 'Jekyll', + ], + ['/developer-docs/latest/developer-resources/content-api/integrations/11ty', '11ty'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/svelte', + 'Svelte', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/sapper', + 'Sapper', + ], + ['/developer-docs/latest/developer-resources/content-api/integrations/ruby', 'Ruby'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/python', + 'Python', + ], + ['/developer-docs/latest/developer-resources/content-api/integrations/dart', 'Dart'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/flutter', + 'Flutter', + ], + ['/developer-docs/latest/developer-resources/content-api/integrations/go', 'Go'], + ['/developer-docs/latest/developer-resources/content-api/integrations/php', 'PHP'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/laravel', + 'Laravel', + ], + ], + }, + ], + }, + { + title: '🧩 Strapi plugins', + path: '/developer-docs/latest/plugins/plugins-intro.html', + collapsable: false, + children: [ + ['/developer-docs/latest/plugins/graphql', 'GraphQL'], + ['/developer-docs/latest/plugins/i18n', 'Internationalization (i18n)'], + ['/developer-docs/latest/plugins/users-permissions', 'Users & Permissions'], + ['/developer-docs/latest/plugins/email', 'Email'], + ['/developer-docs/latest/plugins/upload', 'Upload'], + ['/developer-docs/latest/plugins/documentation', 'API Documentation'], + ], + sidebarDepth: 1, + }, + { + title: '♻️ Update & Migration', + collapsable: false, + children: [ + ['/developer-docs/latest/update-migration-guides/update-version.md', 'Update'], + ['/developer-docs/latest/update-migration-guides/migration-guides.md', 'Migration'], + ], + }, + { + title: '📚 Guides', + collapsable: true, + children: [ + ['/developer-docs/latest/guides/auth-request', 'Authenticated request'], + // ['/developer-docs/latest/guides/slug', 'Create a slug system'], + // ['/developer-docs/latest/guides/is-owner', 'Create is owner policy'], + // ['/developer-docs/latest/guides/custom-admin', 'Custom admin'], + // ['/developer-docs/latest/guides/custom-data-response', 'Custom data response'], + ['/developer-docs/latest/guides/draft', 'Draft system'], + // ['/developer-docs/latest/guides/error-catching', 'Error catching'], + // ['/developer-docs/latest/guides/external-data', 'Fetching external data'], + ['/developer-docs/latest/guides/jwt-validation', 'JWT validation'], + ['/developer-docs/latest/guides/process-manager', 'Process manager'], + ['/developer-docs/latest/guides/scheduled-publication', 'Scheduled publication'], + // ['/developer-docs/latest/guides/secure-your-app', 'Secure your application'], + // ['/developer-docs/latest/guides/send-email', 'Send email programmatically'], + // [ + // '/developer-docs/latest/guides/registering-a-field-in-admin', + // 'Registering a new field in the admin panel', + // ], + // ['/developer-docs/latest/guides/client', 'Setup a third party client'], + ['/developer-docs/latest/guides/unit-testing', 'Unit testing'], + ], + }, + ], + user: [ + { + collapsable: false, + title: '', + children: [ + ['/user-docs/latest/getting-started/introduction', 'Welcome to the Strapi user guide!'], + ], + }, + { + collapsable: false, + title: 'Content Manager', + children: [ + [ + '/user-docs/latest/content-manager/introduction-to-content-manager', + 'Introduction to the Content Manager', ], - }, - { - title: '🧩 Strapi plugins', - path: '/developer-docs/latest/plugins/plugins-intro.html', - collapsable: false, - children: [ - ['/developer-docs/latest/plugins/graphql', 'GraphQL'], - ['/developer-docs/latest/plugins/i18n', 'Internationalization (i18n)'], - ['/developer-docs/latest/plugins/users-permissions', 'Users & Permissions'], - ['/developer-docs/latest/plugins/email', 'Email'], - ['/developer-docs/latest/plugins/upload', 'Upload'], - ['/developer-docs/latest/plugins/documentation', 'API Documentation'], + [ + '/user-docs/latest/content-manager/configuring-view-of-content-type', + 'Configuring the views of a content type', ], - sidebarDepth: 1, - }, - { - title: '♻️ Update & Migration', - collapsable: false, - children: [ - ['/developer-docs/latest/update-migration-guides/update-version.md', 'Update'], - ['/developer-docs/latest/update-migration-guides/migration-guides.md', 'Migration'], + ['/user-docs/latest/content-manager/writing-content', 'Writing content'], + [ + '/user-docs/latest/content-manager/managing-relational-fields', + 'Managing relational fields', ], - }, - { - title: '📚 Guides', - collapsable: true, - children: [ - ['/developer-docs/latest/guides/auth-request', 'Authenticated request'], - // ['/developer-docs/latest/guides/slug', 'Create a slug system'], - // ['/developer-docs/latest/guides/is-owner', 'Create is owner policy'], - // ['/developer-docs/latest/guides/custom-admin', 'Custom admin'], - // ['/developer-docs/latest/guides/custom-data-response', 'Custom data response'], - ['/developer-docs/latest/guides/draft', 'Draft system'], - // ['/developer-docs/latest/guides/error-catching', 'Error catching'], - // ['/developer-docs/latest/guides/external-data', 'Fetching external data'], - ['/developer-docs/latest/guides/jwt-validation', 'JWT validation'], - ['/developer-docs/latest/guides/process-manager', 'Process manager'], - ['/developer-docs/latest/guides/scheduled-publication', 'Scheduled publication'], - // ['/developer-docs/latest/guides/secure-your-app', 'Secure your application'], - // ['/developer-docs/latest/guides/send-email', 'Send email programmatically'], - // [ - // '/developer-docs/latest/guides/registering-a-field-in-admin', - // 'Registering a new field in the admin panel', - // ], - // ['/developer-docs/latest/guides/client', 'Setup a third party client'], - ['/developer-docs/latest/guides/unit-testing', 'Unit testing'], + ['/user-docs/latest/content-manager/translating-content', 'Translating content'], + [ + '/user-docs/latest/content-manager/saving-and-publishing-content', + 'Saving, publishing and deleting content', ], - }, - ], - user: [ - { - collapsable: false, - title: '', - children: [ - ['/user-docs/latest/getting-started/introduction', 'Welcome to the Strapi user guide!'], + ], + }, + { + collapsable: false, + title: 'Content-Type Builder', + children: [ + [ + '/user-docs/latest/content-types-builder/introduction-to-content-types-builder', + 'Introduction to the Content-Type Builder', ], - }, - { - collapsable: false, - title: 'Content Manager', - children: [ - [ - '/user-docs/latest/content-manager/introduction-to-content-manager', - 'Introduction to the Content Manager', - ], - [ - '/user-docs/latest/content-manager/configuring-view-of-content-type', - 'Configuring the views of a content type', - ], - ['/user-docs/latest/content-manager/writing-content', 'Writing content'], - [ - '/user-docs/latest/content-manager/managing-relational-fields', - 'Managing relational fields', - ], - ['/user-docs/latest/content-manager/translating-content', 'Translating content'], - [ - '/user-docs/latest/content-manager/saving-and-publishing-content', - 'Saving, publishing and deleting content', - ], + [ + '/user-docs/latest/content-types-builder/creating-new-content-type', + 'Creating content types', ], - }, - { - collapsable: false, - title: 'Content-Type Builder', - children: [ - [ - '/user-docs/latest/content-types-builder/introduction-to-content-types-builder', - 'Introduction to the Content-Type Builder', - ], - [ - '/user-docs/latest/content-types-builder/creating-new-content-type', - 'Creating content types', - ], - [ - '/user-docs/latest/content-types-builder/managing-content-types', - 'Managing content types', - ], - [ - '/user-docs/latest/content-types-builder/configuring-fields-content-type', - 'Configuring fields for content types', - ], + [ + '/user-docs/latest/content-types-builder/managing-content-types', + 'Managing content types', ], - }, - { - collapsable: false, - title: 'Users, Roles & Permissions', - children: [ - [ - '/user-docs/latest/users-roles-permissions/introduction-to-users-roles-permissions', - 'Introduction to users, roles & permissions', - ], - [ - '/user-docs/latest/users-roles-permissions/configuring-administrator-roles', - 'Configuring administrator roles', - ], - [ - '/user-docs/latest/users-roles-permissions/managing-administrators', - 'Managing administrator accounts', - ], - [ - '/user-docs/latest/users-roles-permissions/configuring-end-users-roles', - 'Configuring end-users roles', - ], - [ - '/user-docs/latest/users-roles-permissions/managing-end-users', - 'Managing end-users accounts', - ], + [ + '/user-docs/latest/content-types-builder/configuring-fields-content-type', + 'Configuring fields for content types', ], - }, - { - collapsable: false, - title: 'Plugins', - children: [ - ['/user-docs/latest/plugins/introduction-to-plugins', 'Introduction to plugins'], - [ - '/user-docs/latest/plugins/installing-plugins-via-marketplace', - 'Installing plugins via the Marketplace', - ], - ['/user-docs/latest/plugins/strapi-plugins', 'List of Strapi plugins'], + ], + }, + { + collapsable: false, + title: 'Users, Roles & Permissions', + children: [ + [ + '/user-docs/latest/users-roles-permissions/introduction-to-users-roles-permissions', + 'Introduction to users, roles & permissions', ], - }, - { - collapsable: false, - title: 'General settings', - children: [ - ['/user-docs/latest/settings/managing-global-settings', 'Managing global settings'], - [ - '/user-docs/latest/settings/configuring-users-permissions-plugin-settings', - 'Configuring Users & Permissions plugin settings', - ], + [ + '/user-docs/latest/users-roles-permissions/configuring-administrator-roles', + 'Configuring administrator roles', ], - }, - ], - }; - - const checklinksIgnoredFiles = [ - '**/node_modules', // please never remove this one - /** - * Caution: Adding an individual file to this section - * will prevent the _whole_ file from being scanned for broken links. - * - * Currently, there is no easy way to ignore a specific link inside a file. - */ - - /** - * Files below give false positives - */ - '/developer-docs/latest/developer-resources/plugin-api-reference/admin-panel.md', - './developer-docs/latest/development/backend-customization/models.md', - './developer-docs/latest/guides/count-graphql.md', // might be removed once GraphQL customization is ready - './developer-docs/latest/setup-deployment-guides/configurations.md', // the script thinks filename[]() at line 977 is a real link - './developer-docs/latest/development/backend-customization/webhooks.md', // 'missing" links are in commented part of file - ]; + [ + '/user-docs/latest/users-roles-permissions/managing-administrators', + 'Managing administrator accounts', + ], + [ + '/user-docs/latest/users-roles-permissions/configuring-end-users-roles', + 'Configuring end-users roles', + ], + [ + '/user-docs/latest/users-roles-permissions/managing-end-users', + 'Managing end-users accounts', + ], + ], + }, + { + collapsable: false, + title: 'Plugins', + children: [ + ['/user-docs/latest/plugins/introduction-to-plugins', 'Introduction to plugins'], + [ + '/user-docs/latest/plugins/installing-plugins-via-marketplace', + 'Installing plugins via the Marketplace', + ], + ['/user-docs/latest/plugins/strapi-plugins', 'List of Strapi plugins'], + ], + }, + { + collapsable: false, + title: 'General settings', + children: [ + ['/user-docs/latest/settings/managing-global-settings', 'Managing global settings'], + [ + '/user-docs/latest/settings/configuring-users-permissions-plugin-settings', + 'Configuring Users & Permissions plugin settings', + ], + ], + }, + ], +}; + - const plugins = [ - ['vuepress-plugin-element-tabs', {}], +const checklinksIgnoredFiles = [ + '**/node_modules', // please never remove this one + /** + * Caution: Adding an individual file to this section + * will prevent the _whole_ file from being scanned for broken links. + * + * Currently, there is no easy way to ignore a specific link inside a file. + */ + + /** + * Files below give false positives + */ + '/developer-docs/latest/developer-resources/plugin-api-reference/admin-panel.md', + './developer-docs/latest/development/backend-customization/models.md', + './developer-docs/latest/guides/count-graphql.md', // might be removed once GraphQL customization is ready + './developer-docs/latest/setup-deployment-guides/configurations.md', // the script thinks filename[]() at line 977 is a real link + './developer-docs/latest/development/backend-customization/webhooks.md', // 'missing" links are in commented part of file +]; + +const plugins = [ + ['vuepress-plugin-element-tabs', {}], + [ + 'check-md', + { + ignore: checklinksIgnoredFiles, + }, + ], + [ + 'seo', + { + siteTitle: (_, $site) => $site.title, + title: $page => $page.title, + }, + ], + ['@vuepress/medium-zoom'], + [ + 'vuepress-plugin-code-copy', + { + color: '#ffffff', + successText: 'Copied to clipboard!', + }, + ], + ['@vuepress/back-to-top', {}], + [ + 'vuepress-plugin-container', + { + type: 'callout', + defaultTitle: '', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'strapi', + defaultTitle: '', + before: info => + `

🤓 ${info}

`, + after: '
', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'tip', + before: info => `

💡 ${info}

`, + after: '
', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'note', + before: info => `

✏️ ${info}

`, + after: '
', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'caution', + before: info => + `

✋ ${info}

`, + after: '
', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'warning', + before: info => + `

️❗️ ${info}

`, + after: '
', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'prerequisites', + defaultTitle: 'PREREQUISITES', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'api-call', + defaultTitle: '', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'request', + defaultTitle: 'Request', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'response', + defaultTitle: 'Response', + }, + ], +]; + +module.exports = { + title: '', + port: 8080, + description: 'The headless CMS developers love.', + base: '/', + plugins: plugins, + head: [ [ - 'check-md', + 'link', { - ignore: checklinksIgnoredFiles, + rel: 'icon', + href: 'https://strapi.io/assets/favicon-32x32.png', }, ], [ - 'seo', + 'meta', { - siteTitle: (_, $site) => $site.title, - title: $page => $page.title, + property: 'og:title', + content: 'Strapi Documentation', }, ], - ['@vuepress/medium-zoom'], [ - 'vuepress-plugin-code-copy', + 'meta', { - color: '#ffffff', - successText: 'Copied to clipboard!', + property: 'og:type', + content: 'article', }, ], - ['@vuepress/back-to-top', {}], [ - 'vuepress-plugin-container', + 'meta', { - type: 'callout', - defaultTitle: '', + property: 'og:url', + content: 'https://strapi.io/documentation/', }, ], [ - 'vuepress-plugin-container', + 'meta', { - type: 'strapi', - defaultTitle: '', - before: info => - `

🤓 ${info}

`, - after: '
', + property: 'og:description', + content: 'The headless CMS developers love.', }, ], [ - 'vuepress-plugin-container', + 'meta', { - type: 'tip', - before: info => `

💡 ${info}

`, - after: '
', + property: 'og:image', + content: 'https://strapi.io/documentation/assets/meta.png', }, ], [ - 'vuepress-plugin-container', + 'meta', { - type: 'note', - before: info => `

✏️ ${info}

`, - after: '
', + property: 'og:article:author', + content: 'strapi', }, ], + [ - 'vuepress-plugin-container', + 'meta', { - type: 'caution', - before: info => - `

✋ ${info}

`, - after: '
', + property: 'twitter:card', + content: 'summary_large_image', }, ], [ - 'vuepress-plugin-container', + 'meta', { - type: 'warning', - before: info => - `

️❗️ ${info}

`, - after: '
', + property: 'twitter:url', + content: 'https://strapi.io/documentation/', }, ], [ - 'vuepress-plugin-container', + 'meta', { - type: 'prerequisites', - defaultTitle: 'PREREQUISITES', + property: 'twitter:site', + content: '@strapijs', }, ], [ - 'vuepress-plugin-container', + 'meta', { - type: 'api-call', - defaultTitle: '', + property: 'twitter:title', + content: 'Strapi Documentation', }, ], [ - 'vuepress-plugin-container', + 'meta', { - type: 'request', - defaultTitle: 'Request', + property: 'twitter:description', + content: 'The headless CMS developers love.', }, ], [ - 'vuepress-plugin-container', + 'meta', { - type: 'response', - defaultTitle: 'Response', + property: 'twitter:image', + content: 'http://strapi.io/assets/images/strapi-website-preview.png', }, ], - ]; - - module.exports = { - title: '', - port: 8080, - description: 'The headless CMS developers love.', - base: '/', - plugins: plugins, - head: [ - [ - 'link', - { - rel: 'icon', - href: 'https://strapi.io/assets/favicon-32x32.png', - }, - ], - [ - 'meta', - { - property: 'og:title', - content: 'Strapi Documentation', - }, - ], - [ - 'meta', - { - property: 'og:type', - content: 'article', - }, - ], - [ - 'meta', - { - property: 'og:url', - content: 'https://strapi.io/documentation/', - }, - ], - [ - 'meta', - { - property: 'og:description', - content: 'The headless CMS developers love.', - }, - ], - [ - 'meta', - { - property: 'og:image', - content: 'https://strapi.io/documentation/assets/meta.png', - }, - ], - [ - 'meta', - { - property: 'og:article:author', - content: 'strapi', - }, - ], - - [ - 'meta', - { - property: 'twitter:card', - content: 'summary_large_image', - }, - ], - [ - 'meta', - { - property: 'twitter:url', - content: 'https://strapi.io/documentation/', - }, - ], - [ - 'meta', - { - property: 'twitter:site', - content: '@strapijs', - }, - ], - [ - 'meta', - { - property: 'twitter:title', - content: 'Strapi Documentation', - }, - ], - [ - 'meta', - { - property: 'twitter:description', - content: 'The headless CMS developers love.', - }, - ], - [ - 'meta', - { - property: 'twitter:image', - content: 'http://strapi.io/assets/images/strapi-website-preview.png', - }, - ], - [ - 'script', - {}, - `(function(w, d, s, l, i) { - w[l] = w[l] || []; - w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' }); - var f = d.getElementsByTagName(s)[0], - j = d.createElement(s), - dl = l != 'dataLayer' ? '&l=' + l : ''; - j.async = true; - j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; - f.parentNode.insertBefore(j, f); - })(window, document, 'script', 'dataLayer', 'GTM-KN9JRWG'); - `, - ], + [ + 'script', + {}, + `(function(w, d, s, l, i) { + w[l] = w[l] || []; + w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' }); + var f = d.getElementsByTagName(s)[0], + j = d.createElement(s), + dl = l != 'dataLayer' ? '&l=' + l : ''; + j.async = true; + j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; + f.parentNode.insertBefore(j, f); +})(window, document, 'script', 'dataLayer', 'GTM-KN9JRWG'); +`, ], - themeConfig: { - logo: '/assets/logo.png', - nav: [ - { - text: 'Resource Center', - link: 'https://strapi.io/resource-center', - }, - { - text: 'v4 Documentation', - items: [ - { - text: 'Developer Docs', - items: [ - { - text: 'Getting Started', - link: '/developer-docs/latest/getting-started/introduction.html', - }, - { - text: 'Setup & Deployment', - link: '/developer-docs/latest/setup-deployment-guides/installation.html', - }, - { - text: 'Plugins', - link: '/developer-docs/latest/plugins/plugins-intro.html', - }, - { - text: 'Development', - link: '/developer-docs/latest/development/backend-customization.html', - }, - { - text: 'Update & Migration', - link: '/developer-docs/latest/update-migration-guides/update-version.html', - }, - { - text: 'Developer Resources', - link: '/developer-docs/latest/developer-resources/content-api/content-api.html', - }, - ], - }, - { - text: 'User Guide', - items: [ - { - text: 'Getting Started', - link: '/user-docs/latest/getting-started/introduction.html', - }, - { - text: 'Content Manager', - link: '/user-docs/latest/content-manager/introduction-to-content-manager.html', - }, - { - text: 'Content-Type Builder', - link: - '/user-docs/latest/content-types-builder/introduction-to-content-types-builder.html', - }, - { - text: 'Users, Roles, and Permissions', - link: - '/user-docs/latest/users-roles-permissions/introduction-to-users-roles-permissions.html', - }, - { - text: 'Plugins', - link: '/user-docs/latest/plugins/introduction-to-plugins.html', - }, - { - text: 'General Settings', - link: '/user-docs/latest/settings/managing-global-settings.html', - }, - ], - }, - ], - }, - { - text: 'v3 documentation', - link: 'https://docs-v3.strapi.io' - }, - { - text: 'Ecosystem', - items: [ - { - text: 'Strapi', - items: [ - { - text: 'Website', - link: 'https://strapi.io', - }, - { - text: 'Blog', - link: 'https://strapi.io/blog', - }, - { - text: 'StrapiConf 2021', - link: 'https://www.strapi.io/strapi-conf-2021', - }, - ], - }, - { - text: 'Community', - items: [ - { - text: 'Forum', - link: 'https://forum.strapi.io', - }, - { - text: 'Discord', - link: 'https://discord.strapi.io', - }, - { - text: 'Awesome-Strapi', - link: 'https://github.com/strapi/awesome-strapi', - }, - ], - }, - { - text: 'Resources', - items: [ - { - text: 'Tutorials', - link: 'https://strapi.io/tutorials', - }, - { - text: 'Academy', - link: 'https://academy.strapi.io/', - }, - ], - }, - ], - }, - { - text: "We're hiring!", - link: 'https://strapi.io/careers#open-positions', - }, - ], - repo: 'strapi/documentation', - docsDir: 'docs', - docsBranch: 'main', - algolia: { - appId: '9FTY6J9E4X', - apiKey: 'cf49c82a1865df2618a3d89e18657051', - indexName: 'documentation', + ], + themeConfig: { + logo: '/assets/logo.png', + nav: [ + { + text: 'Resource Center', + link: 'https://strapi.io/resource-center', }, - editLinks: true, - editLinkText: 'Improve this page', - serviceWorker: true, - sidebarDepth: 1, - smoothScroll: false, - sidebar: { - '/developer-docs/latest/': sidebar.developer, - '/user-docs/latest/': sidebar.user, + { + text: 'v4 Documentation', + items: [ + { + text: 'Developer Docs', + items: [ + { + text: 'Getting Started', + link: '/developer-docs/latest/getting-started/introduction.html', + }, + { + text: 'Setup & Deployment', + link: '/developer-docs/latest/setup-deployment-guides/installation.html', + }, + { + text: 'Plugins', + link: '/developer-docs/latest/plugins/plugins-intro.html', + }, + { + text: 'Development', + link: '/developer-docs/latest/development/backend-customization.html', + }, + { + text: 'Update & Migration', + link: '/developer-docs/latest/update-migration-guides/update-version.html', + }, + { + text: 'Developer Resources', + link: '/developer-docs/latest/developer-resources/content-api/content-api.html', + }, + ], + }, + { + text: 'User Guide', + items: [ + { + text: 'Getting Started', + link: '/user-docs/latest/getting-started/introduction.html', + }, + { + text: 'Content Manager', + link: '/user-docs/latest/content-manager/introduction-to-content-manager.html', + }, + { + text: 'Content-Type Builder', + link: + '/user-docs/latest/content-types-builder/introduction-to-content-types-builder.html', + }, + { + text: 'Users, Roles, and Permissions', + link: + '/user-docs/latest/users-roles-permissions/introduction-to-users-roles-permissions.html', + }, + { + text: 'Plugins', + link: '/user-docs/latest/plugins/introduction-to-plugins.html', + }, + { + text: 'General Settings', + link: '/user-docs/latest/settings/managing-global-settings.html', + }, + ], + }, + ], }, - }, - markdown: { - extendMarkdown: md => { - // use more markdown-it plugins! - md.use(require('markdown-it-include')); + { + text: 'v3 documentation', + link: 'https://docs-v3.strapi.io' }, + { + text: 'Ecosystem', + items: [ + { + text: 'Strapi', + items: [ + { + text: 'Website', + link: 'https://strapi.io', + }, + { + text: 'Blog', + link: 'https://strapi.io/blog', + }, + { + text: 'StrapiConf 2021', + link: 'https://www.strapi.io/strapi-conf-2021', + }, + ], + }, + { + text: 'Community', + items: [ + { + text: 'Forum', + link: 'https://forum.strapi.io', + }, + { + text: 'Discord', + link: 'https://discord.strapi.io', + }, + { + text: 'Awesome-Strapi', + link: 'https://github.com/strapi/awesome-strapi', + }, + ], + }, + { + text: 'Resources', + items: [ + { + text: 'Tutorials', + link: 'https://strapi.io/tutorials', + }, + { + text: 'Academy', + link: 'https://academy.strapi.io/', + }, + ], + }, + ], + }, + { + text: "We're hiring!", + link: 'https://strapi.io/careers#open-positions', + }, + ], + repo: 'strapi/documentation', + docsDir: 'docs', + docsBranch: 'main', + algolia: { + appId: '9FTY6J9E4X', + apiKey: 'cf49c82a1865df2618a3d89e18657051', + indexName: 'documentation', + }, + editLinks: true, + editLinkText: 'Improve this page', + serviceWorker: true, + sidebarDepth: 1, + smoothScroll: false, + sidebar: { + '/developer-docs/latest/': sidebar.developer, + '/user-docs/latest/': sidebar.user, + }, + }, + markdown: { + extendMarkdown: md => { + // use more markdown-it plugins! + md.use(require('markdown-it-include')); }, - }; + }, +}; \ No newline at end of file diff --git a/docs/.vuepress/sidebar.js b/docs/.vuepress/sidebar.js new file mode 100644 index 0000000000..2aad810209 --- /dev/null +++ b/docs/.vuepress/sidebar.js @@ -0,0 +1,538 @@ +const sidebar = { + developer: [ + { + title: '🚀 Getting Started', + collapsable: false, + children: [ + ['/developer-docs/latest/getting-started/introduction', 'Introduction'], + ['/developer-docs/latest/getting-started/quick-start', 'Quick Start Guide'], + ['/developer-docs/latest/getting-started/troubleshooting', 'Frequently Asked Questions'], + ['/developer-docs/latest/getting-started/usage-information', 'Usage Information'], + ], + }, + { + title: '⚙️ Setup & Deployment', + collapsable: false, + sidebarDepth: 0, + initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default + children: [ + { + title: 'Installation', + path: '/developer-docs/latest/setup-deployment-guides/installation.html', + collapsable: true, + sidebarDepth: 1, + children: [ + ['/developer-docs/latest/setup-deployment-guides/installation/cli.md', 'CLI'], + ['/developer-docs/latest/setup-deployment-guides/installation/docker.md', 'Docker'], + [ + '/developer-docs/latest/setup-deployment-guides/installation/digitalocean-one-click.md', + 'DigitalOcean One-Click', + ], + [ + '/developer-docs/latest/setup-deployment-guides/installation/platformsh.md', + 'Platform.sh One-Click', + ], + [ + '/developer-docs/latest/setup-deployment-guides/installation/render.md', + 'Render One-Click', + ], + ], + }, + ['/developer-docs/latest/setup-deployment-guides/file-structure.md', 'Project structure'], + { + title: 'Configurations', + path: '/developer-docs/latest/setup-deployment-guides/configurations.html', + collapsable: true, + children: [ + { + title: 'Required configurations', + collapsable: true, + children: [ + [ + '/developer-docs/latest/setup-deployment-guides/configurations/required/databases.md', + 'Database', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/required/server.md', + 'Server', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/required/admin-panel.md', + 'Admin panel', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/required/middlewares.md', + 'Middlewares', + ], + ], + }, + { + title: 'Optional configurations', + collapsable: true, + children: [ + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/api-tokens.md', + 'API tokens', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/functions.md', + 'Functions', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/cronjobs.md', + 'Cron jobs', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/api.md', + 'API', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/plugins.md', + 'Plugins', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.md', + 'Environment', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/public-assets.md', + 'Public Assets', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md', + 'Single Sign On (SSO)', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/rbac.md', + 'Role-Based Access Control (RBAC)', + ], + ], + }, + ], + }, + { + title: 'Deployment', + path: '/developer-docs/latest/setup-deployment-guides/deployment', + collapsable: true, + initialOpenGroupIndex: -1, // make sure that no subgroup is open by default — if set to 0, 'Hosting Provider Guides' is expanded + children: [ + { + title: 'Hosting Provider Guides', + path: + '/developer-docs/latest/setup-deployment-guides/deployment.html#hosting-provider-guides', + collapsable: true, + children: [ + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/21yunbox.md', + '21YunBox', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/amazon-aws.md', + 'Amazon AWS', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/azure.md', + 'Azure', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean-app-platform.md', + 'DigitalOcean App Platform', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean.md', + 'DigitalOcean Droplets', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/google-app-engine.md', + 'Google App Engine', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/heroku.md', + 'Heroku', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/qovery.md', + 'Qovery', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/render.md', + 'Render', + ], + ], + sidebarDepth: 2, + }, + { + title: 'Optional Software Guides', + path: + '/developer-docs/latest/setup-deployment-guides/deployment.html#optional-software-guides', + collapsable: true, + children: [ + [ + '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/caddy-proxy.md', + 'Caddy', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/haproxy-proxy.md', + 'HAProxy', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/nginx-proxy.md', + 'Nginx', + ], + ], + sidebarDepth: 2, + }, + ], + sidebarDepth: 0, + }, + ], + }, + { + title: '🔧 Development', + collapsable: false, + initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default + children: [ + { + title: 'Back-end customization', + collapsable: true, + path: '/developer-docs/latest/development/backend-customization', + children: [ + ['/developer-docs/latest/development/backend-customization/routes.md', 'Routes'], + ['/developer-docs/latest/development/backend-customization/policies.md', 'Policies'], + [ + '/developer-docs/latest/development/backend-customization/middlewares.md', + 'Middlewares', + ], + [ + '/developer-docs/latest/development/backend-customization/controllers.md', + 'Controllers', + ], + [ + '/developer-docs/latest/development/backend-customization/requests-responses.md', + 'Requests & Responses', + ], + ['/developer-docs/latest/development/backend-customization/services.md', 'Services'], + ['/developer-docs/latest/development/backend-customization/models.md', 'Models'], + ['/developer-docs/latest/development/backend-customization/webhooks.md', 'Webhooks'], + ], + }, + ['/developer-docs/latest/development/admin-customization', 'Admin panel customization'], + ['/developer-docs/latest/development/plugins-extension.md', 'Plugins extension'], + ['/developer-docs/latest/development/plugins-development.md', 'Plugins development'], + ], + }, + { + title: '💻 Developer Resources', + collapsable: false, + initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default + sidebarDepth: 2, + children: [ + { + title: 'APIs Reference', + collapsable: true, + sidebarDepth: 1, + children: [ + [ + '/developer-docs/latest/developer-resources/database-apis-reference/rest-api.md', + 'REST API', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/graphql-api.md', + 'GraphQL API', + ], + { + title: 'Query Engine API', + path: + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine-api.html', + collapsable: true, + // sidebarDepth: 3, + children: [ + [ + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/single-operations.md', + 'Single Operations', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/bulk-operations.md', + 'Bulk Operations', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/filtering.md', + 'Filtering', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/populating.md', + 'Populating', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/order-pagination.md', + 'Ordering & pagination', + ], + ], + }, + { + title: 'Entity Service API', + path: + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service-api', + collapsable: true, + children: [ + [ + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/crud.md', + 'CRUD operations', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/filter.md', + 'Filters', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/populate.md', + 'Populate', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/order-pagination.md', + 'Ordering & pagination', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/components-dynamic-zones.md', + 'Components and dynamic zones', + ], + ], + }, + { + title: 'Plugin APIs Reference', + collapsable: true, + children: [ + [ + '/developer-docs/latest/developer-resources/plugin-api-reference/server.md', + 'Server API for plugins', + ], + [ + '/developer-docs/latest/developer-resources/plugin-api-reference/admin-panel.md', + 'Admin Panel API for plugins', + ], + ], + }, + ], + }, + ['/developer-docs/latest/developer-resources/cli/CLI', 'Command Line Interface'], + ['/developer-docs/latest/developer-resources/error-handling.md', 'Error handling'], + { + title: 'Integrations', + path: '/developer-docs/latest/developer-resources/content-api/integrations.html', + collapsable: true, + sidebarDepth: 1, + children: [ + ['/developer-docs/latest/developer-resources/content-api/integrations/react', 'React'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/vue-js', + 'Vue.js', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/angular', + 'Angular', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/next-js', + 'Next.js', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/nuxt-js', + 'Nuxt.js', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/graphql', + 'GraphQL', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/gatsby', + 'Gatsby', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/gridsome', + 'Gridsome', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/jekyll', + 'Jekyll', + ], + ['/developer-docs/latest/developer-resources/content-api/integrations/11ty', '11ty'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/svelte', + 'Svelte', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/sapper', + 'Sapper', + ], + ['/developer-docs/latest/developer-resources/content-api/integrations/ruby', 'Ruby'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/python', + 'Python', + ], + ['/developer-docs/latest/developer-resources/content-api/integrations/dart', 'Dart'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/flutter', + 'Flutter', + ], + ['/developer-docs/latest/developer-resources/content-api/integrations/go', 'Go'], + ['/developer-docs/latest/developer-resources/content-api/integrations/php', 'PHP'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/laravel', + 'Laravel', + ], + ], + }, + ], + }, + { + title: '🧩 Strapi plugins', + path: '/developer-docs/latest/plugins/plugins-intro.html', + collapsable: false, + children: [ + ['/developer-docs/latest/plugins/graphql', 'GraphQL'], + ['/developer-docs/latest/plugins/i18n', 'Internationalization (i18n)'], + ['/developer-docs/latest/plugins/users-permissions', 'Users & Permissions'], + ['/developer-docs/latest/plugins/email', 'Email'], + ['/developer-docs/latest/plugins/upload', 'Upload'], + ['/developer-docs/latest/plugins/documentation', 'API Documentation'], + ], + sidebarDepth: 1, + }, + { + title: '♻️ Update & Migration', + collapsable: false, + children: [ + ['/developer-docs/latest/update-migration-guides/update-version.md', 'Update'], + ['/developer-docs/latest/update-migration-guides/migration-guides.md', 'Migration'], + ], + }, + { + title: '📚 Guides', + collapsable: true, + children: [ + ['/developer-docs/latest/guides/auth-request', 'Authenticated request'], + // ['/developer-docs/latest/guides/slug', 'Create a slug system'], + // ['/developer-docs/latest/guides/is-owner', 'Create is owner policy'], + // ['/developer-docs/latest/guides/custom-admin', 'Custom admin'], + // ['/developer-docs/latest/guides/custom-data-response', 'Custom data response'], + ['/developer-docs/latest/guides/draft', 'Draft system'], + // ['/developer-docs/latest/guides/error-catching', 'Error catching'], + // ['/developer-docs/latest/guides/external-data', 'Fetching external data'], + ['/developer-docs/latest/guides/jwt-validation', 'JWT validation'], + ['/developer-docs/latest/guides/process-manager', 'Process manager'], + ['/developer-docs/latest/guides/scheduled-publication', 'Scheduled publication'], + // ['/developer-docs/latest/guides/secure-your-app', 'Secure your application'], + // ['/developer-docs/latest/guides/send-email', 'Send email programmatically'], + // [ + // '/developer-docs/latest/guides/registering-a-field-in-admin', + // 'Registering a new field in the admin panel', + // ], + // ['/developer-docs/latest/guides/client', 'Setup a third party client'], + ['/developer-docs/latest/guides/unit-testing', 'Unit testing'], + ], + }, + ], + user: [ + { + collapsable: false, + title: '', + children: [ + ['/user-docs/latest/getting-started/introduction', 'Welcome to the Strapi user guide!'], + ], + }, + { + collapsable: false, + title: 'Content Manager', + children: [ + [ + '/user-docs/latest/content-manager/introduction-to-content-manager', + 'Introduction to the Content Manager', + ], + [ + '/user-docs/latest/content-manager/configuring-view-of-content-type', + 'Configuring the views of a content type', + ], + ['/user-docs/latest/content-manager/writing-content', 'Writing content'], + [ + '/user-docs/latest/content-manager/managing-relational-fields', + 'Managing relational fields', + ], + ['/user-docs/latest/content-manager/translating-content', 'Translating content'], + [ + '/user-docs/latest/content-manager/saving-and-publishing-content', + 'Saving, publishing and deleting content', + ], + ], + }, + { + collapsable: false, + title: 'Content-Type Builder', + children: [ + [ + '/user-docs/latest/content-types-builder/introduction-to-content-types-builder', + 'Introduction to the Content-Type Builder', + ], + [ + '/user-docs/latest/content-types-builder/creating-new-content-type', + 'Creating content types', + ], + [ + '/user-docs/latest/content-types-builder/managing-content-types', + 'Managing content types', + ], + [ + '/user-docs/latest/content-types-builder/configuring-fields-content-type', + 'Configuring fields for content types', + ], + ], + }, + { + collapsable: false, + title: 'Users, Roles & Permissions', + children: [ + [ + '/user-docs/latest/users-roles-permissions/introduction-to-users-roles-permissions', + 'Introduction to users, roles & permissions', + ], + [ + '/user-docs/latest/users-roles-permissions/configuring-administrator-roles', + 'Configuring administrator roles', + ], + [ + '/user-docs/latest/users-roles-permissions/managing-administrators', + 'Managing administrator accounts', + ], + [ + '/user-docs/latest/users-roles-permissions/configuring-end-users-roles', + 'Configuring end-users roles', + ], + [ + '/user-docs/latest/users-roles-permissions/managing-end-users', + 'Managing end-users accounts', + ], + ], + }, + { + collapsable: false, + title: 'Plugins', + children: [ + ['/user-docs/latest/plugins/introduction-to-plugins', 'Introduction to plugins'], + [ + '/user-docs/latest/plugins/installing-plugins-via-marketplace', + 'Installing plugins via the Marketplace', + ], + ['/user-docs/latest/plugins/strapi-plugins', 'List of Strapi plugins'], + ], + }, + { + collapsable: false, + title: 'General settings', + children: [ + ['/user-docs/latest/settings/managing-global-settings', 'Managing global settings'], + [ + '/user-docs/latest/settings/configuring-users-permissions-plugin-settings', + 'Configuring Users & Permissions plugin settings', + ], + ], + }, + ], +}; diff --git a/docs/package.json b/docs/package.json index 6229ce4ede..c7669502d9 100644 --- a/docs/package.json +++ b/docs/package.json @@ -3,7 +3,7 @@ "version": "3.0.0", "main": "index.js", "scripts": { - "dev": "vuepress dev", + "dev": "yarn create:config-file && vuepress dev", "build": "vuepress build", "check-links": "vuepress check-md", "create:config-file": "node ./scripts/create-config-file.js" diff --git a/docs/scripts/create-config-file.js b/docs/scripts/create-config-file.js index c8b3d40a75..cf3e0c2eea 100644 --- a/docs/scripts/create-config-file.js +++ b/docs/scripts/create-config-file.js @@ -2,945 +2,411 @@ const path = require('path'); const fs = require('fs-extra'); +// const sidebar = require('../.vuepress/sidebar'); const createConfigFile = async () => { + const sidebar = await fs.readFile(path.resolve(__dirname, '..', '.vuepress', 'sidebar.js')); + const content = ` - const sidebar = { - developer: [ - { - title: '🚀 Getting Started', - collapsable: false, - children: [ - ['/developer-docs/latest/getting-started/introduction', 'Introduction'], - ['/developer-docs/latest/getting-started/quick-start', 'Quick Start Guide'], - ['/developer-docs/latest/getting-started/troubleshooting', 'Frequently Asked Questions'], - ['/developer-docs/latest/getting-started/usage-information', 'Usage Information'], - ], - }, - { - title: '⚙️ Setup & Deployment', - collapsable: false, - sidebarDepth: 0, - initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default - children: [ - { - title: 'Installation', - path: '/developer-docs/latest/setup-deployment-guides/installation.html', - collapsable: true, - sidebarDepth: 1, - children: [ - ['/developer-docs/latest/setup-deployment-guides/installation/cli.md', 'CLI'], - ['/developer-docs/latest/setup-deployment-guides/installation/docker.md', 'Docker'], - [ - '/developer-docs/latest/setup-deployment-guides/installation/digitalocean-one-click.md', - 'DigitalOcean One-Click', - ], - [ - '/developer-docs/latest/setup-deployment-guides/installation/platformsh.md', - 'Platform.sh One-Click', - ], - [ - '/developer-docs/latest/setup-deployment-guides/installation/render.md', - 'Render One-Click', - ], - ], - }, - ['/developer-docs/latest/setup-deployment-guides/file-structure.md', 'Project structure'], - { - title: 'Configurations', - path: '/developer-docs/latest/setup-deployment-guides/configurations.html', - collapsable: true, - children: [ - { - title: 'Required configurations', - collapsable: true, - children: [ - [ - '/developer-docs/latest/setup-deployment-guides/configurations/required/databases.md', - 'Database', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/required/server.md', - 'Server', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/required/admin-panel.md', - 'Admin panel', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/required/middlewares.md', - 'Middlewares', - ], - ], - }, - { - title: 'Optional configurations', - collapsable: true, - children: [ - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/api-tokens.md', - 'API tokens', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/functions.md', - 'Functions', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/cronjobs.md', - 'Cron jobs', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/api.md', - 'API', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/plugins.md', - 'Plugins', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.md', - 'Environment', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/public-assets.md', - 'Public Assets', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md', - 'Single Sign On (SSO)', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/rbac.md', - 'Role-Based Access Control (RBAC)', - ], - ], - }, - ], - }, - { - title: 'Deployment', - path: '/developer-docs/latest/setup-deployment-guides/deployment', - collapsable: true, - initialOpenGroupIndex: -1, // make sure that no subgroup is open by default — if set to 0, 'Hosting Provider Guides' is expanded - children: [ - { - title: 'Hosting Provider Guides', - path: - '/developer-docs/latest/setup-deployment-guides/deployment.html#hosting-provider-guides', - collapsable: true, - children: [ - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/21yunbox.md', - '21YunBox', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/amazon-aws.md', - 'Amazon AWS', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/azure.md', - 'Azure', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean-app-platform.md', - 'DigitalOcean App Platform', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean.md', - 'DigitalOcean Droplets', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/google-app-engine.md', - 'Google App Engine', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/heroku.md', - 'Heroku', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/qovery.md', - 'Qovery', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/render.md', - 'Render', - ], - ], - sidebarDepth: 2, - }, - { - title: 'Optional Software Guides', - path: - '/developer-docs/latest/setup-deployment-guides/deployment.html#optional-software-guides', - collapsable: true, - children: [ - [ - '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/caddy-proxy.md', - 'Caddy', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/haproxy-proxy.md', - 'HAProxy', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/nginx-proxy.md', - 'Nginx', - ], - ], - sidebarDepth: 2, - }, - ], - sidebarDepth: 0, - }, - ], - }, - { - title: '🔧 Development', - collapsable: false, - initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default - children: [ - { - title: 'Back-end customization', - collapsable: true, - path: '/developer-docs/latest/development/backend-customization', - children: [ - ['/developer-docs/latest/development/backend-customization/routes.md', 'Routes'], - ['/developer-docs/latest/development/backend-customization/policies.md', 'Policies'], - [ - '/developer-docs/latest/development/backend-customization/middlewares.md', - 'Middlewares', - ], - [ - '/developer-docs/latest/development/backend-customization/controllers.md', - 'Controllers', - ], - [ - '/developer-docs/latest/development/backend-customization/requests-responses.md', - 'Requests & Responses', - ], - ['/developer-docs/latest/development/backend-customization/services.md', 'Services'], - ['/developer-docs/latest/development/backend-customization/models.md', 'Models'], - ['/developer-docs/latest/development/backend-customization/webhooks.md', 'Webhooks'], - ], - }, - ['/developer-docs/latest/development/admin-customization', 'Admin panel customization'], - ['/developer-docs/latest/development/plugins-extension.md', 'Plugins extension'], - ['/developer-docs/latest/development/plugins-development.md', 'Plugins development'], - ], - }, - { - title: '💻 Developer Resources', - collapsable: false, - initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default - sidebarDepth: 2, - children: [ - { - title: 'APIs Reference', - collapsable: true, - sidebarDepth: 1, - children: [ - [ - '/developer-docs/latest/developer-resources/database-apis-reference/rest-api.md', - 'REST API', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/graphql-api.md', - 'GraphQL API', - ], - { - title: 'Query Engine API', - path: - '/developer-docs/latest/developer-resources/database-apis-reference/query-engine-api.html', - collapsable: true, - // sidebarDepth: 3, - children: [ - [ - '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/single-operations.md', - 'Single Operations', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/bulk-operations.md', - 'Bulk Operations', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/filtering.md', - 'Filtering', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/populating.md', - 'Populating', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/order-pagination.md', - 'Ordering & pagination', - ], - ], - }, - { - title: 'Entity Service API', - path: - '/developer-docs/latest/developer-resources/database-apis-reference/entity-service-api', - collapsable: true, - children: [ - [ - '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/crud.md', - 'CRUD operations', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/filter.md', - 'Filters', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/populate.md', - 'Populate', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/order-pagination.md', - 'Ordering & pagination', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/components-dynamic-zones.md', - 'Components and dynamic zones', - ], - ], - }, - { - title: 'Plugin APIs Reference', - collapsable: true, - children: [ - [ - '/developer-docs/latest/developer-resources/plugin-api-reference/server.md', - 'Server API for plugins', - ], - [ - '/developer-docs/latest/developer-resources/plugin-api-reference/admin-panel.md', - 'Admin Panel API for plugins', - ], - ], - }, - ], - }, - ['/developer-docs/latest/developer-resources/cli/CLI', 'Command Line Interface'], - ['/developer-docs/latest/developer-resources/error-handling.md', 'Error handling'], - { - title: 'Integrations', - path: '/developer-docs/latest/developer-resources/content-api/integrations.html', - collapsable: true, - sidebarDepth: 1, - children: [ - ['/developer-docs/latest/developer-resources/content-api/integrations/react', 'React'], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/vue-js', - 'Vue.js', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/angular', - 'Angular', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/next-js', - 'Next.js', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/nuxt-js', - 'Nuxt.js', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/graphql', - 'GraphQL', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/gatsby', - 'Gatsby', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/gridsome', - 'Gridsome', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/jekyll', - 'Jekyll', - ], - ['/developer-docs/latest/developer-resources/content-api/integrations/11ty', '11ty'], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/svelte', - 'Svelte', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/sapper', - 'Sapper', - ], - ['/developer-docs/latest/developer-resources/content-api/integrations/ruby', 'Ruby'], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/python', - 'Python', - ], - ['/developer-docs/latest/developer-resources/content-api/integrations/dart', 'Dart'], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/flutter', - 'Flutter', - ], - ['/developer-docs/latest/developer-resources/content-api/integrations/go', 'Go'], - ['/developer-docs/latest/developer-resources/content-api/integrations/php', 'PHP'], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/laravel', - 'Laravel', - ], - ], - }, - ], - }, - { - title: '🧩 Strapi plugins', - path: '/developer-docs/latest/plugins/plugins-intro.html', - collapsable: false, - children: [ - ['/developer-docs/latest/plugins/graphql', 'GraphQL'], - ['/developer-docs/latest/plugins/i18n', 'Internationalization (i18n)'], - ['/developer-docs/latest/plugins/users-permissions', 'Users & Permissions'], - ['/developer-docs/latest/plugins/email', 'Email'], - ['/developer-docs/latest/plugins/upload', 'Upload'], - ['/developer-docs/latest/plugins/documentation', 'API Documentation'], - ], - sidebarDepth: 1, - }, - { - title: '♻️ Update & Migration', - collapsable: false, - children: [ - ['/developer-docs/latest/update-migration-guides/update-version.md', 'Update'], - ['/developer-docs/latest/update-migration-guides/migration-guides.md', 'Migration'], - ], - }, +${sidebar.toString()} + +const checklinksIgnoredFiles = [ + '**/node_modules', // please never remove this one + /** + * Caution: Adding an individual file to this section + * will prevent the _whole_ file from being scanned for broken links. + * + * Currently, there is no easy way to ignore a specific link inside a file. + */ + + /** + * Files below give false positives + */ + '/developer-docs/latest/developer-resources/plugin-api-reference/admin-panel.md', + './developer-docs/latest/development/backend-customization/models.md', + './developer-docs/latest/guides/count-graphql.md', // might be removed once GraphQL customization is ready + './developer-docs/latest/setup-deployment-guides/configurations.md', // the script thinks filename[]() at line 977 is a real link + './developer-docs/latest/development/backend-customization/webhooks.md', // 'missing" links are in commented part of file +]; + +const plugins = [ + ['vuepress-plugin-element-tabs', {}], + [ + 'check-md', + { + ignore: checklinksIgnoredFiles, + }, + ], + [ + 'seo', + { + siteTitle: (_, $site) => $site.title, + title: $page => $page.title, + }, + ], + ['@vuepress/medium-zoom'], + [ + 'vuepress-plugin-code-copy', + { + color: '#ffffff', + successText: 'Copied to clipboard!', + }, + ], + ['@vuepress/back-to-top', {}], + [ + 'vuepress-plugin-container', + { + type: 'callout', + defaultTitle: '', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'strapi', + defaultTitle: '', + before: info => + \`

🤓 \${info}

\`, + after: '
', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'tip', + before: info => \`

💡 \${info}

\`, + after: '
', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'note', + before: info => \`

✏️ \${info}

\`, + after: '
', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'caution', + before: info => + \`

✋ \${info}

\`, + after: '
', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'warning', + before: info => + \`

️❗️ \${info}

\`, + after: '
', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'prerequisites', + defaultTitle: 'PREREQUISITES', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'api-call', + defaultTitle: '', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'request', + defaultTitle: 'Request', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'response', + defaultTitle: 'Response', + }, + ], +]; + +module.exports = { + title: '', + port: 8080, + description: 'The headless CMS developers love.', + base: '/', + plugins: plugins, + head: [ + [ + 'link', { - title: '📚 Guides', - collapsable: true, - children: [ - ['/developer-docs/latest/guides/auth-request', 'Authenticated request'], - // ['/developer-docs/latest/guides/slug', 'Create a slug system'], - // ['/developer-docs/latest/guides/is-owner', 'Create is owner policy'], - // ['/developer-docs/latest/guides/custom-admin', 'Custom admin'], - // ['/developer-docs/latest/guides/custom-data-response', 'Custom data response'], - ['/developer-docs/latest/guides/draft', 'Draft system'], - // ['/developer-docs/latest/guides/error-catching', 'Error catching'], - // ['/developer-docs/latest/guides/external-data', 'Fetching external data'], - ['/developer-docs/latest/guides/jwt-validation', 'JWT validation'], - ['/developer-docs/latest/guides/process-manager', 'Process manager'], - ['/developer-docs/latest/guides/scheduled-publication', 'Scheduled publication'], - // ['/developer-docs/latest/guides/secure-your-app', 'Secure your application'], - // ['/developer-docs/latest/guides/send-email', 'Send email programmatically'], - // [ - // '/developer-docs/latest/guides/registering-a-field-in-admin', - // 'Registering a new field in the admin panel', - // ], - // ['/developer-docs/latest/guides/client', 'Setup a third party client'], - ['/developer-docs/latest/guides/unit-testing', 'Unit testing'], - ], + rel: 'icon', + href: 'https://strapi.io/assets/favicon-32x32.png', }, ], - user: [ - { - collapsable: false, - title: '', - children: [ - ['/user-docs/latest/getting-started/introduction', 'Welcome to the Strapi user guide!'], - ], - }, - { - collapsable: false, - title: 'Content Manager', - children: [ - [ - '/user-docs/latest/content-manager/introduction-to-content-manager', - 'Introduction to the Content Manager', - ], - [ - '/user-docs/latest/content-manager/configuring-view-of-content-type', - 'Configuring the views of a content type', - ], - ['/user-docs/latest/content-manager/writing-content', 'Writing content'], - [ - '/user-docs/latest/content-manager/managing-relational-fields', - 'Managing relational fields', - ], - ['/user-docs/latest/content-manager/translating-content', 'Translating content'], - [ - '/user-docs/latest/content-manager/saving-and-publishing-content', - 'Saving, publishing and deleting content', - ], - ], - }, - { - collapsable: false, - title: 'Content-Type Builder', - children: [ - [ - '/user-docs/latest/content-types-builder/introduction-to-content-types-builder', - 'Introduction to the Content-Type Builder', - ], - [ - '/user-docs/latest/content-types-builder/creating-new-content-type', - 'Creating content types', - ], - [ - '/user-docs/latest/content-types-builder/managing-content-types', - 'Managing content types', - ], - [ - '/user-docs/latest/content-types-builder/configuring-fields-content-type', - 'Configuring fields for content types', - ], - ], - }, - { - collapsable: false, - title: 'Users, Roles & Permissions', - children: [ - [ - '/user-docs/latest/users-roles-permissions/introduction-to-users-roles-permissions', - 'Introduction to users, roles & permissions', - ], - [ - '/user-docs/latest/users-roles-permissions/configuring-administrator-roles', - 'Configuring administrator roles', - ], - [ - '/user-docs/latest/users-roles-permissions/managing-administrators', - 'Managing administrator accounts', - ], - [ - '/user-docs/latest/users-roles-permissions/configuring-end-users-roles', - 'Configuring end-users roles', - ], - [ - '/user-docs/latest/users-roles-permissions/managing-end-users', - 'Managing end-users accounts', - ], - ], - }, - { - collapsable: false, - title: 'Plugins', - children: [ - ['/user-docs/latest/plugins/introduction-to-plugins', 'Introduction to plugins'], - [ - '/user-docs/latest/plugins/installing-plugins-via-marketplace', - 'Installing plugins via the Marketplace', - ], - ['/user-docs/latest/plugins/strapi-plugins', 'List of Strapi plugins'], - ], - }, + [ + 'meta', { - collapsable: false, - title: 'General settings', - children: [ - ['/user-docs/latest/settings/managing-global-settings', 'Managing global settings'], - [ - '/user-docs/latest/settings/configuring-users-permissions-plugin-settings', - 'Configuring Users & Permissions plugin settings', - ], - ], + property: 'og:title', + content: 'Strapi Documentation', }, ], - }; - - const checklinksIgnoredFiles = [ - '**/node_modules', // please never remove this one - /** - * Caution: Adding an individual file to this section - * will prevent the _whole_ file from being scanned for broken links. - * - * Currently, there is no easy way to ignore a specific link inside a file. - */ - - /** - * Files below give false positives - */ - '/developer-docs/latest/developer-resources/plugin-api-reference/admin-panel.md', - './developer-docs/latest/development/backend-customization/models.md', - './developer-docs/latest/guides/count-graphql.md', // might be removed once GraphQL customization is ready - './developer-docs/latest/setup-deployment-guides/configurations.md', // the script thinks filename[]() at line 977 is a real link - './developer-docs/latest/development/backend-customization/webhooks.md', // 'missing" links are in commented part of file - ]; - - const plugins = [ - ['vuepress-plugin-element-tabs', {}], [ - 'check-md', + 'meta', { - ignore: checklinksIgnoredFiles, + property: 'og:type', + content: 'article', }, ], [ - 'seo', + 'meta', { - siteTitle: (_, $site) => $site.title, - title: $page => $page.title, + property: 'og:url', + content: 'https://strapi.io/documentation/', }, ], - ['@vuepress/medium-zoom'], [ - 'vuepress-plugin-code-copy', + 'meta', { - color: '#ffffff', - successText: 'Copied to clipboard!', + property: 'og:description', + content: 'The headless CMS developers love.', }, ], - ['@vuepress/back-to-top', {}], [ - 'vuepress-plugin-container', + 'meta', { - type: 'callout', - defaultTitle: '', + property: 'og:image', + content: 'https://strapi.io/documentation/assets/meta.png', }, ], [ - 'vuepress-plugin-container', + 'meta', { - type: 'strapi', - defaultTitle: '', - before: info => - \`

🤓 \${info}

\`, - after: '
', + property: 'og:article:author', + content: 'strapi', }, ], + [ - 'vuepress-plugin-container', + 'meta', { - type: 'tip', - before: info => \`

💡 \${info}

\`, - after: '
', + property: 'twitter:card', + content: 'summary_large_image', }, ], [ - 'vuepress-plugin-container', + 'meta', { - type: 'note', - before: info => \`

✏️ \${info}

\`, - after: '
', + property: 'twitter:url', + content: 'https://strapi.io/documentation/', }, ], [ - 'vuepress-plugin-container', + 'meta', { - type: 'caution', - before: info => - \`

✋ \${info}

\`, - after: '
', + property: 'twitter:site', + content: '@strapijs', }, ], [ - 'vuepress-plugin-container', + 'meta', { - type: 'warning', - before: info => - \`

️❗️ \${info}

\`, - after: '
', + property: 'twitter:title', + content: 'Strapi Documentation', }, ], [ - 'vuepress-plugin-container', + 'meta', { - type: 'prerequisites', - defaultTitle: 'PREREQUISITES', + property: 'twitter:description', + content: 'The headless CMS developers love.', }, ], [ - 'vuepress-plugin-container', + 'meta', { - type: 'api-call', - defaultTitle: '', + property: 'twitter:image', + content: 'http://strapi.io/assets/images/strapi-website-preview.png', }, ], [ - 'vuepress-plugin-container', + 'script', + {}, + \`(function(w, d, s, l, i) { + w[l] = w[l] || []; + w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' }); + var f = d.getElementsByTagName(s)[0], + j = d.createElement(s), + dl = l != 'dataLayer' ? '&l=' + l : ''; + j.async = true; + j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; + f.parentNode.insertBefore(j, f); +})(window, document, 'script', 'dataLayer', 'GTM-KN9JRWG'); +\`, + ], + ], + themeConfig: { + logo: '/assets/logo.png', + nav: [ { - type: 'request', - defaultTitle: 'Request', + text: 'Resource Center', + link: 'https://strapi.io/resource-center', }, - ], - [ - 'vuepress-plugin-container', { - type: 'response', - defaultTitle: 'Response', + text: 'v4 Documentation', + items: [ + { + text: 'Developer Docs', + items: [ + { + text: 'Getting Started', + link: '/developer-docs/latest/getting-started/introduction.html', + }, + { + text: 'Setup & Deployment', + link: '/developer-docs/latest/setup-deployment-guides/installation.html', + }, + { + text: 'Plugins', + link: '/developer-docs/latest/plugins/plugins-intro.html', + }, + { + text: 'Development', + link: '/developer-docs/latest/development/backend-customization.html', + }, + { + text: 'Update & Migration', + link: '/developer-docs/latest/update-migration-guides/update-version.html', + }, + { + text: 'Developer Resources', + link: '/developer-docs/latest/developer-resources/content-api/content-api.html', + }, + ], + }, + { + text: 'User Guide', + items: [ + { + text: 'Getting Started', + link: '/user-docs/latest/getting-started/introduction.html', + }, + { + text: 'Content Manager', + link: '/user-docs/latest/content-manager/introduction-to-content-manager.html', + }, + { + text: 'Content-Type Builder', + link: + '/user-docs/latest/content-types-builder/introduction-to-content-types-builder.html', + }, + { + text: 'Users, Roles, and Permissions', + link: + '/user-docs/latest/users-roles-permissions/introduction-to-users-roles-permissions.html', + }, + { + text: 'Plugins', + link: '/user-docs/latest/plugins/introduction-to-plugins.html', + }, + { + text: 'General Settings', + link: '/user-docs/latest/settings/managing-global-settings.html', + }, + ], + }, + ], }, - ], - ]; - - module.exports = { - title: '', - port: 8080, - description: 'The headless CMS developers love.', - base: '/', - plugins: plugins, - head: [ - [ - 'link', - { - rel: 'icon', - href: 'https://strapi.io/assets/favicon-32x32.png', - }, - ], - [ - 'meta', - { - property: 'og:title', - content: 'Strapi Documentation', - }, - ], - [ - 'meta', - { - property: 'og:type', - content: 'article', - }, - ], - [ - 'meta', - { - property: 'og:url', - content: 'https://strapi.io/documentation/', - }, - ], - [ - 'meta', - { - property: 'og:description', - content: 'The headless CMS developers love.', - }, - ], - [ - 'meta', - { - property: 'og:image', - content: 'https://strapi.io/documentation/assets/meta.png', - }, - ], - [ - 'meta', - { - property: 'og:article:author', - content: 'strapi', - }, - ], - - [ - 'meta', - { - property: 'twitter:card', - content: 'summary_large_image', - }, - ], - [ - 'meta', - { - property: 'twitter:url', - content: 'https://strapi.io/documentation/', - }, - ], - [ - 'meta', - { - property: 'twitter:site', - content: '@strapijs', - }, - ], - [ - 'meta', - { - property: 'twitter:title', - content: 'Strapi Documentation', - }, - ], - [ - 'meta', - { - property: 'twitter:description', - content: 'The headless CMS developers love.', - }, - ], - [ - 'meta', - { - property: 'twitter:image', - content: 'http://strapi.io/assets/images/strapi-website-preview.png', - }, - ], - [ - 'script', - {}, - \`(function(w, d, s, l, i) { - w[l] = w[l] || []; - w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' }); - var f = d.getElementsByTagName(s)[0], - j = d.createElement(s), - dl = l != 'dataLayer' ? '&l=' + l : ''; - j.async = true; - j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; - f.parentNode.insertBefore(j, f); - })(window, document, 'script', 'dataLayer', 'GTM-KN9JRWG'); - \`, - ], - ], - themeConfig: { - logo: '/assets/logo.png', - nav: [ - { - text: 'Resource Center', - link: 'https://strapi.io/resource-center', - }, - { - text: 'v4 Documentation', - items: [ - { - text: 'Developer Docs', - items: [ - { - text: 'Getting Started', - link: '/developer-docs/latest/getting-started/introduction.html', - }, - { - text: 'Setup & Deployment', - link: '/developer-docs/latest/setup-deployment-guides/installation.html', - }, - { - text: 'Plugins', - link: '/developer-docs/latest/plugins/plugins-intro.html', - }, - { - text: 'Development', - link: '/developer-docs/latest/development/backend-customization.html', - }, - { - text: 'Update & Migration', - link: '/developer-docs/latest/update-migration-guides/update-version.html', - }, - { - text: 'Developer Resources', - link: '/developer-docs/latest/developer-resources/content-api/content-api.html', - }, - ], - }, - { - text: 'User Guide', - items: [ - { - text: 'Getting Started', - link: '/user-docs/latest/getting-started/introduction.html', - }, - { - text: 'Content Manager', - link: '/user-docs/latest/content-manager/introduction-to-content-manager.html', - }, - { - text: 'Content-Type Builder', - link: - '/user-docs/latest/content-types-builder/introduction-to-content-types-builder.html', - }, - { - text: 'Users, Roles, and Permissions', - link: - '/user-docs/latest/users-roles-permissions/introduction-to-users-roles-permissions.html', - }, - { - text: 'Plugins', - link: '/user-docs/latest/plugins/introduction-to-plugins.html', - }, - { - text: 'General Settings', - link: '/user-docs/latest/settings/managing-global-settings.html', - }, - ], - }, - ], - }, - { - text: 'v3 documentation', - link: 'https://docs-v3.strapi.io' - }, - { - text: 'Ecosystem', - items: [ - { - text: 'Strapi', - items: [ - { - text: 'Website', - link: 'https://strapi.io', - }, - { - text: 'Blog', - link: 'https://strapi.io/blog', - }, - { - text: 'StrapiConf 2021', - link: 'https://www.strapi.io/strapi-conf-2021', - }, - ], - }, - { - text: 'Community', - items: [ - { - text: 'Forum', - link: 'https://forum.strapi.io', - }, - { - text: 'Discord', - link: 'https://discord.strapi.io', - }, - { - text: 'Awesome-Strapi', - link: 'https://github.com/strapi/awesome-strapi', - }, - ], - }, - { - text: 'Resources', - items: [ - { - text: 'Tutorials', - link: 'https://strapi.io/tutorials', - }, - { - text: 'Academy', - link: 'https://academy.strapi.io/', - }, - ], - }, - ], - }, - { - text: "We're hiring!", - link: 'https://strapi.io/careers#open-positions', - }, - ], - repo: 'strapi/documentation', - docsDir: 'docs', - docsBranch: 'main', - algolia: { - appId: '9FTY6J9E4X', - apiKey: 'cf49c82a1865df2618a3d89e18657051', - indexName: 'documentation', + { + text: 'v3 documentation', + link: 'https://docs-v3.strapi.io' + }, + { + text: 'Ecosystem', + items: [ + { + text: 'Strapi', + items: [ + { + text: 'Website', + link: 'https://strapi.io', + }, + { + text: 'Blog', + link: 'https://strapi.io/blog', + }, + { + text: 'StrapiConf 2021', + link: 'https://www.strapi.io/strapi-conf-2021', + }, + ], + }, + { + text: 'Community', + items: [ + { + text: 'Forum', + link: 'https://forum.strapi.io', + }, + { + text: 'Discord', + link: 'https://discord.strapi.io', + }, + { + text: 'Awesome-Strapi', + link: 'https://github.com/strapi/awesome-strapi', + }, + ], + }, + { + text: 'Resources', + items: [ + { + text: 'Tutorials', + link: 'https://strapi.io/tutorials', + }, + { + text: 'Academy', + link: 'https://academy.strapi.io/', + }, + ], + }, + ], }, - editLinks: true, - editLinkText: 'Improve this page', - serviceWorker: true, - sidebarDepth: 1, - smoothScroll: false, - sidebar: { - '/developer-docs/latest/': sidebar.developer, - '/user-docs/latest/': sidebar.user, + { + text: "We're hiring!", + link: 'https://strapi.io/careers#open-positions', }, + ], + repo: 'strapi/documentation', + docsDir: 'docs', + docsBranch: 'main', + algolia: { + appId: '9FTY6J9E4X', + apiKey: 'cf49c82a1865df2618a3d89e18657051', + indexName: 'documentation', }, - markdown: { - extendMarkdown: md => { - // use more markdown-it plugins! - md.use(require('markdown-it-include')); - }, + editLinks: true, + editLinkText: 'Improve this page', + serviceWorker: true, + sidebarDepth: 1, + smoothScroll: false, + sidebar: { + '/developer-docs/latest/': sidebar.developer, + '/user-docs/latest/': sidebar.user, }, - }; + }, + markdown: { + extendMarkdown: md => { + // use more markdown-it plugins! + md.use(require('markdown-it-include')); + }, + }, +}; `; const destination = path.resolve(__dirname, '..', '.vuepress', 'config.js'); From 09fa00be910a27b432b1c2bf2966fbaec740f718 Mon Sep 17 00:00:00 2001 From: soupette Date: Wed, 8 Dec 2021 10:57:59 +0100 Subject: [PATCH 3/9] Split sidebar Signed-off-by: soupette --- docs/scripts/create-config-file.js | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/docs/scripts/create-config-file.js b/docs/scripts/create-config-file.js index cf3e0c2eea..53342cd016 100644 --- a/docs/scripts/create-config-file.js +++ b/docs/scripts/create-config-file.js @@ -5,29 +5,14 @@ const fs = require('fs-extra'); // const sidebar = require('../.vuepress/sidebar'); const createConfigFile = async () => { - const sidebar = await fs.readFile(path.resolve(__dirname, '..', '.vuepress', 'sidebar.js')); + const dest = path.resolve(__dirname, '..', '.vuepress'); + const sidebar = await fs.readFile(path.resolve(dest, 'sidebar.js')); + const linkChecker = await fs.readFile(path.resolve(dest, 'link-checker.js')); const content = ` ${sidebar.toString()} - -const checklinksIgnoredFiles = [ - '**/node_modules', // please never remove this one - /** - * Caution: Adding an individual file to this section - * will prevent the _whole_ file from being scanned for broken links. - * - * Currently, there is no easy way to ignore a specific link inside a file. - */ - /** - * Files below give false positives - */ - '/developer-docs/latest/developer-resources/plugin-api-reference/admin-panel.md', - './developer-docs/latest/development/backend-customization/models.md', - './developer-docs/latest/guides/count-graphql.md', // might be removed once GraphQL customization is ready - './developer-docs/latest/setup-deployment-guides/configurations.md', // the script thinks filename[]() at line 977 is a real link - './developer-docs/latest/development/backend-customization/webhooks.md', // 'missing" links are in commented part of file -]; +${linkChecker.toString()} const plugins = [ ['vuepress-plugin-element-tabs', {}], From 5ef08090091202ce1d0938dea2e885474a720bc6 Mon Sep 17 00:00:00 2001 From: soupette Date: Wed, 8 Dec 2021 11:12:29 +0100 Subject: [PATCH 4/9] Split config and write config file before launching the dev server Signed-off-by: soupette --- docs/.vuepress/config-backup.js | 2 +- docs/.vuepress/config.js | 338 +++++++++++++------------ docs/.vuepress/link-checker.js | 18 ++ docs/.vuepress/markdown-config.js | 6 + docs/.vuepress/metas.js | 105 ++++++++ docs/.vuepress/plugins.js | 104 ++++++++ docs/.vuepress/theme-config.js | 151 +++++++++++ docs/scripts/create-config-file.js | 392 ++--------------------------- 8 files changed, 572 insertions(+), 544 deletions(-) create mode 100644 docs/.vuepress/link-checker.js create mode 100644 docs/.vuepress/markdown-config.js create mode 100644 docs/.vuepress/metas.js create mode 100644 docs/.vuepress/plugins.js create mode 100644 docs/.vuepress/theme-config.js diff --git a/docs/.vuepress/config-backup.js b/docs/.vuepress/config-backup.js index 661fbb9d2e..a60780b1fe 100644 --- a/docs/.vuepress/config-backup.js +++ b/docs/.vuepress/config-backup.js @@ -666,7 +666,6 @@ module.exports = { port: 8080, description: 'The headless CMS developers love.', base: '/', - plugins: plugins, head: [ [ 'link', @@ -923,4 +922,5 @@ module.exports = { md.use(require('markdown-it-include')); }, }, + plugins: plugins, }; diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 5b0645282b..bb04f2e439 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -538,7 +538,7 @@ const sidebar = { ], }; - + const checklinksIgnoredFiles = [ '**/node_modules', // please never remove this one /** @@ -558,6 +558,7 @@ const checklinksIgnoredFiles = [ './developer-docs/latest/development/backend-customization/webhooks.md', // 'missing" links are in commented part of file ]; + const plugins = [ ['vuepress-plugin-element-tabs', {}], [ @@ -663,12 +664,12 @@ const plugins = [ ], ]; -module.exports = { + +const metas = { title: '', port: 8080, description: 'The headless CMS developers love.', base: '/', - plugins: plugins, head: [ [ 'link', @@ -765,175 +766,178 @@ module.exports = { [ 'script', {}, - `(function(w, d, s, l, i) { - w[l] = w[l] || []; - w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' }); - var f = d.getElementsByTagName(s)[0], - j = d.createElement(s), - dl = l != 'dataLayer' ? '&l=' + l : ''; - j.async = true; - j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; - f.parentNode.insertBefore(j, f); -})(window, document, 'script', 'dataLayer', 'GTM-KN9JRWG'); -`, + `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-KN9JRWG');`, ], ], - themeConfig: { - logo: '/assets/logo.png', - nav: [ - { - text: 'Resource Center', - link: 'https://strapi.io/resource-center', - }, - { - text: 'v4 Documentation', - items: [ - { - text: 'Developer Docs', - items: [ - { - text: 'Getting Started', - link: '/developer-docs/latest/getting-started/introduction.html', - }, - { - text: 'Setup & Deployment', - link: '/developer-docs/latest/setup-deployment-guides/installation.html', - }, - { - text: 'Plugins', - link: '/developer-docs/latest/plugins/plugins-intro.html', - }, - { - text: 'Development', - link: '/developer-docs/latest/development/backend-customization.html', - }, - { - text: 'Update & Migration', - link: '/developer-docs/latest/update-migration-guides/update-version.html', - }, - { - text: 'Developer Resources', - link: '/developer-docs/latest/developer-resources/content-api/content-api.html', - }, - ], - }, - { - text: 'User Guide', - items: [ - { - text: 'Getting Started', - link: '/user-docs/latest/getting-started/introduction.html', - }, - { - text: 'Content Manager', - link: '/user-docs/latest/content-manager/introduction-to-content-manager.html', - }, - { - text: 'Content-Type Builder', - link: - '/user-docs/latest/content-types-builder/introduction-to-content-types-builder.html', - }, - { - text: 'Users, Roles, and Permissions', - link: - '/user-docs/latest/users-roles-permissions/introduction-to-users-roles-permissions.html', - }, - { - text: 'Plugins', - link: '/user-docs/latest/plugins/introduction-to-plugins.html', - }, - { - text: 'General Settings', - link: '/user-docs/latest/settings/managing-global-settings.html', - }, - ], - }, - ], - }, - { - text: 'v3 documentation', - link: 'https://docs-v3.strapi.io' - }, - { - text: 'Ecosystem', - items: [ - { - text: 'Strapi', - items: [ - { - text: 'Website', - link: 'https://strapi.io', - }, - { - text: 'Blog', - link: 'https://strapi.io/blog', - }, - { - text: 'StrapiConf 2021', - link: 'https://www.strapi.io/strapi-conf-2021', - }, - ], - }, - { - text: 'Community', - items: [ - { - text: 'Forum', - link: 'https://forum.strapi.io', - }, - { - text: 'Discord', - link: 'https://discord.strapi.io', - }, - { - text: 'Awesome-Strapi', - link: 'https://github.com/strapi/awesome-strapi', - }, - ], - }, - { - text: 'Resources', - items: [ - { - text: 'Tutorials', - link: 'https://strapi.io/tutorials', - }, - { - text: 'Academy', - link: 'https://academy.strapi.io/', - }, - ], - }, - ], - }, - { - text: "We're hiring!", - link: 'https://strapi.io/careers#open-positions', - }, - ], - repo: 'strapi/documentation', - docsDir: 'docs', - docsBranch: 'main', - algolia: { - appId: '9FTY6J9E4X', - apiKey: 'cf49c82a1865df2618a3d89e18657051', - indexName: 'documentation', +}; +; + +const themeConfig = { + logo: '/assets/logo.png', + nav: [ + { + text: 'Resource Center', + link: 'https://strapi.io/resource-center', + }, + { + text: 'v4 Documentation', + items: [ + { + text: 'Developer Docs', + items: [ + { + text: 'Getting Started', + link: '/developer-docs/latest/getting-started/introduction.html', + }, + { + text: 'Setup & Deployment', + link: '/developer-docs/latest/setup-deployment-guides/installation.html', + }, + { + text: 'Plugins', + link: '/developer-docs/latest/plugins/plugins-intro.html', + }, + { + text: 'Development', + link: '/developer-docs/latest/development/backend-customization.html', + }, + { + text: 'Update & Migration', + link: '/developer-docs/latest/update-migration-guides/update-version.html', + }, + { + text: 'Developer Resources', + link: '/developer-docs/latest/developer-resources/content-api/content-api.html', + }, + ], + }, + { + text: 'User Guide', + items: [ + { + text: 'Getting Started', + link: '/user-docs/latest/getting-started/introduction.html', + }, + { + text: 'Content Manager', + link: '/user-docs/latest/content-manager/introduction-to-content-manager.html', + }, + { + text: 'Content-Type Builder', + link: + '/user-docs/latest/content-types-builder/introduction-to-content-types-builder.html', + }, + { + text: 'Users, Roles, and Permissions', + link: + '/user-docs/latest/users-roles-permissions/introduction-to-users-roles-permissions.html', + }, + { + text: 'Plugins', + link: '/user-docs/latest/plugins/introduction-to-plugins.html', + }, + { + text: 'General Settings', + link: '/user-docs/latest/settings/managing-global-settings.html', + }, + ], + }, + ], }, - editLinks: true, - editLinkText: 'Improve this page', - serviceWorker: true, - sidebarDepth: 1, - smoothScroll: false, - sidebar: { - '/developer-docs/latest/': sidebar.developer, - '/user-docs/latest/': sidebar.user, + { + text: 'v3 documentation', + link: 'https://docs-v3.strapi.io', }, - }, - markdown: { - extendMarkdown: md => { - // use more markdown-it plugins! - md.use(require('markdown-it-include')); + { + text: 'Ecosystem', + items: [ + { + text: 'Strapi', + items: [ + { + text: 'Website', + link: 'https://strapi.io', + }, + { + text: 'Blog', + link: 'https://strapi.io/blog', + }, + { + text: 'StrapiConf 2021', + link: 'https://www.strapi.io/strapi-conf-2021', + }, + ], + }, + { + text: 'Community', + items: [ + { + text: 'Forum', + link: 'https://forum.strapi.io', + }, + { + text: 'Discord', + link: 'https://discord.strapi.io', + }, + { + text: 'Awesome-Strapi', + link: 'https://github.com/strapi/awesome-strapi', + }, + ], + }, + { + text: 'Resources', + items: [ + { + text: 'Tutorials', + link: 'https://strapi.io/tutorials', + }, + { + text: 'Academy', + link: 'https://academy.strapi.io/', + }, + ], + }, + ], }, + { + text: "We're hiring!", + link: 'https://strapi.io/careers#open-positions', + }, + ], + repo: 'strapi/documentation', + docsDir: 'docs', + docsBranch: 'main', + algolia: { + appId: '9FTY6J9E4X', + apiKey: 'cf49c82a1865df2618a3d89e18657051', + indexName: 'documentation', + }, + editLinks: true, + editLinkText: 'Improve this page', + serviceWorker: true, + sidebarDepth: 1, + smoothScroll: false, + sidebar: { + '/developer-docs/latest/': sidebar.developer, + '/user-docs/latest/': sidebar.user, + }, +}; + + +const markdown = { + extendMarkdown: md => { + // use more markdown-it plugins! + md.use(require('markdown-it-include')); }, }; + + + +module.exports = { + ...metas, + themeConfig, + markdown, + plugins, +}; \ No newline at end of file diff --git a/docs/.vuepress/link-checker.js b/docs/.vuepress/link-checker.js new file mode 100644 index 0000000000..d22b43021f --- /dev/null +++ b/docs/.vuepress/link-checker.js @@ -0,0 +1,18 @@ +const checklinksIgnoredFiles = [ + '**/node_modules', // please never remove this one + /** + * Caution: Adding an individual file to this section + * will prevent the _whole_ file from being scanned for broken links. + * + * Currently, there is no easy way to ignore a specific link inside a file. + */ + + /** + * Files below give false positives + */ + '/developer-docs/latest/developer-resources/plugin-api-reference/admin-panel.md', + './developer-docs/latest/development/backend-customization/models.md', + './developer-docs/latest/guides/count-graphql.md', // might be removed once GraphQL customization is ready + './developer-docs/latest/setup-deployment-guides/configurations.md', // the script thinks filename[]() at line 977 is a real link + './developer-docs/latest/development/backend-customization/webhooks.md', // 'missing" links are in commented part of file +]; diff --git a/docs/.vuepress/markdown-config.js b/docs/.vuepress/markdown-config.js new file mode 100644 index 0000000000..92e66410a7 --- /dev/null +++ b/docs/.vuepress/markdown-config.js @@ -0,0 +1,6 @@ +const markdown = { + extendMarkdown: md => { + // use more markdown-it plugins! + md.use(require('markdown-it-include')); + }, +}; diff --git a/docs/.vuepress/metas.js b/docs/.vuepress/metas.js new file mode 100644 index 0000000000..45f68a0415 --- /dev/null +++ b/docs/.vuepress/metas.js @@ -0,0 +1,105 @@ +const metas = { + title: '', + port: 8080, + description: 'The headless CMS developers love.', + base: '/', + head: [ + [ + 'link', + { + rel: 'icon', + href: 'https://strapi.io/assets/favicon-32x32.png', + }, + ], + [ + 'meta', + { + property: 'og:title', + content: 'Strapi Documentation', + }, + ], + [ + 'meta', + { + property: 'og:type', + content: 'article', + }, + ], + [ + 'meta', + { + property: 'og:url', + content: 'https://strapi.io/documentation/', + }, + ], + [ + 'meta', + { + property: 'og:description', + content: 'The headless CMS developers love.', + }, + ], + [ + 'meta', + { + property: 'og:image', + content: 'https://strapi.io/documentation/assets/meta.png', + }, + ], + [ + 'meta', + { + property: 'og:article:author', + content: 'strapi', + }, + ], + + [ + 'meta', + { + property: 'twitter:card', + content: 'summary_large_image', + }, + ], + [ + 'meta', + { + property: 'twitter:url', + content: 'https://strapi.io/documentation/', + }, + ], + [ + 'meta', + { + property: 'twitter:site', + content: '@strapijs', + }, + ], + [ + 'meta', + { + property: 'twitter:title', + content: 'Strapi Documentation', + }, + ], + [ + 'meta', + { + property: 'twitter:description', + content: 'The headless CMS developers love.', + }, + ], + [ + 'meta', + { + property: 'twitter:image', + content: 'http://strapi.io/assets/images/strapi-website-preview.png', + }, + ], + [ + 'script', + {}, + `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-KN9JRWG');`, + ], + ], +}; diff --git a/docs/.vuepress/plugins.js b/docs/.vuepress/plugins.js new file mode 100644 index 0000000000..d10ac02b28 --- /dev/null +++ b/docs/.vuepress/plugins.js @@ -0,0 +1,104 @@ +const plugins = [ + ['vuepress-plugin-element-tabs', {}], + [ + 'check-md', + { + ignore: checklinksIgnoredFiles, + }, + ], + [ + 'seo', + { + siteTitle: (_, $site) => $site.title, + title: $page => $page.title, + }, + ], + ['@vuepress/medium-zoom'], + [ + 'vuepress-plugin-code-copy', + { + color: '#ffffff', + successText: 'Copied to clipboard!', + }, + ], + ['@vuepress/back-to-top', {}], + [ + 'vuepress-plugin-container', + { + type: 'callout', + defaultTitle: '', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'strapi', + defaultTitle: '', + before: info => + `

🤓 ${info}

`, + after: '
', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'tip', + before: info => `

💡 ${info}

`, + after: '
', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'note', + before: info => `

✏️ ${info}

`, + after: '
', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'caution', + before: info => + `

✋ ${info}

`, + after: '
', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'warning', + before: info => + `

️❗️ ${info}

`, + after: '
', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'prerequisites', + defaultTitle: 'PREREQUISITES', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'api-call', + defaultTitle: '', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'request', + defaultTitle: 'Request', + }, + ], + [ + 'vuepress-plugin-container', + { + type: 'response', + defaultTitle: 'Response', + }, + ], +]; diff --git a/docs/.vuepress/theme-config.js b/docs/.vuepress/theme-config.js new file mode 100644 index 0000000000..664db2ef6d --- /dev/null +++ b/docs/.vuepress/theme-config.js @@ -0,0 +1,151 @@ +const themeConfig = { + logo: '/assets/logo.png', + nav: [ + { + text: 'Resource Center', + link: 'https://strapi.io/resource-center', + }, + { + text: 'v4 Documentation', + items: [ + { + text: 'Developer Docs', + items: [ + { + text: 'Getting Started', + link: '/developer-docs/latest/getting-started/introduction.html', + }, + { + text: 'Setup & Deployment', + link: '/developer-docs/latest/setup-deployment-guides/installation.html', + }, + { + text: 'Plugins', + link: '/developer-docs/latest/plugins/plugins-intro.html', + }, + { + text: 'Development', + link: '/developer-docs/latest/development/backend-customization.html', + }, + { + text: 'Update & Migration', + link: '/developer-docs/latest/update-migration-guides/update-version.html', + }, + { + text: 'Developer Resources', + link: '/developer-docs/latest/developer-resources/content-api/content-api.html', + }, + ], + }, + { + text: 'User Guide', + items: [ + { + text: 'Getting Started', + link: '/user-docs/latest/getting-started/introduction.html', + }, + { + text: 'Content Manager', + link: '/user-docs/latest/content-manager/introduction-to-content-manager.html', + }, + { + text: 'Content-Type Builder', + link: + '/user-docs/latest/content-types-builder/introduction-to-content-types-builder.html', + }, + { + text: 'Users, Roles, and Permissions', + link: + '/user-docs/latest/users-roles-permissions/introduction-to-users-roles-permissions.html', + }, + { + text: 'Plugins', + link: '/user-docs/latest/plugins/introduction-to-plugins.html', + }, + { + text: 'General Settings', + link: '/user-docs/latest/settings/managing-global-settings.html', + }, + ], + }, + ], + }, + { + text: 'v3 documentation', + link: 'https://docs-v3.strapi.io', + }, + { + text: 'Ecosystem', + items: [ + { + text: 'Strapi', + items: [ + { + text: 'Website', + link: 'https://strapi.io', + }, + { + text: 'Blog', + link: 'https://strapi.io/blog', + }, + { + text: 'StrapiConf 2021', + link: 'https://www.strapi.io/strapi-conf-2021', + }, + ], + }, + { + text: 'Community', + items: [ + { + text: 'Forum', + link: 'https://forum.strapi.io', + }, + { + text: 'Discord', + link: 'https://discord.strapi.io', + }, + { + text: 'Awesome-Strapi', + link: 'https://github.com/strapi/awesome-strapi', + }, + ], + }, + { + text: 'Resources', + items: [ + { + text: 'Tutorials', + link: 'https://strapi.io/tutorials', + }, + { + text: 'Academy', + link: 'https://academy.strapi.io/', + }, + ], + }, + ], + }, + { + text: "We're hiring!", + link: 'https://strapi.io/careers#open-positions', + }, + ], + repo: 'strapi/documentation', + docsDir: 'docs', + docsBranch: 'main', + algolia: { + appId: '9FTY6J9E4X', + apiKey: 'cf49c82a1865df2618a3d89e18657051', + indexName: 'documentation', + }, + editLinks: true, + editLinkText: 'Improve this page', + serviceWorker: true, + sidebarDepth: 1, + smoothScroll: false, + sidebar: { + '/developer-docs/latest/': sidebar.developer, + '/user-docs/latest/': sidebar.user, + }, +}; diff --git a/docs/scripts/create-config-file.js b/docs/scripts/create-config-file.js index 53342cd016..b4adcc0a41 100644 --- a/docs/scripts/create-config-file.js +++ b/docs/scripts/create-config-file.js @@ -2,395 +2,35 @@ const path = require('path'); const fs = require('fs-extra'); -// const sidebar = require('../.vuepress/sidebar'); const createConfigFile = async () => { const dest = path.resolve(__dirname, '..', '.vuepress'); const sidebar = await fs.readFile(path.resolve(dest, 'sidebar.js')); const linkChecker = await fs.readFile(path.resolve(dest, 'link-checker.js')); + const plugins = await fs.readFile(path.resolve(dest, 'plugins.js')); + const metas = await fs.readFile(path.resolve(dest, 'metas.js')); + const themeConfig = await fs.readFile(path.resolve(dest, 'theme-config.js')); + const markdown = await fs.readFile(path.resolve(dest, 'markdown-config.js')); const content = ` ${sidebar.toString()} ${linkChecker.toString()} -const plugins = [ - ['vuepress-plugin-element-tabs', {}], - [ - 'check-md', - { - ignore: checklinksIgnoredFiles, - }, - ], - [ - 'seo', - { - siteTitle: (_, $site) => $site.title, - title: $page => $page.title, - }, - ], - ['@vuepress/medium-zoom'], - [ - 'vuepress-plugin-code-copy', - { - color: '#ffffff', - successText: 'Copied to clipboard!', - }, - ], - ['@vuepress/back-to-top', {}], - [ - 'vuepress-plugin-container', - { - type: 'callout', - defaultTitle: '', - }, - ], - [ - 'vuepress-plugin-container', - { - type: 'strapi', - defaultTitle: '', - before: info => - \`

🤓 \${info}

\`, - after: '
', - }, - ], - [ - 'vuepress-plugin-container', - { - type: 'tip', - before: info => \`

💡 \${info}

\`, - after: '
', - }, - ], - [ - 'vuepress-plugin-container', - { - type: 'note', - before: info => \`

✏️ \${info}

\`, - after: '
', - }, - ], - [ - 'vuepress-plugin-container', - { - type: 'caution', - before: info => - \`

✋ \${info}

\`, - after: '
', - }, - ], - [ - 'vuepress-plugin-container', - { - type: 'warning', - before: info => - \`

️❗️ \${info}

\`, - after: '
', - }, - ], - [ - 'vuepress-plugin-container', - { - type: 'prerequisites', - defaultTitle: 'PREREQUISITES', - }, - ], - [ - 'vuepress-plugin-container', - { - type: 'api-call', - defaultTitle: '', - }, - ], - [ - 'vuepress-plugin-container', - { - type: 'request', - defaultTitle: 'Request', - }, - ], - [ - 'vuepress-plugin-container', - { - type: 'response', - defaultTitle: 'Response', - }, - ], -]; +${plugins.toString()} -module.exports = { - title: '', - port: 8080, - description: 'The headless CMS developers love.', - base: '/', - plugins: plugins, - head: [ - [ - 'link', - { - rel: 'icon', - href: 'https://strapi.io/assets/favicon-32x32.png', - }, - ], - [ - 'meta', - { - property: 'og:title', - content: 'Strapi Documentation', - }, - ], - [ - 'meta', - { - property: 'og:type', - content: 'article', - }, - ], - [ - 'meta', - { - property: 'og:url', - content: 'https://strapi.io/documentation/', - }, - ], - [ - 'meta', - { - property: 'og:description', - content: 'The headless CMS developers love.', - }, - ], - [ - 'meta', - { - property: 'og:image', - content: 'https://strapi.io/documentation/assets/meta.png', - }, - ], - [ - 'meta', - { - property: 'og:article:author', - content: 'strapi', - }, - ], +${metas.toString()}; + +${themeConfig.toString()} + +${markdown.toString()} - [ - 'meta', - { - property: 'twitter:card', - content: 'summary_large_image', - }, - ], - [ - 'meta', - { - property: 'twitter:url', - content: 'https://strapi.io/documentation/', - }, - ], - [ - 'meta', - { - property: 'twitter:site', - content: '@strapijs', - }, - ], - [ - 'meta', - { - property: 'twitter:title', - content: 'Strapi Documentation', - }, - ], - [ - 'meta', - { - property: 'twitter:description', - content: 'The headless CMS developers love.', - }, - ], - [ - 'meta', - { - property: 'twitter:image', - content: 'http://strapi.io/assets/images/strapi-website-preview.png', - }, - ], - [ - 'script', - {}, - \`(function(w, d, s, l, i) { - w[l] = w[l] || []; - w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' }); - var f = d.getElementsByTagName(s)[0], - j = d.createElement(s), - dl = l != 'dataLayer' ? '&l=' + l : ''; - j.async = true; - j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; - f.parentNode.insertBefore(j, f); -})(window, document, 'script', 'dataLayer', 'GTM-KN9JRWG'); -\`, - ], - ], - themeConfig: { - logo: '/assets/logo.png', - nav: [ - { - text: 'Resource Center', - link: 'https://strapi.io/resource-center', - }, - { - text: 'v4 Documentation', - items: [ - { - text: 'Developer Docs', - items: [ - { - text: 'Getting Started', - link: '/developer-docs/latest/getting-started/introduction.html', - }, - { - text: 'Setup & Deployment', - link: '/developer-docs/latest/setup-deployment-guides/installation.html', - }, - { - text: 'Plugins', - link: '/developer-docs/latest/plugins/plugins-intro.html', - }, - { - text: 'Development', - link: '/developer-docs/latest/development/backend-customization.html', - }, - { - text: 'Update & Migration', - link: '/developer-docs/latest/update-migration-guides/update-version.html', - }, - { - text: 'Developer Resources', - link: '/developer-docs/latest/developer-resources/content-api/content-api.html', - }, - ], - }, - { - text: 'User Guide', - items: [ - { - text: 'Getting Started', - link: '/user-docs/latest/getting-started/introduction.html', - }, - { - text: 'Content Manager', - link: '/user-docs/latest/content-manager/introduction-to-content-manager.html', - }, - { - text: 'Content-Type Builder', - link: - '/user-docs/latest/content-types-builder/introduction-to-content-types-builder.html', - }, - { - text: 'Users, Roles, and Permissions', - link: - '/user-docs/latest/users-roles-permissions/introduction-to-users-roles-permissions.html', - }, - { - text: 'Plugins', - link: '/user-docs/latest/plugins/introduction-to-plugins.html', - }, - { - text: 'General Settings', - link: '/user-docs/latest/settings/managing-global-settings.html', - }, - ], - }, - ], - }, - { - text: 'v3 documentation', - link: 'https://docs-v3.strapi.io' - }, - { - text: 'Ecosystem', - items: [ - { - text: 'Strapi', - items: [ - { - text: 'Website', - link: 'https://strapi.io', - }, - { - text: 'Blog', - link: 'https://strapi.io/blog', - }, - { - text: 'StrapiConf 2021', - link: 'https://www.strapi.io/strapi-conf-2021', - }, - ], - }, - { - text: 'Community', - items: [ - { - text: 'Forum', - link: 'https://forum.strapi.io', - }, - { - text: 'Discord', - link: 'https://discord.strapi.io', - }, - { - text: 'Awesome-Strapi', - link: 'https://github.com/strapi/awesome-strapi', - }, - ], - }, - { - text: 'Resources', - items: [ - { - text: 'Tutorials', - link: 'https://strapi.io/tutorials', - }, - { - text: 'Academy', - link: 'https://academy.strapi.io/', - }, - ], - }, - ], - }, - { - text: "We're hiring!", - link: 'https://strapi.io/careers#open-positions', - }, - ], - repo: 'strapi/documentation', - docsDir: 'docs', - docsBranch: 'main', - algolia: { - appId: '9FTY6J9E4X', - apiKey: 'cf49c82a1865df2618a3d89e18657051', - indexName: 'documentation', - }, - editLinks: true, - editLinkText: 'Improve this page', - serviceWorker: true, - sidebarDepth: 1, - smoothScroll: false, - sidebar: { - '/developer-docs/latest/': sidebar.developer, - '/user-docs/latest/': sidebar.user, - }, - }, - markdown: { - extendMarkdown: md => { - // use more markdown-it plugins! - md.use(require('markdown-it-include')); - }, - }, + +module.exports = { + ...metas, + themeConfig, + markdown, + plugins, }; `; From e6cffe498a860dfe350dfe105c8c2bda1ee6f1f6 Mon Sep 17 00:00:00 2001 From: soupette Date: Wed, 8 Dec 2021 11:15:07 +0100 Subject: [PATCH 5/9] Add config.js to gitignore and move all config files into the config folder Signed-off-by: soupette --- .gitignore | 4 ++++ docs/.vuepress/{ => config}/link-checker.js | 0 docs/.vuepress/{ => config}/markdown-config.js | 0 docs/.vuepress/{ => config}/metas.js | 0 docs/.vuepress/{ => config}/plugins.js | 0 docs/.vuepress/{ => config}/sidebar.js | 0 docs/.vuepress/{ => config}/theme-config.js | 0 docs/scripts/create-config-file.js | 2 +- 8 files changed, 5 insertions(+), 1 deletion(-) rename docs/.vuepress/{ => config}/link-checker.js (100%) rename docs/.vuepress/{ => config}/markdown-config.js (100%) rename docs/.vuepress/{ => config}/metas.js (100%) rename docs/.vuepress/{ => config}/plugins.js (100%) rename docs/.vuepress/{ => config}/sidebar.js (100%) rename docs/.vuepress/{ => config}/theme-config.js (100%) diff --git a/.gitignore b/.gitignore index f60df091be..748cdd373c 100644 --- a/.gitignore +++ b/.gitignore @@ -109,3 +109,7 @@ dist # IDE .idea .vscode + + +# Auto generated files +*.vuepress/config.js \ No newline at end of file diff --git a/docs/.vuepress/link-checker.js b/docs/.vuepress/config/link-checker.js similarity index 100% rename from docs/.vuepress/link-checker.js rename to docs/.vuepress/config/link-checker.js diff --git a/docs/.vuepress/markdown-config.js b/docs/.vuepress/config/markdown-config.js similarity index 100% rename from docs/.vuepress/markdown-config.js rename to docs/.vuepress/config/markdown-config.js diff --git a/docs/.vuepress/metas.js b/docs/.vuepress/config/metas.js similarity index 100% rename from docs/.vuepress/metas.js rename to docs/.vuepress/config/metas.js diff --git a/docs/.vuepress/plugins.js b/docs/.vuepress/config/plugins.js similarity index 100% rename from docs/.vuepress/plugins.js rename to docs/.vuepress/config/plugins.js diff --git a/docs/.vuepress/sidebar.js b/docs/.vuepress/config/sidebar.js similarity index 100% rename from docs/.vuepress/sidebar.js rename to docs/.vuepress/config/sidebar.js diff --git a/docs/.vuepress/theme-config.js b/docs/.vuepress/config/theme-config.js similarity index 100% rename from docs/.vuepress/theme-config.js rename to docs/.vuepress/config/theme-config.js diff --git a/docs/scripts/create-config-file.js b/docs/scripts/create-config-file.js index b4adcc0a41..41ad0c9fea 100644 --- a/docs/scripts/create-config-file.js +++ b/docs/scripts/create-config-file.js @@ -4,7 +4,7 @@ const path = require('path'); const fs = require('fs-extra'); const createConfigFile = async () => { - const dest = path.resolve(__dirname, '..', '.vuepress'); + const dest = path.resolve(__dirname, '..', '.vuepress', 'config'); const sidebar = await fs.readFile(path.resolve(dest, 'sidebar.js')); const linkChecker = await fs.readFile(path.resolve(dest, 'link-checker.js')); const plugins = await fs.readFile(path.resolve(dest, 'plugins.js')); From 57f9f8b358bee1295e10c302a513e65c3d8d3131 Mon Sep 17 00:00:00 2001 From: soupette Date: Wed, 8 Dec 2021 11:38:36 +0100 Subject: [PATCH 6/9] Init patterns to split user et dev docs Signed-off-by: soupette --- docs/.vuepress/config.js | 9 +++++++++ docs/.vuepress/config/patterns.js | 5 +++++ docs/scripts/create-config-file.js | 4 ++++ docs/tmp.md | 5 +---- 4 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 docs/.vuepress/config/patterns.js diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index bb04f2e439..c8335ac418 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -933,11 +933,20 @@ const markdown = { }; +const patterns = [ + '**/*.md', + '!**/developer-docs/**/*.md', + '**/developer-docs/latest/getting-started/introduction.md', +]; + + module.exports = { ...metas, themeConfig, markdown, plugins, + cache: true, + patterns }; \ No newline at end of file diff --git a/docs/.vuepress/config/patterns.js b/docs/.vuepress/config/patterns.js new file mode 100644 index 0000000000..54751ae694 --- /dev/null +++ b/docs/.vuepress/config/patterns.js @@ -0,0 +1,5 @@ +const patterns = [ + '**/*.md', + '!**/developer-docs/**/*.md', + '**/developer-docs/latest/getting-started/introduction.md', +]; diff --git a/docs/scripts/create-config-file.js b/docs/scripts/create-config-file.js index 41ad0c9fea..bdd6f38101 100644 --- a/docs/scripts/create-config-file.js +++ b/docs/scripts/create-config-file.js @@ -11,6 +11,7 @@ const createConfigFile = async () => { const metas = await fs.readFile(path.resolve(dest, 'metas.js')); const themeConfig = await fs.readFile(path.resolve(dest, 'theme-config.js')); const markdown = await fs.readFile(path.resolve(dest, 'markdown-config.js')); + const patterns = await fs.readFile(path.resolve(dest, 'patterns.js')); const content = ` ${sidebar.toString()} @@ -25,12 +26,15 @@ ${themeConfig.toString()} ${markdown.toString()} +${patterns.toString()} + module.exports = { ...metas, themeConfig, markdown, plugins, + patterns }; `; diff --git a/docs/tmp.md b/docs/tmp.md index c7216153f2..a52416a63c 100644 --- a/docs/tmp.md +++ b/docs/tmp.md @@ -1,7 +1,4 @@ -1. Split la config -2. Ecrire le fichier config.js -3. Checker le hot reload -4. Checker la doc vue press => exclure certaine parties de la doc +4. Checker la doc vue press => exclure certaines parties de la doc 5. Switch to monorepo WARNING: exp de dev doit etre pareil From 0e3383e40995d8a3b185e5e78d74db2c9f177675 Mon Sep 17 00:00:00 2001 From: soupette Date: Wed, 8 Dec 2021 14:46:43 +0100 Subject: [PATCH 7/9] Split dev config Signed-off-by: soupette --- .gitignore | 2 +- CONTRIBUTING.md | 19 +- docs/.vuepress/config.js | 952 ------------------ docs/.vuepress/config/link-checker.js | 18 - .../{markdown-config.js => markdown.js} | 0 docs/.vuepress/config/patterns-developer.js | 1 + .../config/{patterns.js => patterns-user.js} | 1 + docs/.vuepress/config/plugins.js | 19 + docs/package.json | 8 +- ...s => create-developer-docs-config-file.js} | 7 +- docs/scripts/create-main-config-file.js | 38 + docs/scripts/create-user-docs-config-file.js | 43 + docs/tmp.md | 4 - 13 files changed, 128 insertions(+), 984 deletions(-) delete mode 100644 docs/.vuepress/config.js delete mode 100644 docs/.vuepress/config/link-checker.js rename docs/.vuepress/config/{markdown-config.js => markdown.js} (100%) create mode 100644 docs/.vuepress/config/patterns-developer.js rename docs/.vuepress/config/{patterns.js => patterns-user.js} (87%) rename docs/scripts/{create-config-file.js => create-developer-docs-config-file.js} (88%) create mode 100644 docs/scripts/create-main-config-file.js create mode 100644 docs/scripts/create-user-docs-config-file.js delete mode 100644 docs/tmp.md diff --git a/.gitignore b/.gitignore index 748cdd373c..e317108564 100644 --- a/.gitignore +++ b/.gitignore @@ -112,4 +112,4 @@ dist # Auto generated files -*.vuepress/config.js \ No newline at end of file +docs/.vuepress/config.js \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 66fe2af414..1dabef27c6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -78,11 +78,26 @@ The core team will review your pull request and will either merge it, request ch cd docs ``` -6. Make sure all dependencies are installed, then run the server: +6. Make sure all dependencies are installed ```bash - yarn && yarn dev + yarn ``` + +7. Start the documentation server + + ```bash + # Launch the full documentation + yarn dev + + # Launch only the developer docs + yarn dev:developer + + # Launch only the user docs + yarn dev:user + ``` + + #### Writing We can't provide you specific procedures with step-by-step instructions to write technical documentation. But our ["12 Rules of Technical Writing"](https://handbook.strapi.io/user-success-manual/12-rules-of-technical-writing) and [style guide](https://handbook.strapi.io/user-success-manual/strapi-documentation-style-guide) should help you get started. If you have any question or need help, do feel free to reach us through [our forum](https://forum.strapi.io/). diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js deleted file mode 100644 index c8335ac418..0000000000 --- a/docs/.vuepress/config.js +++ /dev/null @@ -1,952 +0,0 @@ - -const sidebar = { - developer: [ - { - title: '🚀 Getting Started', - collapsable: false, - children: [ - ['/developer-docs/latest/getting-started/introduction', 'Introduction'], - ['/developer-docs/latest/getting-started/quick-start', 'Quick Start Guide'], - ['/developer-docs/latest/getting-started/troubleshooting', 'Frequently Asked Questions'], - ['/developer-docs/latest/getting-started/usage-information', 'Usage Information'], - ], - }, - { - title: '⚙️ Setup & Deployment', - collapsable: false, - sidebarDepth: 0, - initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default - children: [ - { - title: 'Installation', - path: '/developer-docs/latest/setup-deployment-guides/installation.html', - collapsable: true, - sidebarDepth: 1, - children: [ - ['/developer-docs/latest/setup-deployment-guides/installation/cli.md', 'CLI'], - ['/developer-docs/latest/setup-deployment-guides/installation/docker.md', 'Docker'], - [ - '/developer-docs/latest/setup-deployment-guides/installation/digitalocean-one-click.md', - 'DigitalOcean One-Click', - ], - [ - '/developer-docs/latest/setup-deployment-guides/installation/platformsh.md', - 'Platform.sh One-Click', - ], - [ - '/developer-docs/latest/setup-deployment-guides/installation/render.md', - 'Render One-Click', - ], - ], - }, - ['/developer-docs/latest/setup-deployment-guides/file-structure.md', 'Project structure'], - { - title: 'Configurations', - path: '/developer-docs/latest/setup-deployment-guides/configurations.html', - collapsable: true, - children: [ - { - title: 'Required configurations', - collapsable: true, - children: [ - [ - '/developer-docs/latest/setup-deployment-guides/configurations/required/databases.md', - 'Database', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/required/server.md', - 'Server', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/required/admin-panel.md', - 'Admin panel', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/required/middlewares.md', - 'Middlewares', - ], - ], - }, - { - title: 'Optional configurations', - collapsable: true, - children: [ - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/api-tokens.md', - 'API tokens', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/functions.md', - 'Functions', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/cronjobs.md', - 'Cron jobs', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/api.md', - 'API', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/plugins.md', - 'Plugins', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.md', - 'Environment', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/public-assets.md', - 'Public Assets', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md', - 'Single Sign On (SSO)', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/rbac.md', - 'Role-Based Access Control (RBAC)', - ], - ], - }, - ], - }, - { - title: 'Deployment', - path: '/developer-docs/latest/setup-deployment-guides/deployment', - collapsable: true, - initialOpenGroupIndex: -1, // make sure that no subgroup is open by default — if set to 0, 'Hosting Provider Guides' is expanded - children: [ - { - title: 'Hosting Provider Guides', - path: - '/developer-docs/latest/setup-deployment-guides/deployment.html#hosting-provider-guides', - collapsable: true, - children: [ - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/21yunbox.md', - '21YunBox', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/amazon-aws.md', - 'Amazon AWS', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/azure.md', - 'Azure', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean-app-platform.md', - 'DigitalOcean App Platform', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean.md', - 'DigitalOcean Droplets', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/google-app-engine.md', - 'Google App Engine', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/heroku.md', - 'Heroku', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/qovery.md', - 'Qovery', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/render.md', - 'Render', - ], - ], - sidebarDepth: 2, - }, - { - title: 'Optional Software Guides', - path: - '/developer-docs/latest/setup-deployment-guides/deployment.html#optional-software-guides', - collapsable: true, - children: [ - [ - '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/caddy-proxy.md', - 'Caddy', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/haproxy-proxy.md', - 'HAProxy', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/nginx-proxy.md', - 'Nginx', - ], - ], - sidebarDepth: 2, - }, - ], - sidebarDepth: 0, - }, - ], - }, - { - title: '🔧 Development', - collapsable: false, - initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default - children: [ - { - title: 'Back-end customization', - collapsable: true, - path: '/developer-docs/latest/development/backend-customization', - children: [ - ['/developer-docs/latest/development/backend-customization/routes.md', 'Routes'], - ['/developer-docs/latest/development/backend-customization/policies.md', 'Policies'], - [ - '/developer-docs/latest/development/backend-customization/middlewares.md', - 'Middlewares', - ], - [ - '/developer-docs/latest/development/backend-customization/controllers.md', - 'Controllers', - ], - [ - '/developer-docs/latest/development/backend-customization/requests-responses.md', - 'Requests & Responses', - ], - ['/developer-docs/latest/development/backend-customization/services.md', 'Services'], - ['/developer-docs/latest/development/backend-customization/models.md', 'Models'], - ['/developer-docs/latest/development/backend-customization/webhooks.md', 'Webhooks'], - ], - }, - ['/developer-docs/latest/development/admin-customization', 'Admin panel customization'], - ['/developer-docs/latest/development/plugins-extension.md', 'Plugins extension'], - ['/developer-docs/latest/development/plugins-development.md', 'Plugins development'], - ], - }, - { - title: '💻 Developer Resources', - collapsable: false, - initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default - sidebarDepth: 2, - children: [ - { - title: 'APIs Reference', - collapsable: true, - sidebarDepth: 1, - children: [ - [ - '/developer-docs/latest/developer-resources/database-apis-reference/rest-api.md', - 'REST API', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/graphql-api.md', - 'GraphQL API', - ], - { - title: 'Query Engine API', - path: - '/developer-docs/latest/developer-resources/database-apis-reference/query-engine-api.html', - collapsable: true, - // sidebarDepth: 3, - children: [ - [ - '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/single-operations.md', - 'Single Operations', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/bulk-operations.md', - 'Bulk Operations', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/filtering.md', - 'Filtering', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/populating.md', - 'Populating', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/order-pagination.md', - 'Ordering & pagination', - ], - ], - }, - { - title: 'Entity Service API', - path: - '/developer-docs/latest/developer-resources/database-apis-reference/entity-service-api', - collapsable: true, - children: [ - [ - '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/crud.md', - 'CRUD operations', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/filter.md', - 'Filters', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/populate.md', - 'Populate', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/order-pagination.md', - 'Ordering & pagination', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/components-dynamic-zones.md', - 'Components and dynamic zones', - ], - ], - }, - { - title: 'Plugin APIs Reference', - collapsable: true, - children: [ - [ - '/developer-docs/latest/developer-resources/plugin-api-reference/server.md', - 'Server API for plugins', - ], - [ - '/developer-docs/latest/developer-resources/plugin-api-reference/admin-panel.md', - 'Admin Panel API for plugins', - ], - ], - }, - ], - }, - ['/developer-docs/latest/developer-resources/cli/CLI', 'Command Line Interface'], - ['/developer-docs/latest/developer-resources/error-handling.md', 'Error handling'], - { - title: 'Integrations', - path: '/developer-docs/latest/developer-resources/content-api/integrations.html', - collapsable: true, - sidebarDepth: 1, - children: [ - ['/developer-docs/latest/developer-resources/content-api/integrations/react', 'React'], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/vue-js', - 'Vue.js', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/angular', - 'Angular', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/next-js', - 'Next.js', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/nuxt-js', - 'Nuxt.js', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/graphql', - 'GraphQL', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/gatsby', - 'Gatsby', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/gridsome', - 'Gridsome', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/jekyll', - 'Jekyll', - ], - ['/developer-docs/latest/developer-resources/content-api/integrations/11ty', '11ty'], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/svelte', - 'Svelte', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/sapper', - 'Sapper', - ], - ['/developer-docs/latest/developer-resources/content-api/integrations/ruby', 'Ruby'], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/python', - 'Python', - ], - ['/developer-docs/latest/developer-resources/content-api/integrations/dart', 'Dart'], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/flutter', - 'Flutter', - ], - ['/developer-docs/latest/developer-resources/content-api/integrations/go', 'Go'], - ['/developer-docs/latest/developer-resources/content-api/integrations/php', 'PHP'], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/laravel', - 'Laravel', - ], - ], - }, - ], - }, - { - title: '🧩 Strapi plugins', - path: '/developer-docs/latest/plugins/plugins-intro.html', - collapsable: false, - children: [ - ['/developer-docs/latest/plugins/graphql', 'GraphQL'], - ['/developer-docs/latest/plugins/i18n', 'Internationalization (i18n)'], - ['/developer-docs/latest/plugins/users-permissions', 'Users & Permissions'], - ['/developer-docs/latest/plugins/email', 'Email'], - ['/developer-docs/latest/plugins/upload', 'Upload'], - ['/developer-docs/latest/plugins/documentation', 'API Documentation'], - ], - sidebarDepth: 1, - }, - { - title: '♻️ Update & Migration', - collapsable: false, - children: [ - ['/developer-docs/latest/update-migration-guides/update-version.md', 'Update'], - ['/developer-docs/latest/update-migration-guides/migration-guides.md', 'Migration'], - ], - }, - { - title: '📚 Guides', - collapsable: true, - children: [ - ['/developer-docs/latest/guides/auth-request', 'Authenticated request'], - // ['/developer-docs/latest/guides/slug', 'Create a slug system'], - // ['/developer-docs/latest/guides/is-owner', 'Create is owner policy'], - // ['/developer-docs/latest/guides/custom-admin', 'Custom admin'], - // ['/developer-docs/latest/guides/custom-data-response', 'Custom data response'], - ['/developer-docs/latest/guides/draft', 'Draft system'], - // ['/developer-docs/latest/guides/error-catching', 'Error catching'], - // ['/developer-docs/latest/guides/external-data', 'Fetching external data'], - ['/developer-docs/latest/guides/jwt-validation', 'JWT validation'], - ['/developer-docs/latest/guides/process-manager', 'Process manager'], - ['/developer-docs/latest/guides/scheduled-publication', 'Scheduled publication'], - // ['/developer-docs/latest/guides/secure-your-app', 'Secure your application'], - // ['/developer-docs/latest/guides/send-email', 'Send email programmatically'], - // [ - // '/developer-docs/latest/guides/registering-a-field-in-admin', - // 'Registering a new field in the admin panel', - // ], - // ['/developer-docs/latest/guides/client', 'Setup a third party client'], - ['/developer-docs/latest/guides/unit-testing', 'Unit testing'], - ], - }, - ], - user: [ - { - collapsable: false, - title: '', - children: [ - ['/user-docs/latest/getting-started/introduction', 'Welcome to the Strapi user guide!'], - ], - }, - { - collapsable: false, - title: 'Content Manager', - children: [ - [ - '/user-docs/latest/content-manager/introduction-to-content-manager', - 'Introduction to the Content Manager', - ], - [ - '/user-docs/latest/content-manager/configuring-view-of-content-type', - 'Configuring the views of a content type', - ], - ['/user-docs/latest/content-manager/writing-content', 'Writing content'], - [ - '/user-docs/latest/content-manager/managing-relational-fields', - 'Managing relational fields', - ], - ['/user-docs/latest/content-manager/translating-content', 'Translating content'], - [ - '/user-docs/latest/content-manager/saving-and-publishing-content', - 'Saving, publishing and deleting content', - ], - ], - }, - { - collapsable: false, - title: 'Content-Type Builder', - children: [ - [ - '/user-docs/latest/content-types-builder/introduction-to-content-types-builder', - 'Introduction to the Content-Type Builder', - ], - [ - '/user-docs/latest/content-types-builder/creating-new-content-type', - 'Creating content types', - ], - [ - '/user-docs/latest/content-types-builder/managing-content-types', - 'Managing content types', - ], - [ - '/user-docs/latest/content-types-builder/configuring-fields-content-type', - 'Configuring fields for content types', - ], - ], - }, - { - collapsable: false, - title: 'Users, Roles & Permissions', - children: [ - [ - '/user-docs/latest/users-roles-permissions/introduction-to-users-roles-permissions', - 'Introduction to users, roles & permissions', - ], - [ - '/user-docs/latest/users-roles-permissions/configuring-administrator-roles', - 'Configuring administrator roles', - ], - [ - '/user-docs/latest/users-roles-permissions/managing-administrators', - 'Managing administrator accounts', - ], - [ - '/user-docs/latest/users-roles-permissions/configuring-end-users-roles', - 'Configuring end-users roles', - ], - [ - '/user-docs/latest/users-roles-permissions/managing-end-users', - 'Managing end-users accounts', - ], - ], - }, - { - collapsable: false, - title: 'Plugins', - children: [ - ['/user-docs/latest/plugins/introduction-to-plugins', 'Introduction to plugins'], - [ - '/user-docs/latest/plugins/installing-plugins-via-marketplace', - 'Installing plugins via the Marketplace', - ], - ['/user-docs/latest/plugins/strapi-plugins', 'List of Strapi plugins'], - ], - }, - { - collapsable: false, - title: 'General settings', - children: [ - ['/user-docs/latest/settings/managing-global-settings', 'Managing global settings'], - [ - '/user-docs/latest/settings/configuring-users-permissions-plugin-settings', - 'Configuring Users & Permissions plugin settings', - ], - ], - }, - ], -}; - - -const checklinksIgnoredFiles = [ - '**/node_modules', // please never remove this one - /** - * Caution: Adding an individual file to this section - * will prevent the _whole_ file from being scanned for broken links. - * - * Currently, there is no easy way to ignore a specific link inside a file. - */ - - /** - * Files below give false positives - */ - '/developer-docs/latest/developer-resources/plugin-api-reference/admin-panel.md', - './developer-docs/latest/development/backend-customization/models.md', - './developer-docs/latest/guides/count-graphql.md', // might be removed once GraphQL customization is ready - './developer-docs/latest/setup-deployment-guides/configurations.md', // the script thinks filename[]() at line 977 is a real link - './developer-docs/latest/development/backend-customization/webhooks.md', // 'missing" links are in commented part of file -]; - - -const plugins = [ - ['vuepress-plugin-element-tabs', {}], - [ - 'check-md', - { - ignore: checklinksIgnoredFiles, - }, - ], - [ - 'seo', - { - siteTitle: (_, $site) => $site.title, - title: $page => $page.title, - }, - ], - ['@vuepress/medium-zoom'], - [ - 'vuepress-plugin-code-copy', - { - color: '#ffffff', - successText: 'Copied to clipboard!', - }, - ], - ['@vuepress/back-to-top', {}], - [ - 'vuepress-plugin-container', - { - type: 'callout', - defaultTitle: '', - }, - ], - [ - 'vuepress-plugin-container', - { - type: 'strapi', - defaultTitle: '', - before: info => - `

🤓 ${info}

`, - after: '
', - }, - ], - [ - 'vuepress-plugin-container', - { - type: 'tip', - before: info => `

💡 ${info}

`, - after: '
', - }, - ], - [ - 'vuepress-plugin-container', - { - type: 'note', - before: info => `

✏️ ${info}

`, - after: '
', - }, - ], - [ - 'vuepress-plugin-container', - { - type: 'caution', - before: info => - `

✋ ${info}

`, - after: '
', - }, - ], - [ - 'vuepress-plugin-container', - { - type: 'warning', - before: info => - `

️❗️ ${info}

`, - after: '
', - }, - ], - [ - 'vuepress-plugin-container', - { - type: 'prerequisites', - defaultTitle: 'PREREQUISITES', - }, - ], - [ - 'vuepress-plugin-container', - { - type: 'api-call', - defaultTitle: '', - }, - ], - [ - 'vuepress-plugin-container', - { - type: 'request', - defaultTitle: 'Request', - }, - ], - [ - 'vuepress-plugin-container', - { - type: 'response', - defaultTitle: 'Response', - }, - ], -]; - - -const metas = { - title: '', - port: 8080, - description: 'The headless CMS developers love.', - base: '/', - head: [ - [ - 'link', - { - rel: 'icon', - href: 'https://strapi.io/assets/favicon-32x32.png', - }, - ], - [ - 'meta', - { - property: 'og:title', - content: 'Strapi Documentation', - }, - ], - [ - 'meta', - { - property: 'og:type', - content: 'article', - }, - ], - [ - 'meta', - { - property: 'og:url', - content: 'https://strapi.io/documentation/', - }, - ], - [ - 'meta', - { - property: 'og:description', - content: 'The headless CMS developers love.', - }, - ], - [ - 'meta', - { - property: 'og:image', - content: 'https://strapi.io/documentation/assets/meta.png', - }, - ], - [ - 'meta', - { - property: 'og:article:author', - content: 'strapi', - }, - ], - - [ - 'meta', - { - property: 'twitter:card', - content: 'summary_large_image', - }, - ], - [ - 'meta', - { - property: 'twitter:url', - content: 'https://strapi.io/documentation/', - }, - ], - [ - 'meta', - { - property: 'twitter:site', - content: '@strapijs', - }, - ], - [ - 'meta', - { - property: 'twitter:title', - content: 'Strapi Documentation', - }, - ], - [ - 'meta', - { - property: 'twitter:description', - content: 'The headless CMS developers love.', - }, - ], - [ - 'meta', - { - property: 'twitter:image', - content: 'http://strapi.io/assets/images/strapi-website-preview.png', - }, - ], - [ - 'script', - {}, - `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-KN9JRWG');`, - ], - ], -}; -; - -const themeConfig = { - logo: '/assets/logo.png', - nav: [ - { - text: 'Resource Center', - link: 'https://strapi.io/resource-center', - }, - { - text: 'v4 Documentation', - items: [ - { - text: 'Developer Docs', - items: [ - { - text: 'Getting Started', - link: '/developer-docs/latest/getting-started/introduction.html', - }, - { - text: 'Setup & Deployment', - link: '/developer-docs/latest/setup-deployment-guides/installation.html', - }, - { - text: 'Plugins', - link: '/developer-docs/latest/plugins/plugins-intro.html', - }, - { - text: 'Development', - link: '/developer-docs/latest/development/backend-customization.html', - }, - { - text: 'Update & Migration', - link: '/developer-docs/latest/update-migration-guides/update-version.html', - }, - { - text: 'Developer Resources', - link: '/developer-docs/latest/developer-resources/content-api/content-api.html', - }, - ], - }, - { - text: 'User Guide', - items: [ - { - text: 'Getting Started', - link: '/user-docs/latest/getting-started/introduction.html', - }, - { - text: 'Content Manager', - link: '/user-docs/latest/content-manager/introduction-to-content-manager.html', - }, - { - text: 'Content-Type Builder', - link: - '/user-docs/latest/content-types-builder/introduction-to-content-types-builder.html', - }, - { - text: 'Users, Roles, and Permissions', - link: - '/user-docs/latest/users-roles-permissions/introduction-to-users-roles-permissions.html', - }, - { - text: 'Plugins', - link: '/user-docs/latest/plugins/introduction-to-plugins.html', - }, - { - text: 'General Settings', - link: '/user-docs/latest/settings/managing-global-settings.html', - }, - ], - }, - ], - }, - { - text: 'v3 documentation', - link: 'https://docs-v3.strapi.io', - }, - { - text: 'Ecosystem', - items: [ - { - text: 'Strapi', - items: [ - { - text: 'Website', - link: 'https://strapi.io', - }, - { - text: 'Blog', - link: 'https://strapi.io/blog', - }, - { - text: 'StrapiConf 2021', - link: 'https://www.strapi.io/strapi-conf-2021', - }, - ], - }, - { - text: 'Community', - items: [ - { - text: 'Forum', - link: 'https://forum.strapi.io', - }, - { - text: 'Discord', - link: 'https://discord.strapi.io', - }, - { - text: 'Awesome-Strapi', - link: 'https://github.com/strapi/awesome-strapi', - }, - ], - }, - { - text: 'Resources', - items: [ - { - text: 'Tutorials', - link: 'https://strapi.io/tutorials', - }, - { - text: 'Academy', - link: 'https://academy.strapi.io/', - }, - ], - }, - ], - }, - { - text: "We're hiring!", - link: 'https://strapi.io/careers#open-positions', - }, - ], - repo: 'strapi/documentation', - docsDir: 'docs', - docsBranch: 'main', - algolia: { - appId: '9FTY6J9E4X', - apiKey: 'cf49c82a1865df2618a3d89e18657051', - indexName: 'documentation', - }, - editLinks: true, - editLinkText: 'Improve this page', - serviceWorker: true, - sidebarDepth: 1, - smoothScroll: false, - sidebar: { - '/developer-docs/latest/': sidebar.developer, - '/user-docs/latest/': sidebar.user, - }, -}; - - -const markdown = { - extendMarkdown: md => { - // use more markdown-it plugins! - md.use(require('markdown-it-include')); - }, -}; - - -const patterns = [ - '**/*.md', - '!**/developer-docs/**/*.md', - '**/developer-docs/latest/getting-started/introduction.md', -]; - - - -module.exports = { - ...metas, - themeConfig, - markdown, - plugins, - cache: true, - patterns -}; - \ No newline at end of file diff --git a/docs/.vuepress/config/link-checker.js b/docs/.vuepress/config/link-checker.js deleted file mode 100644 index d22b43021f..0000000000 --- a/docs/.vuepress/config/link-checker.js +++ /dev/null @@ -1,18 +0,0 @@ -const checklinksIgnoredFiles = [ - '**/node_modules', // please never remove this one - /** - * Caution: Adding an individual file to this section - * will prevent the _whole_ file from being scanned for broken links. - * - * Currently, there is no easy way to ignore a specific link inside a file. - */ - - /** - * Files below give false positives - */ - '/developer-docs/latest/developer-resources/plugin-api-reference/admin-panel.md', - './developer-docs/latest/development/backend-customization/models.md', - './developer-docs/latest/guides/count-graphql.md', // might be removed once GraphQL customization is ready - './developer-docs/latest/setup-deployment-guides/configurations.md', // the script thinks filename[]() at line 977 is a real link - './developer-docs/latest/development/backend-customization/webhooks.md', // 'missing" links are in commented part of file -]; diff --git a/docs/.vuepress/config/markdown-config.js b/docs/.vuepress/config/markdown.js similarity index 100% rename from docs/.vuepress/config/markdown-config.js rename to docs/.vuepress/config/markdown.js diff --git a/docs/.vuepress/config/patterns-developer.js b/docs/.vuepress/config/patterns-developer.js new file mode 100644 index 0000000000..16d896b1fe --- /dev/null +++ b/docs/.vuepress/config/patterns-developer.js @@ -0,0 +1 @@ +const patterns = ['**/*.md', '!**/user-docs/**/*.md', '!node_modules']; diff --git a/docs/.vuepress/config/patterns.js b/docs/.vuepress/config/patterns-user.js similarity index 87% rename from docs/.vuepress/config/patterns.js rename to docs/.vuepress/config/patterns-user.js index 54751ae694..b6a5aebe56 100644 --- a/docs/.vuepress/config/patterns.js +++ b/docs/.vuepress/config/patterns-user.js @@ -2,4 +2,5 @@ const patterns = [ '**/*.md', '!**/developer-docs/**/*.md', '**/developer-docs/latest/getting-started/introduction.md', + '!node_modules', ]; diff --git a/docs/.vuepress/config/plugins.js b/docs/.vuepress/config/plugins.js index d10ac02b28..9a913a6185 100644 --- a/docs/.vuepress/config/plugins.js +++ b/docs/.vuepress/config/plugins.js @@ -1,3 +1,22 @@ +const checklinksIgnoredFiles = [ + '**/node_modules', // please never remove this one + /** + * Caution: Adding an individual file to this section + * will prevent the _whole_ file from being scanned for broken links. + * + * Currently, there is no easy way to ignore a specific link inside a file. + */ + + /** + * Files below give false positives + */ + '/developer-docs/latest/developer-resources/plugin-api-reference/admin-panel.md', + './developer-docs/latest/development/backend-customization/models.md', + './developer-docs/latest/guides/count-graphql.md', // might be removed once GraphQL customization is ready + './developer-docs/latest/setup-deployment-guides/configurations.md', // the script thinks filename[]() at line 977 is a real link + './developer-docs/latest/development/backend-customization/webhooks.md', // 'missing" links are in commented part of file +]; + const plugins = [ ['vuepress-plugin-element-tabs', {}], [ diff --git a/docs/package.json b/docs/package.json index c7669502d9..a005f4f35a 100644 --- a/docs/package.json +++ b/docs/package.json @@ -4,9 +4,13 @@ "main": "index.js", "scripts": { "dev": "yarn create:config-file && vuepress dev", - "build": "vuepress build", + "dev:developer": "yarn create:dev-config-file && vuepress dev", + "dev:user": "yarn create:user-config-file && vuepress dev", + "build": "yarn create:config-file && vuepress build", "check-links": "vuepress check-md", - "create:config-file": "node ./scripts/create-config-file.js" + "create:config-file": "node ./scripts/create-main-config-file.js", + "create:dev-config-file": "node ./scripts/create-developer-docs-config-file.js", + "create:user-config-file": "node ./scripts/create-user-docs-config-file.js" }, "license": "SEE LICENSE IN LICENSE", "dependencies": { diff --git a/docs/scripts/create-config-file.js b/docs/scripts/create-developer-docs-config-file.js similarity index 88% rename from docs/scripts/create-config-file.js rename to docs/scripts/create-developer-docs-config-file.js index bdd6f38101..ca42fb5946 100644 --- a/docs/scripts/create-config-file.js +++ b/docs/scripts/create-developer-docs-config-file.js @@ -6,18 +6,15 @@ const fs = require('fs-extra'); const createConfigFile = async () => { const dest = path.resolve(__dirname, '..', '.vuepress', 'config'); const sidebar = await fs.readFile(path.resolve(dest, 'sidebar.js')); - const linkChecker = await fs.readFile(path.resolve(dest, 'link-checker.js')); const plugins = await fs.readFile(path.resolve(dest, 'plugins.js')); const metas = await fs.readFile(path.resolve(dest, 'metas.js')); const themeConfig = await fs.readFile(path.resolve(dest, 'theme-config.js')); - const markdown = await fs.readFile(path.resolve(dest, 'markdown-config.js')); - const patterns = await fs.readFile(path.resolve(dest, 'patterns.js')); + const markdown = await fs.readFile(path.resolve(dest, 'markdown.js')); + const patterns = await fs.readFile(path.resolve(dest, 'patterns-developer.js')); const content = ` ${sidebar.toString()} -${linkChecker.toString()} - ${plugins.toString()} ${metas.toString()}; diff --git a/docs/scripts/create-main-config-file.js b/docs/scripts/create-main-config-file.js new file mode 100644 index 0000000000..589e767ef3 --- /dev/null +++ b/docs/scripts/create-main-config-file.js @@ -0,0 +1,38 @@ +'use strict'; + +const path = require('path'); +const fs = require('fs-extra'); + +const createConfigFile = async () => { + const dest = path.resolve(__dirname, '..', '.vuepress', 'config'); + const sidebar = await fs.readFile(path.resolve(dest, 'sidebar.js')); + const plugins = await fs.readFile(path.resolve(dest, 'plugins.js')); + const metas = await fs.readFile(path.resolve(dest, 'metas.js')); + const themeConfig = await fs.readFile(path.resolve(dest, 'theme-config.js')); + const markdown = await fs.readFile(path.resolve(dest, 'markdown.js')); + + const content = ` +${sidebar.toString()} + +${plugins.toString()} + +${metas.toString()}; + +${themeConfig.toString()} + +${markdown.toString()} + +module.exports = { + ...metas, + themeConfig, + markdown, + plugins, +}; + `; + + const destination = path.resolve(__dirname, '..', '.vuepress', 'config.js'); + + await fs.writeFile(destination, content); +}; + +createConfigFile(); diff --git a/docs/scripts/create-user-docs-config-file.js b/docs/scripts/create-user-docs-config-file.js new file mode 100644 index 0000000000..c84d9e0e87 --- /dev/null +++ b/docs/scripts/create-user-docs-config-file.js @@ -0,0 +1,43 @@ +'use strict'; + +const path = require('path'); +const fs = require('fs-extra'); + +const createConfigFile = async () => { + const dest = path.resolve(__dirname, '..', '.vuepress', 'config'); + const sidebar = await fs.readFile(path.resolve(dest, 'sidebar.js')); + const plugins = await fs.readFile(path.resolve(dest, 'plugins.js')); + const metas = await fs.readFile(path.resolve(dest, 'metas.js')); + const themeConfig = await fs.readFile(path.resolve(dest, 'theme-config.js')); + const markdown = await fs.readFile(path.resolve(dest, 'markdown.js')); + const patterns = await fs.readFile(path.resolve(dest, 'patterns-user.js')); + + const content = ` +${sidebar.toString()} + +${plugins.toString()} + +${metas.toString()}; + +${themeConfig.toString()} + +${markdown.toString()} + +${patterns.toString()} + + +module.exports = { + ...metas, + themeConfig, + markdown, + plugins, + patterns +}; + `; + + const destination = path.resolve(__dirname, '..', '.vuepress', 'config.js'); + + await fs.writeFile(destination, content); +}; + +createConfigFile(); diff --git a/docs/tmp.md b/docs/tmp.md deleted file mode 100644 index a52416a63c..0000000000 --- a/docs/tmp.md +++ /dev/null @@ -1,4 +0,0 @@ -4. Checker la doc vue press => exclure certaines parties de la doc -5. Switch to monorepo - -WARNING: exp de dev doit etre pareil From fb52e2e3ad8c924150237ee3d4eb457dd00be998 Mon Sep 17 00:00:00 2001 From: soupette Date: Wed, 8 Dec 2021 15:00:13 +0100 Subject: [PATCH 8/9] Split sidebar between use case Signed-off-by: soupette --- docs/.vuepress/config-backup.js | 5 + docs/.vuepress/config/patterns-user.js | 2 + docs/.vuepress/config/sidebar-developer.js | 432 ++++++++++++++ docs/.vuepress/config/sidebar-user.js | 104 ++++ docs/.vuepress/config/sidebar.js | 538 ------------------ .../create-developer-docs-config-file.js | 8 +- docs/scripts/create-main-config-file.js | 14 +- docs/scripts/create-user-docs-config-file.js | 8 +- 8 files changed, 567 insertions(+), 544 deletions(-) create mode 100644 docs/.vuepress/config/sidebar-developer.js create mode 100644 docs/.vuepress/config/sidebar-user.js delete mode 100644 docs/.vuepress/config/sidebar.js diff --git a/docs/.vuepress/config-backup.js b/docs/.vuepress/config-backup.js index a60780b1fe..87a65d8662 100644 --- a/docs/.vuepress/config-backup.js +++ b/docs/.vuepress/config-backup.js @@ -1,3 +1,8 @@ +/** + * This file is the backyup the old config.js one. + * @Piwi & @DerrickMehaffy I'll let you decide if you want to keep it. + */ + const sidebar = { developer: [ { diff --git a/docs/.vuepress/config/patterns-user.js b/docs/.vuepress/config/patterns-user.js index b6a5aebe56..86ae9fe48c 100644 --- a/docs/.vuepress/config/patterns-user.js +++ b/docs/.vuepress/config/patterns-user.js @@ -1,6 +1,8 @@ const patterns = [ '**/*.md', '!**/developer-docs/**/*.md', + // We import the homepage of the documentation from the developer documentation, + // without this when launching the doc it redirects to the 404 page. '**/developer-docs/latest/getting-started/introduction.md', '!node_modules', ]; diff --git a/docs/.vuepress/config/sidebar-developer.js b/docs/.vuepress/config/sidebar-developer.js new file mode 100644 index 0000000000..24e5d059a0 --- /dev/null +++ b/docs/.vuepress/config/sidebar-developer.js @@ -0,0 +1,432 @@ +const developer = [ + { + title: '🚀 Getting Started', + collapsable: false, + children: [ + ['/developer-docs/latest/getting-started/introduction', 'Introduction'], + ['/developer-docs/latest/getting-started/quick-start', 'Quick Start Guide'], + ['/developer-docs/latest/getting-started/troubleshooting', 'Frequently Asked Questions'], + ['/developer-docs/latest/getting-started/usage-information', 'Usage Information'], + ], + }, + { + title: '⚙️ Setup & Deployment', + collapsable: false, + sidebarDepth: 0, + initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default + children: [ + { + title: 'Installation', + path: '/developer-docs/latest/setup-deployment-guides/installation.html', + collapsable: true, + sidebarDepth: 1, + children: [ + ['/developer-docs/latest/setup-deployment-guides/installation/cli.md', 'CLI'], + ['/developer-docs/latest/setup-deployment-guides/installation/docker.md', 'Docker'], + [ + '/developer-docs/latest/setup-deployment-guides/installation/digitalocean-one-click.md', + 'DigitalOcean One-Click', + ], + [ + '/developer-docs/latest/setup-deployment-guides/installation/platformsh.md', + 'Platform.sh One-Click', + ], + [ + '/developer-docs/latest/setup-deployment-guides/installation/render.md', + 'Render One-Click', + ], + ], + }, + ['/developer-docs/latest/setup-deployment-guides/file-structure.md', 'Project structure'], + { + title: 'Configurations', + path: '/developer-docs/latest/setup-deployment-guides/configurations.html', + collapsable: true, + children: [ + { + title: 'Required configurations', + collapsable: true, + children: [ + [ + '/developer-docs/latest/setup-deployment-guides/configurations/required/databases.md', + 'Database', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/required/server.md', + 'Server', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/required/admin-panel.md', + 'Admin panel', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/required/middlewares.md', + 'Middlewares', + ], + ], + }, + { + title: 'Optional configurations', + collapsable: true, + children: [ + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/api-tokens.md', + 'API tokens', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/functions.md', + 'Functions', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/cronjobs.md', + 'Cron jobs', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/api.md', + 'API', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/plugins.md', + 'Plugins', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.md', + 'Environment', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/public-assets.md', + 'Public Assets', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md', + 'Single Sign On (SSO)', + ], + [ + '/developer-docs/latest/setup-deployment-guides/configurations/optional/rbac.md', + 'Role-Based Access Control (RBAC)', + ], + ], + }, + ], + }, + { + title: 'Deployment', + path: '/developer-docs/latest/setup-deployment-guides/deployment', + collapsable: true, + initialOpenGroupIndex: -1, // make sure that no subgroup is open by default — if set to 0, 'Hosting Provider Guides' is expanded + children: [ + { + title: 'Hosting Provider Guides', + path: + '/developer-docs/latest/setup-deployment-guides/deployment.html#hosting-provider-guides', + collapsable: true, + children: [ + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/21yunbox.md', + '21YunBox', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/amazon-aws.md', + 'Amazon AWS', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/azure.md', + 'Azure', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean-app-platform.md', + 'DigitalOcean App Platform', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean.md', + 'DigitalOcean Droplets', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/google-app-engine.md', + 'Google App Engine', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/heroku.md', + 'Heroku', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/qovery.md', + 'Qovery', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/render.md', + 'Render', + ], + ], + sidebarDepth: 2, + }, + { + title: 'Optional Software Guides', + path: + '/developer-docs/latest/setup-deployment-guides/deployment.html#optional-software-guides', + collapsable: true, + children: [ + [ + '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/caddy-proxy.md', + 'Caddy', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/haproxy-proxy.md', + 'HAProxy', + ], + [ + '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/nginx-proxy.md', + 'Nginx', + ], + ], + sidebarDepth: 2, + }, + ], + sidebarDepth: 0, + }, + ], + }, + { + title: '🔧 Development', + collapsable: false, + initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default + children: [ + { + title: 'Back-end customization', + collapsable: true, + path: '/developer-docs/latest/development/backend-customization', + children: [ + ['/developer-docs/latest/development/backend-customization/routes.md', 'Routes'], + ['/developer-docs/latest/development/backend-customization/policies.md', 'Policies'], + [ + '/developer-docs/latest/development/backend-customization/middlewares.md', + 'Middlewares', + ], + [ + '/developer-docs/latest/development/backend-customization/controllers.md', + 'Controllers', + ], + [ + '/developer-docs/latest/development/backend-customization/requests-responses.md', + 'Requests & Responses', + ], + ['/developer-docs/latest/development/backend-customization/services.md', 'Services'], + ['/developer-docs/latest/development/backend-customization/models.md', 'Models'], + ['/developer-docs/latest/development/backend-customization/webhooks.md', 'Webhooks'], + ], + }, + ['/developer-docs/latest/development/admin-customization', 'Admin panel customization'], + ['/developer-docs/latest/development/plugins-extension.md', 'Plugins extension'], + ['/developer-docs/latest/development/plugins-development.md', 'Plugins development'], + ], + }, + { + title: '💻 Developer Resources', + collapsable: false, + initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default + sidebarDepth: 2, + children: [ + { + title: 'APIs Reference', + collapsable: true, + sidebarDepth: 1, + children: [ + [ + '/developer-docs/latest/developer-resources/database-apis-reference/rest-api.md', + 'REST API', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/graphql-api.md', + 'GraphQL API', + ], + { + title: 'Query Engine API', + path: + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine-api.html', + collapsable: true, + // sidebarDepth: 3, + children: [ + [ + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/single-operations.md', + 'Single Operations', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/bulk-operations.md', + 'Bulk Operations', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/filtering.md', + 'Filtering', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/populating.md', + 'Populating', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/order-pagination.md', + 'Ordering & pagination', + ], + ], + }, + { + title: 'Entity Service API', + path: + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service-api', + collapsable: true, + children: [ + [ + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/crud.md', + 'CRUD operations', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/filter.md', + 'Filters', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/populate.md', + 'Populate', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/order-pagination.md', + 'Ordering & pagination', + ], + [ + '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/components-dynamic-zones.md', + 'Components and dynamic zones', + ], + ], + }, + { + title: 'Plugin APIs Reference', + collapsable: true, + children: [ + [ + '/developer-docs/latest/developer-resources/plugin-api-reference/server.md', + 'Server API for plugins', + ], + [ + '/developer-docs/latest/developer-resources/plugin-api-reference/admin-panel.md', + 'Admin Panel API for plugins', + ], + ], + }, + ], + }, + ['/developer-docs/latest/developer-resources/cli/CLI', 'Command Line Interface'], + ['/developer-docs/latest/developer-resources/error-handling.md', 'Error handling'], + { + title: 'Integrations', + path: '/developer-docs/latest/developer-resources/content-api/integrations.html', + collapsable: true, + sidebarDepth: 1, + children: [ + ['/developer-docs/latest/developer-resources/content-api/integrations/react', 'React'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/vue-js', + 'Vue.js', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/angular', + 'Angular', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/next-js', + 'Next.js', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/nuxt-js', + 'Nuxt.js', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/graphql', + 'GraphQL', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/gatsby', + 'Gatsby', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/gridsome', + 'Gridsome', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/jekyll', + 'Jekyll', + ], + ['/developer-docs/latest/developer-resources/content-api/integrations/11ty', '11ty'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/svelte', + 'Svelte', + ], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/sapper', + 'Sapper', + ], + ['/developer-docs/latest/developer-resources/content-api/integrations/ruby', 'Ruby'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/python', + 'Python', + ], + ['/developer-docs/latest/developer-resources/content-api/integrations/dart', 'Dart'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/flutter', + 'Flutter', + ], + ['/developer-docs/latest/developer-resources/content-api/integrations/go', 'Go'], + ['/developer-docs/latest/developer-resources/content-api/integrations/php', 'PHP'], + [ + '/developer-docs/latest/developer-resources/content-api/integrations/laravel', + 'Laravel', + ], + ], + }, + ], + }, + { + title: '🧩 Strapi plugins', + path: '/developer-docs/latest/plugins/plugins-intro.html', + collapsable: false, + children: [ + ['/developer-docs/latest/plugins/graphql', 'GraphQL'], + ['/developer-docs/latest/plugins/i18n', 'Internationalization (i18n)'], + ['/developer-docs/latest/plugins/users-permissions', 'Users & Permissions'], + ['/developer-docs/latest/plugins/email', 'Email'], + ['/developer-docs/latest/plugins/upload', 'Upload'], + ['/developer-docs/latest/plugins/documentation', 'API Documentation'], + ], + sidebarDepth: 1, + }, + { + title: '♻️ Update & Migration', + collapsable: false, + children: [ + ['/developer-docs/latest/update-migration-guides/update-version.md', 'Update'], + ['/developer-docs/latest/update-migration-guides/migration-guides.md', 'Migration'], + ], + }, + { + title: '📚 Guides', + collapsable: true, + children: [ + ['/developer-docs/latest/guides/auth-request', 'Authenticated request'], + // ['/developer-docs/latest/guides/slug', 'Create a slug system'], + // ['/developer-docs/latest/guides/is-owner', 'Create is owner policy'], + // ['/developer-docs/latest/guides/custom-admin', 'Custom admin'], + // ['/developer-docs/latest/guides/custom-data-response', 'Custom data response'], + ['/developer-docs/latest/guides/draft', 'Draft system'], + // ['/developer-docs/latest/guides/error-catching', 'Error catching'], + // ['/developer-docs/latest/guides/external-data', 'Fetching external data'], + ['/developer-docs/latest/guides/jwt-validation', 'JWT validation'], + ['/developer-docs/latest/guides/process-manager', 'Process manager'], + ['/developer-docs/latest/guides/scheduled-publication', 'Scheduled publication'], + // ['/developer-docs/latest/guides/secure-your-app', 'Secure your application'], + // ['/developer-docs/latest/guides/send-email', 'Send email programmatically'], + // [ + // '/developer-docs/latest/guides/registering-a-field-in-admin', + // 'Registering a new field in the admin panel', + // ], + // ['/developer-docs/latest/guides/client', 'Setup a third party client'], + ['/developer-docs/latest/guides/unit-testing', 'Unit testing'], + ], + }, +]; \ No newline at end of file diff --git a/docs/.vuepress/config/sidebar-user.js b/docs/.vuepress/config/sidebar-user.js new file mode 100644 index 0000000000..bef5421bdb --- /dev/null +++ b/docs/.vuepress/config/sidebar-user.js @@ -0,0 +1,104 @@ +const user = [ + { + collapsable: false, + title: '', + children: [ + ['/user-docs/latest/getting-started/introduction', 'Welcome to the Strapi user guide!'], + ], + }, + { + collapsable: false, + title: 'Content Manager', + children: [ + [ + '/user-docs/latest/content-manager/introduction-to-content-manager', + 'Introduction to the Content Manager', + ], + [ + '/user-docs/latest/content-manager/configuring-view-of-content-type', + 'Configuring the views of a content type', + ], + ['/user-docs/latest/content-manager/writing-content', 'Writing content'], + [ + '/user-docs/latest/content-manager/managing-relational-fields', + 'Managing relational fields', + ], + ['/user-docs/latest/content-manager/translating-content', 'Translating content'], + [ + '/user-docs/latest/content-manager/saving-and-publishing-content', + 'Saving, publishing and deleting content', + ], + ], + }, + { + collapsable: false, + title: 'Content-Type Builder', + children: [ + [ + '/user-docs/latest/content-types-builder/introduction-to-content-types-builder', + 'Introduction to the Content-Type Builder', + ], + [ + '/user-docs/latest/content-types-builder/creating-new-content-type', + 'Creating content types', + ], + [ + '/user-docs/latest/content-types-builder/managing-content-types', + 'Managing content types', + ], + [ + '/user-docs/latest/content-types-builder/configuring-fields-content-type', + 'Configuring fields for content types', + ], + ], + }, + { + collapsable: false, + title: 'Users, Roles & Permissions', + children: [ + [ + '/user-docs/latest/users-roles-permissions/introduction-to-users-roles-permissions', + 'Introduction to users, roles & permissions', + ], + [ + '/user-docs/latest/users-roles-permissions/configuring-administrator-roles', + 'Configuring administrator roles', + ], + [ + '/user-docs/latest/users-roles-permissions/managing-administrators', + 'Managing administrator accounts', + ], + [ + '/user-docs/latest/users-roles-permissions/configuring-end-users-roles', + 'Configuring end-users roles', + ], + [ + '/user-docs/latest/users-roles-permissions/managing-end-users', + 'Managing end-users accounts', + ], + ], + }, + { + collapsable: false, + title: 'Plugins', + children: [ + ['/user-docs/latest/plugins/introduction-to-plugins', 'Introduction to plugins'], + [ + '/user-docs/latest/plugins/installing-plugins-via-marketplace', + 'Installing plugins via the Marketplace', + ], + ['/user-docs/latest/plugins/strapi-plugins', 'List of Strapi plugins'], + ], + }, + { + collapsable: false, + title: 'General settings', + children: [ + ['/user-docs/latest/settings/managing-global-settings', 'Managing global settings'], + [ + '/user-docs/latest/settings/configuring-users-permissions-plugin-settings', + 'Configuring Users & Permissions plugin settings', + ], + ], + }, +]; \ No newline at end of file diff --git a/docs/.vuepress/config/sidebar.js b/docs/.vuepress/config/sidebar.js deleted file mode 100644 index 2aad810209..0000000000 --- a/docs/.vuepress/config/sidebar.js +++ /dev/null @@ -1,538 +0,0 @@ -const sidebar = { - developer: [ - { - title: '🚀 Getting Started', - collapsable: false, - children: [ - ['/developer-docs/latest/getting-started/introduction', 'Introduction'], - ['/developer-docs/latest/getting-started/quick-start', 'Quick Start Guide'], - ['/developer-docs/latest/getting-started/troubleshooting', 'Frequently Asked Questions'], - ['/developer-docs/latest/getting-started/usage-information', 'Usage Information'], - ], - }, - { - title: '⚙️ Setup & Deployment', - collapsable: false, - sidebarDepth: 0, - initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default - children: [ - { - title: 'Installation', - path: '/developer-docs/latest/setup-deployment-guides/installation.html', - collapsable: true, - sidebarDepth: 1, - children: [ - ['/developer-docs/latest/setup-deployment-guides/installation/cli.md', 'CLI'], - ['/developer-docs/latest/setup-deployment-guides/installation/docker.md', 'Docker'], - [ - '/developer-docs/latest/setup-deployment-guides/installation/digitalocean-one-click.md', - 'DigitalOcean One-Click', - ], - [ - '/developer-docs/latest/setup-deployment-guides/installation/platformsh.md', - 'Platform.sh One-Click', - ], - [ - '/developer-docs/latest/setup-deployment-guides/installation/render.md', - 'Render One-Click', - ], - ], - }, - ['/developer-docs/latest/setup-deployment-guides/file-structure.md', 'Project structure'], - { - title: 'Configurations', - path: '/developer-docs/latest/setup-deployment-guides/configurations.html', - collapsable: true, - children: [ - { - title: 'Required configurations', - collapsable: true, - children: [ - [ - '/developer-docs/latest/setup-deployment-guides/configurations/required/databases.md', - 'Database', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/required/server.md', - 'Server', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/required/admin-panel.md', - 'Admin panel', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/required/middlewares.md', - 'Middlewares', - ], - ], - }, - { - title: 'Optional configurations', - collapsable: true, - children: [ - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/api-tokens.md', - 'API tokens', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/functions.md', - 'Functions', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/cronjobs.md', - 'Cron jobs', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/api.md', - 'API', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/plugins.md', - 'Plugins', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.md', - 'Environment', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/public-assets.md', - 'Public Assets', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/sso.md', - 'Single Sign On (SSO)', - ], - [ - '/developer-docs/latest/setup-deployment-guides/configurations/optional/rbac.md', - 'Role-Based Access Control (RBAC)', - ], - ], - }, - ], - }, - { - title: 'Deployment', - path: '/developer-docs/latest/setup-deployment-guides/deployment', - collapsable: true, - initialOpenGroupIndex: -1, // make sure that no subgroup is open by default — if set to 0, 'Hosting Provider Guides' is expanded - children: [ - { - title: 'Hosting Provider Guides', - path: - '/developer-docs/latest/setup-deployment-guides/deployment.html#hosting-provider-guides', - collapsable: true, - children: [ - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/21yunbox.md', - '21YunBox', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/amazon-aws.md', - 'Amazon AWS', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/azure.md', - 'Azure', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean-app-platform.md', - 'DigitalOcean App Platform', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/digitalocean.md', - 'DigitalOcean Droplets', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/google-app-engine.md', - 'Google App Engine', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/heroku.md', - 'Heroku', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/qovery.md', - 'Qovery', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/hosting-guides/render.md', - 'Render', - ], - ], - sidebarDepth: 2, - }, - { - title: 'Optional Software Guides', - path: - '/developer-docs/latest/setup-deployment-guides/deployment.html#optional-software-guides', - collapsable: true, - children: [ - [ - '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/caddy-proxy.md', - 'Caddy', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/haproxy-proxy.md', - 'HAProxy', - ], - [ - '/developer-docs/latest/setup-deployment-guides/deployment/optional-software/nginx-proxy.md', - 'Nginx', - ], - ], - sidebarDepth: 2, - }, - ], - sidebarDepth: 0, - }, - ], - }, - { - title: '🔧 Development', - collapsable: false, - initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default - children: [ - { - title: 'Back-end customization', - collapsable: true, - path: '/developer-docs/latest/development/backend-customization', - children: [ - ['/developer-docs/latest/development/backend-customization/routes.md', 'Routes'], - ['/developer-docs/latest/development/backend-customization/policies.md', 'Policies'], - [ - '/developer-docs/latest/development/backend-customization/middlewares.md', - 'Middlewares', - ], - [ - '/developer-docs/latest/development/backend-customization/controllers.md', - 'Controllers', - ], - [ - '/developer-docs/latest/development/backend-customization/requests-responses.md', - 'Requests & Responses', - ], - ['/developer-docs/latest/development/backend-customization/services.md', 'Services'], - ['/developer-docs/latest/development/backend-customization/models.md', 'Models'], - ['/developer-docs/latest/development/backend-customization/webhooks.md', 'Webhooks'], - ], - }, - ['/developer-docs/latest/development/admin-customization', 'Admin panel customization'], - ['/developer-docs/latest/development/plugins-extension.md', 'Plugins extension'], - ['/developer-docs/latest/development/plugins-development.md', 'Plugins development'], - ], - }, - { - title: '💻 Developer Resources', - collapsable: false, - initialOpenGroupIndex: -1, // make sure that no subgroup is expanded by default - sidebarDepth: 2, - children: [ - { - title: 'APIs Reference', - collapsable: true, - sidebarDepth: 1, - children: [ - [ - '/developer-docs/latest/developer-resources/database-apis-reference/rest-api.md', - 'REST API', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/graphql-api.md', - 'GraphQL API', - ], - { - title: 'Query Engine API', - path: - '/developer-docs/latest/developer-resources/database-apis-reference/query-engine-api.html', - collapsable: true, - // sidebarDepth: 3, - children: [ - [ - '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/single-operations.md', - 'Single Operations', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/bulk-operations.md', - 'Bulk Operations', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/filtering.md', - 'Filtering', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/populating.md', - 'Populating', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/query-engine/order-pagination.md', - 'Ordering & pagination', - ], - ], - }, - { - title: 'Entity Service API', - path: - '/developer-docs/latest/developer-resources/database-apis-reference/entity-service-api', - collapsable: true, - children: [ - [ - '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/crud.md', - 'CRUD operations', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/filter.md', - 'Filters', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/populate.md', - 'Populate', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/order-pagination.md', - 'Ordering & pagination', - ], - [ - '/developer-docs/latest/developer-resources/database-apis-reference/entity-service/components-dynamic-zones.md', - 'Components and dynamic zones', - ], - ], - }, - { - title: 'Plugin APIs Reference', - collapsable: true, - children: [ - [ - '/developer-docs/latest/developer-resources/plugin-api-reference/server.md', - 'Server API for plugins', - ], - [ - '/developer-docs/latest/developer-resources/plugin-api-reference/admin-panel.md', - 'Admin Panel API for plugins', - ], - ], - }, - ], - }, - ['/developer-docs/latest/developer-resources/cli/CLI', 'Command Line Interface'], - ['/developer-docs/latest/developer-resources/error-handling.md', 'Error handling'], - { - title: 'Integrations', - path: '/developer-docs/latest/developer-resources/content-api/integrations.html', - collapsable: true, - sidebarDepth: 1, - children: [ - ['/developer-docs/latest/developer-resources/content-api/integrations/react', 'React'], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/vue-js', - 'Vue.js', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/angular', - 'Angular', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/next-js', - 'Next.js', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/nuxt-js', - 'Nuxt.js', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/graphql', - 'GraphQL', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/gatsby', - 'Gatsby', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/gridsome', - 'Gridsome', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/jekyll', - 'Jekyll', - ], - ['/developer-docs/latest/developer-resources/content-api/integrations/11ty', '11ty'], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/svelte', - 'Svelte', - ], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/sapper', - 'Sapper', - ], - ['/developer-docs/latest/developer-resources/content-api/integrations/ruby', 'Ruby'], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/python', - 'Python', - ], - ['/developer-docs/latest/developer-resources/content-api/integrations/dart', 'Dart'], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/flutter', - 'Flutter', - ], - ['/developer-docs/latest/developer-resources/content-api/integrations/go', 'Go'], - ['/developer-docs/latest/developer-resources/content-api/integrations/php', 'PHP'], - [ - '/developer-docs/latest/developer-resources/content-api/integrations/laravel', - 'Laravel', - ], - ], - }, - ], - }, - { - title: '🧩 Strapi plugins', - path: '/developer-docs/latest/plugins/plugins-intro.html', - collapsable: false, - children: [ - ['/developer-docs/latest/plugins/graphql', 'GraphQL'], - ['/developer-docs/latest/plugins/i18n', 'Internationalization (i18n)'], - ['/developer-docs/latest/plugins/users-permissions', 'Users & Permissions'], - ['/developer-docs/latest/plugins/email', 'Email'], - ['/developer-docs/latest/plugins/upload', 'Upload'], - ['/developer-docs/latest/plugins/documentation', 'API Documentation'], - ], - sidebarDepth: 1, - }, - { - title: '♻️ Update & Migration', - collapsable: false, - children: [ - ['/developer-docs/latest/update-migration-guides/update-version.md', 'Update'], - ['/developer-docs/latest/update-migration-guides/migration-guides.md', 'Migration'], - ], - }, - { - title: '📚 Guides', - collapsable: true, - children: [ - ['/developer-docs/latest/guides/auth-request', 'Authenticated request'], - // ['/developer-docs/latest/guides/slug', 'Create a slug system'], - // ['/developer-docs/latest/guides/is-owner', 'Create is owner policy'], - // ['/developer-docs/latest/guides/custom-admin', 'Custom admin'], - // ['/developer-docs/latest/guides/custom-data-response', 'Custom data response'], - ['/developer-docs/latest/guides/draft', 'Draft system'], - // ['/developer-docs/latest/guides/error-catching', 'Error catching'], - // ['/developer-docs/latest/guides/external-data', 'Fetching external data'], - ['/developer-docs/latest/guides/jwt-validation', 'JWT validation'], - ['/developer-docs/latest/guides/process-manager', 'Process manager'], - ['/developer-docs/latest/guides/scheduled-publication', 'Scheduled publication'], - // ['/developer-docs/latest/guides/secure-your-app', 'Secure your application'], - // ['/developer-docs/latest/guides/send-email', 'Send email programmatically'], - // [ - // '/developer-docs/latest/guides/registering-a-field-in-admin', - // 'Registering a new field in the admin panel', - // ], - // ['/developer-docs/latest/guides/client', 'Setup a third party client'], - ['/developer-docs/latest/guides/unit-testing', 'Unit testing'], - ], - }, - ], - user: [ - { - collapsable: false, - title: '', - children: [ - ['/user-docs/latest/getting-started/introduction', 'Welcome to the Strapi user guide!'], - ], - }, - { - collapsable: false, - title: 'Content Manager', - children: [ - [ - '/user-docs/latest/content-manager/introduction-to-content-manager', - 'Introduction to the Content Manager', - ], - [ - '/user-docs/latest/content-manager/configuring-view-of-content-type', - 'Configuring the views of a content type', - ], - ['/user-docs/latest/content-manager/writing-content', 'Writing content'], - [ - '/user-docs/latest/content-manager/managing-relational-fields', - 'Managing relational fields', - ], - ['/user-docs/latest/content-manager/translating-content', 'Translating content'], - [ - '/user-docs/latest/content-manager/saving-and-publishing-content', - 'Saving, publishing and deleting content', - ], - ], - }, - { - collapsable: false, - title: 'Content-Type Builder', - children: [ - [ - '/user-docs/latest/content-types-builder/introduction-to-content-types-builder', - 'Introduction to the Content-Type Builder', - ], - [ - '/user-docs/latest/content-types-builder/creating-new-content-type', - 'Creating content types', - ], - [ - '/user-docs/latest/content-types-builder/managing-content-types', - 'Managing content types', - ], - [ - '/user-docs/latest/content-types-builder/configuring-fields-content-type', - 'Configuring fields for content types', - ], - ], - }, - { - collapsable: false, - title: 'Users, Roles & Permissions', - children: [ - [ - '/user-docs/latest/users-roles-permissions/introduction-to-users-roles-permissions', - 'Introduction to users, roles & permissions', - ], - [ - '/user-docs/latest/users-roles-permissions/configuring-administrator-roles', - 'Configuring administrator roles', - ], - [ - '/user-docs/latest/users-roles-permissions/managing-administrators', - 'Managing administrator accounts', - ], - [ - '/user-docs/latest/users-roles-permissions/configuring-end-users-roles', - 'Configuring end-users roles', - ], - [ - '/user-docs/latest/users-roles-permissions/managing-end-users', - 'Managing end-users accounts', - ], - ], - }, - { - collapsable: false, - title: 'Plugins', - children: [ - ['/user-docs/latest/plugins/introduction-to-plugins', 'Introduction to plugins'], - [ - '/user-docs/latest/plugins/installing-plugins-via-marketplace', - 'Installing plugins via the Marketplace', - ], - ['/user-docs/latest/plugins/strapi-plugins', 'List of Strapi plugins'], - ], - }, - { - collapsable: false, - title: 'General settings', - children: [ - ['/user-docs/latest/settings/managing-global-settings', 'Managing global settings'], - [ - '/user-docs/latest/settings/configuring-users-permissions-plugin-settings', - 'Configuring Users & Permissions plugin settings', - ], - ], - }, - ], -}; diff --git a/docs/scripts/create-developer-docs-config-file.js b/docs/scripts/create-developer-docs-config-file.js index ca42fb5946..f6eaa9e2a5 100644 --- a/docs/scripts/create-developer-docs-config-file.js +++ b/docs/scripts/create-developer-docs-config-file.js @@ -5,7 +5,7 @@ const fs = require('fs-extra'); const createConfigFile = async () => { const dest = path.resolve(__dirname, '..', '.vuepress', 'config'); - const sidebar = await fs.readFile(path.resolve(dest, 'sidebar.js')); + const developerSidebar = await fs.readFile(path.resolve(dest, 'sidebar-developer.js')); const plugins = await fs.readFile(path.resolve(dest, 'plugins.js')); const metas = await fs.readFile(path.resolve(dest, 'metas.js')); const themeConfig = await fs.readFile(path.resolve(dest, 'theme-config.js')); @@ -13,7 +13,11 @@ const createConfigFile = async () => { const patterns = await fs.readFile(path.resolve(dest, 'patterns-developer.js')); const content = ` -${sidebar.toString()} +${developerSidebar.toString()} + +const sidebar = { + developer, +}; ${plugins.toString()} diff --git a/docs/scripts/create-main-config-file.js b/docs/scripts/create-main-config-file.js index 589e767ef3..189d38852d 100644 --- a/docs/scripts/create-main-config-file.js +++ b/docs/scripts/create-main-config-file.js @@ -5,14 +5,22 @@ const fs = require('fs-extra'); const createConfigFile = async () => { const dest = path.resolve(__dirname, '..', '.vuepress', 'config'); - const sidebar = await fs.readFile(path.resolve(dest, 'sidebar.js')); const plugins = await fs.readFile(path.resolve(dest, 'plugins.js')); const metas = await fs.readFile(path.resolve(dest, 'metas.js')); const themeConfig = await fs.readFile(path.resolve(dest, 'theme-config.js')); const markdown = await fs.readFile(path.resolve(dest, 'markdown.js')); + const developerSidebar = await fs.readFile(path.resolve(dest, 'sidebar-developer.js')); + const userSidebar = await fs.readFile(path.resolve(dest, 'sidebar-user.js')); const content = ` -${sidebar.toString()} +${developerSidebar.toString()} + +${userSidebar.toString()} + +const sidebar = { + developer, + user, +}; ${plugins.toString()} @@ -22,6 +30,8 @@ ${themeConfig.toString()} ${markdown.toString()} + + module.exports = { ...metas, themeConfig, diff --git a/docs/scripts/create-user-docs-config-file.js b/docs/scripts/create-user-docs-config-file.js index c84d9e0e87..47b96b17b8 100644 --- a/docs/scripts/create-user-docs-config-file.js +++ b/docs/scripts/create-user-docs-config-file.js @@ -5,7 +5,7 @@ const fs = require('fs-extra'); const createConfigFile = async () => { const dest = path.resolve(__dirname, '..', '.vuepress', 'config'); - const sidebar = await fs.readFile(path.resolve(dest, 'sidebar.js')); + const userSidebar = await fs.readFile(path.resolve(dest, 'sidebar-user.js')); const plugins = await fs.readFile(path.resolve(dest, 'plugins.js')); const metas = await fs.readFile(path.resolve(dest, 'metas.js')); const themeConfig = await fs.readFile(path.resolve(dest, 'theme-config.js')); @@ -13,7 +13,11 @@ const createConfigFile = async () => { const patterns = await fs.readFile(path.resolve(dest, 'patterns-user.js')); const content = ` -${sidebar.toString()} +${userSidebar.toString()} + +const sidebar = { + user, +}; ${plugins.toString()} From 6ab77194f2b60e6fce5a6104cec2217b6d3b8bdb Mon Sep 17 00:00:00 2001 From: derrickmehaffy Date: Thu, 9 Dec 2021 20:16:57 -0700 Subject: [PATCH 9/9] cleanup extra space --- docs/.vuepress/config/metas.js | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/.vuepress/config/metas.js b/docs/.vuepress/config/metas.js index 45f68a0415..67894cf874 100644 --- a/docs/.vuepress/config/metas.js +++ b/docs/.vuepress/config/metas.js @@ -53,7 +53,6 @@ const metas = { content: 'strapi', }, ], - [ 'meta', {