From f5780683ce7f08f9a888b20dd7f67ce398238179 Mon Sep 17 00:00:00 2001 From: Pierre Burgy Date: Sun, 28 Oct 2018 08:15:31 +0100 Subject: [PATCH] Improve documentation --- docs/.vuepress/config.js | 96 ++++--- docs/.vuepress/theme/Layout.vue | 9 +- docs/.vuepress/theme/NavLinks.vue | 28 +- docs/.vuepress/theme/Navbar.vue | 15 ++ docs/.vuepress/theme/SearchBox.vue | 4 +- docs/.vuepress/theme/SidebarGroup.vue | 2 +- docs/.vuepress/theme/SidebarLink.vue | 17 +- docs/.vuepress/theme/styles/config.styl | 2 +- docs/.vuepress/theme/styles/theme.styl | 3 +- .../assets/getting-started_add_entry-.png | Bin 0 -> 266458 bytes .../assets/getting-started_add_entry.png | Bin 125813 -> 615497 bytes .../assets/getting-started_allow_access.png | Bin 294849 -> 66880 bytes .../getting-started_create_content_type.png | Bin 148411 -> 104770 bytes .../assets/getting-started_list_fields.png | Bin 138253 -> 78833 bytes .../getting-started_manage_role_home.png | Bin 122683 -> 473269 bytes .../getting-started_no_content_type.png | Bin 130776 -> 451064 bytes .../3.x.x/assets/getting-started_no_entry.png | Bin 124676 -> 441996 bytes .../assets/getting-started_no_entry_.png | Bin 0 -> 445489 bytes .../assets/getting-started_with_entry.png | Bin 133700 -> 465647 bytes .../assets/getting-started_with_entry_.png | Bin 0 -> 133700 bytes docs/3.x.x/assets/terminal_new.png | Bin 149517 -> 107495 bytes docs/3.x.x/assets/terminal_start.png | Bin 260253 -> 65636 bytes docs/3.x.x/getting-started/installation.md | 17 +- docs/3.x.x/getting-started/quick-start.md | 243 ++++++++++-------- docs/3.x.x/guides/authentication.md | 154 ++++++----- docs/3.x.x/tutorials/README.md | 4 +- docs/README.md | 2 +- packages/strapi-generate-new/lib/index.js | 2 +- .../lib/internals/prettier/index.js | 2 +- 29 files changed, 360 insertions(+), 240 deletions(-) create mode 100644 docs/3.x.x/assets/getting-started_add_entry-.png create mode 100644 docs/3.x.x/assets/getting-started_no_entry_.png create mode 100644 docs/3.x.x/assets/getting-started_with_entry_.png diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 440f241fb3..22c6590950 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -1,12 +1,11 @@ const container = require('markdown-it-container') -let ogprefix = 'og: http://ogp.me/ns#' -let title = 'Strapi Documentation' -let description = 'API creation made simple, secure and fast.' -let color = '#2F80ED' -let author = 'Strapi' -let url = 'https://strapi.io/documentation/' - +const ogprefix = 'og: http://ogp.me/ns#' +const title = 'Strapi Documentation' +const description = 'API creation made simple, secure and fast.' +const color = '#2F80ED' +const author = 'Strapi' +const url = 'https://strapi.io/documentation/' module.exports = { head: [ @@ -47,15 +46,20 @@ module.exports = { ['Version 1.x.x', '/1.x.x/'], ], repo: 'strapi/strapi', + website: 'https://strapi.io', docsDir: 'docs', editLinks: true, editLinkText: 'Improve this page', serviceWorker: true, + hiddenLinks: [ + '/3.x.x/cli/CLI.html', + '/3.x.x/api-reference/reference.html', + ], sidebar: { '/3.x.x/': [ { collapsable: false, - title: 'Getting started', + title: 'πŸš€ Getting started', children: [ '/3.x.x/getting-started/installation', '/3.x.x/getting-started/quick-start', @@ -63,39 +67,30 @@ module.exports = { ], }, { - collapsable: false, - title: 'Guides', + collapsable: true, + title: 'πŸ’‘ Guides', children: [ - '/3.x.x/guides/authentication.md', - '/3.x.x/configurations/configurations.md', - '/3.x.x/guides/controllers.md', - '/3.x.x/guides/deployment.md', - '/3.x.x/guides/email.md', - '/3.x.x/guides/upload.md', - '/3.x.x/guides/filters.md', - '/3.x.x/guides/graphql.md', - '/3.x.x/guides/i18n.md', - '/3.x.x/guides/models.md', - '/3.x.x/guides/policies.md', - '/3.x.x/guides/public-assets.md', - '/3.x.x/guides/requests.md', - '/3.x.x/guides/responses.md', - '/3.x.x/guides/routing.md', - '/3.x.x/guides/services.md', - ], - }, - { - collapsable: false, - title: 'Globals', - children: [ - '/3.x.x/api-reference/reference', - '/3.x.x/cli/CLI', + '/3.x.x/guides/authentication', '/3.x.x/configurations/configurations', + '/3.x.x/guides/controllers', + '/3.x.x/guides/deployment', + '/3.x.x/guides/email', + '/3.x.x/guides/upload', + '/3.x.x/guides/filters', + '/3.x.x/guides/graphql', + '/3.x.x/guides/i18n', + '/3.x.x/guides/models', + '/3.x.x/guides/policies', + '/3.x.x/guides/public-assets', + '/3.x.x/guides/requests', + '/3.x.x/guides/responses', + '/3.x.x/guides/routing', + '/3.x.x/guides/services', ], }, { - collapsable: false, - title: 'Advanced', + collapsable: true, + title: 'βš™οΈοΈ Advanced', children: [ '/3.x.x/advanced/customize-admin', '/3.x.x/advanced/hooks', @@ -104,9 +99,36 @@ module.exports = { '/3.x.x/advanced/usage-tracking', ], }, + { + collapsable: true, + title: 'πŸ”Œ Plugin Development', + children: [ + '/3.x.x/plugin-development/quick-start', + '/3.x.x/plugin-development/plugin-architecture', + '/3.x.x/plugin-development/backend-development', + '/3.x.x/plugin-development/frontend-development', + '/3.x.x/plugin-development/frontend-use-cases', + '/3.x.x/plugin-development/utils', + // '/3.x.x/plugin-development/ui-components', TODO: Add this file + ], + }, + { + collapsable: true, + title: 'πŸ’» Command Line Interface', + children: [ + '/3.x.x/cli/CLI', + ], + }, + { + collapsable: true, + title: 'πŸ— API Reference', + children: [ + '/3.x.x/api-reference/reference', + ], + }, { collapsable: false, - title: 'Resources', + title: 'πŸ“š Resources', children: [ ['https://github.com/strapi/strapi/blob/master/CONTRIBUTING.md', 'Contributing guide'], ['https://github.com/strapi/strapi/wiki', 'Migration guides'], diff --git a/docs/.vuepress/theme/Layout.vue b/docs/.vuepress/theme/Layout.vue index f15c97bb11..b3797fd98a 100644 --- a/docs/.vuepress/theme/Layout.vue +++ b/docs/.vuepress/theme/Layout.vue @@ -5,14 +5,7 @@ @touchend="onTouchEnd"> - -
- -
- -
+
diff --git a/docs/.vuepress/theme/NavLinks.vue b/docs/.vuepress/theme/NavLinks.vue index f29ee0acd5..38dcfd773f 100644 --- a/docs/.vuepress/theme/NavLinks.vue +++ b/docs/.vuepress/theme/NavLinks.vue @@ -9,11 +9,19 @@ - + Website + + + {{ repoLabel }} @@ -92,6 +100,22 @@ export default { } return 'Source' + }, + websiteLink () { + const { website } = this.$site.themeConfig + if (website) { + return /^https?:/.test(website) + ? website + : `https://${website}` + } + }, + slackLink () { + const { slack } = this.$site.themeConfig + if (slack) { + return /^https?:/.test(slack) + ? slack + : `https://${slack}` + } } } } diff --git a/docs/.vuepress/theme/Navbar.vue b/docs/.vuepress/theme/Navbar.vue index f4a9002a37..1e8fa90e13 100644 --- a/docs/.vuepress/theme/Navbar.vue +++ b/docs/.vuepress/theme/Navbar.vue @@ -11,6 +11,9 @@ {{ $siteTitle }} +