From e93c94f1ce707719dfb7750af82b17c38b461831 Mon Sep 17 00:00:00 2001 From: Martin Jagodic Date: Tue, 6 Feb 2024 13:18:01 +0100 Subject: [PATCH] refactor: remove website (move to seperate repository) (#7087) * refactor: remove website (move to seperate repository) * fix: eslint config * fix: css list command --- .all-contributorsrc | 1083 -- .eslintrc.js | 6 - .gitignore | 1 - CONTRIBUTING.md | 2 +- netlify.toml | 1 - package.json | 8 +- packages/decap-cms-app/README.md | 6 - website/.babelrc | 14 - website/.gitignore | 3 - website/.markdownlint.json | 4 - website/.nvmrc | 1 - website/README.md | 19 - website/content/.keep | 0 website/content/blog/decap-3-1-0-beta-0.md | 15 - website/content/blog/decap-3-1.md | 27 - website/content/blog/decap-3.md | 45 - ...-cms-definition-features-best-practices.md | 62 - website/content/blog/github-discussions.md | 16 - website/content/blog/introducing-decap.md | 21 - .../content/blog/march-23-status-update.md | 20 - website/content/blog/moving-to-discord.md | 19 - .../blog/software-reviews-gold-medal-2023.md | 21 - website/content/docs/access-your-content.md | 18 - website/content/docs/architecture.md | 78 - website/content/docs/azure-backend.md | 32 - website/content/docs/backends-overview.md | 25 - website/content/docs/basic-steps.md | 40 - website/content/docs/bitbucket-backend.md | 35 - website/content/docs/choosing-a-backend.md | 58 - website/content/docs/cloudinary.md | 136 - website/content/docs/collection-file.md | 48 - website/content/docs/collection-folder.md | 152 - website/content/docs/collection-nested.md | 50 - website/content/docs/configuration-options.md | 486 - website/content/docs/configure-decap-cms.md | 149 - website/content/docs/contributor-guide.md | 35 - website/content/docs/custom-formatters.md | 29 - website/content/docs/custom-mounting.md | 17 - website/content/docs/custom-widgets.md | 563 - website/content/docs/customization.md | 199 - website/content/docs/deploy-preview-links.md | 149 - website/content/docs/docusaurus.md | 256 - .../content/docs/dynamic-default-values.md | 38 - website/content/docs/editorial-workflows.md | 48 - website/content/docs/examples.md | 35 - .../content/docs/external-oauth-clients.md | 26 - website/content/docs/gatsby.md | 138 - website/content/docs/git-gateway-backend.md | 31 - website/content/docs/gitea-backend.md | 31 - website/content/docs/github-backend.md | 59 - website/content/docs/gitlab-backend.md | 115 - website/content/docs/gridsome.md | 159 - website/content/docs/hugo.md | 246 - website/content/docs/i18n.md | 127 - website/content/docs/install-decap-cms.md | 87 - website/content/docs/intro.md | 38 - website/content/docs/jekyll.md | 299 - website/content/docs/manual-initialization.md | 69 - website/content/docs/middleman.md | 180 - website/content/docs/netlify-large-media.md | 41 - website/content/docs/nextjs.md | 234 - website/content/docs/nuxt.md | 287 - website/content/docs/open-authoring.md | 78 - website/content/docs/registering-events.md | 27 - website/content/docs/releases.md | 27 - website/content/docs/start-with-a-template.md | 92 - website/content/docs/summary-strings.md | 24 - website/content/docs/test-backend.md | 16 - website/content/docs/uploadcare.md | 78 - website/content/docs/variable-type-widgets.md | 83 - website/content/docs/widgets.md | 28 - website/content/docs/widgets/boolean.md | 16 - website/content/docs/widgets/code.md | 22 - website/content/docs/widgets/color.md | 22 - website/content/docs/widgets/datetime.md | 27 - website/content/docs/widgets/file.md | 43 - website/content/docs/widgets/hidden.md | 16 - website/content/docs/widgets/image.md | 43 - website/content/docs/widgets/list.md | 128 - website/content/docs/widgets/map.md | 19 - website/content/docs/widgets/markdown.md | 44 - website/content/docs/widgets/number.md | 27 - website/content/docs/widgets/object.md | 39 - website/content/docs/widgets/relation.md | 63 - website/content/docs/widgets/select.md | 79 - website/content/docs/widgets/string.md | 16 - website/content/docs/widgets/text.md | 16 - .../working-with-a-local-git-repository.md | 46 - website/content/docs/writing-style-guide.md | 293 - website/content/pages/community.md | 30 - website/content/pages/services.md | 44 - website/data/.keep | 0 website/data/docs.yml | 11 - website/data/global.yaml | 4 - website/data/landing.yaml | 72 - website/data/notifications.yml | 40 - website/data/updates.yml | 296 - website/gatsby-browser.js | 9 - website/gatsby-config.js | 82 - website/gatsby-node.js | 113 - website/netlify.toml | 8 - website/package.json | 57 - website/site.yml | 24 - website/src/cms/cms.js | 140 - website/src/components/awards.js | 22 - website/src/components/blog-post-template.js | 27 - website/src/components/button.js | 44 - website/src/components/chat-button.js | 41 - .../src/components/community-channels-list.js | 59 - website/src/components/community.js | 47 - website/src/components/container.js | 32 - website/src/components/docs-nav.js | 101 - website/src/components/docs-template.js | 42 - website/src/components/docsearch.js | 57 - website/src/components/edit-link.js | 46 - website/src/components/event-box.js | 125 - website/src/components/features.js | 53 - website/src/components/footer.js | 101 - website/src/components/github-button.js | 32 - website/src/components/grid.js | 14 - website/src/components/header.js | 270 - website/src/components/hero-title.js | 16 - website/src/components/home-section.js | 37 - website/src/components/layout.js | 76 - website/src/components/lead.js | 10 - website/src/components/markdown.js | 134 - website/src/components/markdownify.js | 8 - website/src/components/meta-info.js | 10 - website/src/components/notification.js | 49 - website/src/components/notifications.js | 13 - website/src/components/page-hero.js | 28 - website/src/components/page.js | 16 - website/src/components/release.js | 67 - website/src/components/section-label.js | 23 - website/src/components/sidebar-layout.js | 30 - website/src/components/table-of-contents.js | 62 - website/src/components/twitter-meta.js | 17 - website/src/components/video-embed.js | 111 - website/src/components/whats-new.js | 29 - website/src/components/widget-doc.js | 18 - website/src/components/widgets.js | 81 - website/src/global-styles.js | 129 - website/src/html.js | 36 - website/src/img/bow.svg | 1 - website/src/img/collab.svg | 1 - website/src/img/demo.gif | Bin 2660854 -> 0 bytes website/src/img/feature-access.svg | 1 - website/src/img/feature-editor.svg | 1 - website/src/img/feature-workflow.svg | 1 - website/src/img/github.svg | 1 - website/src/img/heart.svg | 1 - website/src/img/helix.svg | 1 - website/src/img/play.svg | 3 - website/src/img/screenshot-content.png | Bin 45331 -> 0 bytes website/src/img/screenshot-editor.jpg | Bin 102256 -> 0 bytes website/src/img/screenshot-editor.png | Bin 371057 -> 0 bytes website/src/img/screenshot-editorial.png | Bin 105867 -> 0 bytes website/src/img/screenshot-identity.png | Bin 24105 -> 0 bytes website/src/img/search.svg | 1 - website/src/img/smashing-logo.svg | 1 - website/src/img/wavy-divider.svg | 1 - website/src/pages/blog.js | 74 - website/src/pages/community.js | 39 - website/src/pages/index.js | 314 - website/src/pages/services.js | 63 - website/src/templates/blog-post.js | 54 - website/src/templates/doc-page.js | 113 - website/src/theme.js | 39 - website/src/utils.js | 7 - website/static/.keep | 0 website/static/_redirects | 19 - website/static/admin/config.yml | 222 - website/static/img/11ty-logo.svg | 5 - .../static/img/cloudinary-console-details.png | Bin 168777 -> 0 bytes website/static/img/create-password.png | Bin 364991 -> 0 bytes website/static/img/decap-3.1.0-beta.0.png | Bin 544012 -> 0 bytes website/static/img/decap-3.png | Bin 541329 -> 0 bytes .../img/decap-cms-external-media-library.png | Bin 297010 -> 0 bytes website/static/img/decap-cms.png | Bin 29768 -> 0 bytes website/static/img/decap-logo.svg | 112 - .../definition-features-best-practices.png | Bin 532365 -> 0 bytes website/static/img/discord.svg | 1 - website/static/img/email-subject.png | Bin 5810 -> 0 bytes website/static/img/favicon/favicon-16x16.png | Bin 300 -> 0 bytes website/static/img/favicon/favicon-32x32.png | Bin 492 -> 0 bytes website/static/img/favicon/icon-512x512.png | Bin 492 -> 0 bytes website/static/img/gatsby.svg | 6 - .../img/github-statuses-deploy-previews.png | Bin 66691 -> 0 bytes website/static/img/hugo.svg | 1 - website/static/img/hugo_shortcode_gist.png | Bin 11232 -> 0 bytes website/static/img/metalsmith.svg | 7 - website/static/img/middleman.svg | 16 - website/static/img/nextjs.svg | 1 - website/static/img/nuxt.svg | 1 - website/static/img/og-image.jpg | Bin 141656 -> 0 bytes website/static/img/preact.svg | 8 - website/static/img/preview-link-check.png | Bin 20662 -> 0 bytes website/static/img/preview-link-published.png | Bin 13771 -> 0 bytes .../static/img/preview-link-unpublished.png | Bin 18278 -> 0 bytes website/static/img/pro-help.png | Bin 696344 -> 0 bytes .../screen shot 2018-01-05 at 4.25.07 pm.png | Bin 68747 -> 0 bytes .../screen-shot-2020-08-20-at-14.36.26.png | Bin 476236 -> 0 bytes .../screen-shot-2021-11-15-at-4.16.53-pm.png | Bin 63324 -> 0 bytes .../screen-shot-2021-11-16-at-1.34.18-PM.png | Bin 47530 -> 0 bytes website/static/img/screenshot-editor-2.png | Bin 201927 -> 0 bytes .../img/screenshot-jekyll-tutorial-blog.png | Bin 151201 -> 0 bytes website/static/img/sr-gold_medal-2023.png | Bin 253953 -> 0 bytes website/static/img/uc-logo-horizontal.svg | 6 - website/static/img/version-3.1.png | Bin 698898 -> 0 bytes website/static/img/vuepress.png | Bin 153793 -> 0 bytes website/static/img/widgets-markdown.PNG | Bin 18501 -> 0 bytes website/yarn.lock | 13866 ---------------- 212 files changed, 5 insertions(+), 25675 deletions(-) delete mode 100644 .all-contributorsrc delete mode 100644 website/.babelrc delete mode 100644 website/.gitignore delete mode 100644 website/.markdownlint.json delete mode 100644 website/.nvmrc delete mode 100755 website/README.md delete mode 100755 website/content/.keep delete mode 100644 website/content/blog/decap-3-1-0-beta-0.md delete mode 100644 website/content/blog/decap-3-1.md delete mode 100644 website/content/blog/decap-3.md delete mode 100644 website/content/blog/git-based-cms-definition-features-best-practices.md delete mode 100644 website/content/blog/github-discussions.md delete mode 100644 website/content/blog/introducing-decap.md delete mode 100644 website/content/blog/march-23-status-update.md delete mode 100644 website/content/blog/moving-to-discord.md delete mode 100644 website/content/blog/software-reviews-gold-medal-2023.md delete mode 100644 website/content/docs/access-your-content.md delete mode 100755 website/content/docs/architecture.md delete mode 100644 website/content/docs/azure-backend.md delete mode 100644 website/content/docs/backends-overview.md delete mode 100644 website/content/docs/basic-steps.md delete mode 100644 website/content/docs/bitbucket-backend.md delete mode 100644 website/content/docs/choosing-a-backend.md delete mode 100644 website/content/docs/cloudinary.md delete mode 100644 website/content/docs/collection-file.md delete mode 100644 website/content/docs/collection-folder.md delete mode 100644 website/content/docs/collection-nested.md delete mode 100644 website/content/docs/configuration-options.md delete mode 100644 website/content/docs/configure-decap-cms.md delete mode 100644 website/content/docs/contributor-guide.md delete mode 100644 website/content/docs/custom-formatters.md delete mode 100644 website/content/docs/custom-mounting.md delete mode 100644 website/content/docs/custom-widgets.md delete mode 100644 website/content/docs/customization.md delete mode 100644 website/content/docs/deploy-preview-links.md delete mode 100644 website/content/docs/docusaurus.md delete mode 100644 website/content/docs/dynamic-default-values.md delete mode 100644 website/content/docs/editorial-workflows.md delete mode 100644 website/content/docs/examples.md delete mode 100644 website/content/docs/external-oauth-clients.md delete mode 100644 website/content/docs/gatsby.md delete mode 100644 website/content/docs/git-gateway-backend.md delete mode 100644 website/content/docs/gitea-backend.md delete mode 100644 website/content/docs/github-backend.md delete mode 100644 website/content/docs/gitlab-backend.md delete mode 100644 website/content/docs/gridsome.md delete mode 100644 website/content/docs/hugo.md delete mode 100644 website/content/docs/i18n.md delete mode 100644 website/content/docs/install-decap-cms.md delete mode 100755 website/content/docs/intro.md delete mode 100644 website/content/docs/jekyll.md delete mode 100644 website/content/docs/manual-initialization.md delete mode 100644 website/content/docs/middleman.md delete mode 100644 website/content/docs/netlify-large-media.md delete mode 100644 website/content/docs/nextjs.md delete mode 100644 website/content/docs/nuxt.md delete mode 100644 website/content/docs/open-authoring.md delete mode 100644 website/content/docs/registering-events.md delete mode 100644 website/content/docs/releases.md delete mode 100644 website/content/docs/start-with-a-template.md delete mode 100644 website/content/docs/summary-strings.md delete mode 100644 website/content/docs/test-backend.md delete mode 100644 website/content/docs/uploadcare.md delete mode 100644 website/content/docs/variable-type-widgets.md delete mode 100644 website/content/docs/widgets.md delete mode 100644 website/content/docs/widgets/boolean.md delete mode 100644 website/content/docs/widgets/code.md delete mode 100644 website/content/docs/widgets/color.md delete mode 100644 website/content/docs/widgets/datetime.md delete mode 100644 website/content/docs/widgets/file.md delete mode 100644 website/content/docs/widgets/hidden.md delete mode 100644 website/content/docs/widgets/image.md delete mode 100644 website/content/docs/widgets/list.md delete mode 100644 website/content/docs/widgets/map.md delete mode 100644 website/content/docs/widgets/markdown.md delete mode 100644 website/content/docs/widgets/number.md delete mode 100644 website/content/docs/widgets/object.md delete mode 100644 website/content/docs/widgets/relation.md delete mode 100644 website/content/docs/widgets/select.md delete mode 100644 website/content/docs/widgets/string.md delete mode 100644 website/content/docs/widgets/text.md delete mode 100644 website/content/docs/working-with-a-local-git-repository.md delete mode 100644 website/content/docs/writing-style-guide.md delete mode 100644 website/content/pages/community.md delete mode 100644 website/content/pages/services.md delete mode 100755 website/data/.keep delete mode 100644 website/data/docs.yml delete mode 100644 website/data/global.yaml delete mode 100644 website/data/landing.yaml delete mode 100644 website/data/notifications.yml delete mode 100644 website/data/updates.yml delete mode 100644 website/gatsby-browser.js delete mode 100644 website/gatsby-config.js delete mode 100644 website/gatsby-node.js delete mode 100644 website/netlify.toml delete mode 100644 website/package.json delete mode 100644 website/site.yml delete mode 100644 website/src/cms/cms.js delete mode 100644 website/src/components/awards.js delete mode 100644 website/src/components/blog-post-template.js delete mode 100644 website/src/components/button.js delete mode 100644 website/src/components/chat-button.js delete mode 100644 website/src/components/community-channels-list.js delete mode 100644 website/src/components/community.js delete mode 100644 website/src/components/container.js delete mode 100644 website/src/components/docs-nav.js delete mode 100644 website/src/components/docs-template.js delete mode 100644 website/src/components/docsearch.js delete mode 100644 website/src/components/edit-link.js delete mode 100644 website/src/components/event-box.js delete mode 100644 website/src/components/features.js delete mode 100644 website/src/components/footer.js delete mode 100644 website/src/components/github-button.js delete mode 100644 website/src/components/grid.js delete mode 100644 website/src/components/header.js delete mode 100644 website/src/components/hero-title.js delete mode 100644 website/src/components/home-section.js delete mode 100644 website/src/components/layout.js delete mode 100644 website/src/components/lead.js delete mode 100644 website/src/components/markdown.js delete mode 100644 website/src/components/markdownify.js delete mode 100644 website/src/components/meta-info.js delete mode 100644 website/src/components/notification.js delete mode 100644 website/src/components/notifications.js delete mode 100644 website/src/components/page-hero.js delete mode 100644 website/src/components/page.js delete mode 100644 website/src/components/release.js delete mode 100644 website/src/components/section-label.js delete mode 100644 website/src/components/sidebar-layout.js delete mode 100644 website/src/components/table-of-contents.js delete mode 100644 website/src/components/twitter-meta.js delete mode 100644 website/src/components/video-embed.js delete mode 100644 website/src/components/whats-new.js delete mode 100644 website/src/components/widget-doc.js delete mode 100644 website/src/components/widgets.js delete mode 100644 website/src/global-styles.js delete mode 100644 website/src/html.js delete mode 100644 website/src/img/bow.svg delete mode 100644 website/src/img/collab.svg delete mode 100644 website/src/img/demo.gif delete mode 100644 website/src/img/feature-access.svg delete mode 100644 website/src/img/feature-editor.svg delete mode 100644 website/src/img/feature-workflow.svg delete mode 100644 website/src/img/github.svg delete mode 100644 website/src/img/heart.svg delete mode 100644 website/src/img/helix.svg delete mode 100644 website/src/img/play.svg delete mode 100644 website/src/img/screenshot-content.png delete mode 100644 website/src/img/screenshot-editor.jpg delete mode 100644 website/src/img/screenshot-editor.png delete mode 100644 website/src/img/screenshot-editorial.png delete mode 100644 website/src/img/screenshot-identity.png delete mode 100644 website/src/img/search.svg delete mode 100644 website/src/img/smashing-logo.svg delete mode 100644 website/src/img/wavy-divider.svg delete mode 100644 website/src/pages/blog.js delete mode 100644 website/src/pages/community.js delete mode 100644 website/src/pages/index.js delete mode 100644 website/src/pages/services.js delete mode 100644 website/src/templates/blog-post.js delete mode 100644 website/src/templates/doc-page.js delete mode 100644 website/src/theme.js delete mode 100644 website/src/utils.js delete mode 100755 website/static/.keep delete mode 100644 website/static/_redirects delete mode 100644 website/static/admin/config.yml delete mode 100644 website/static/img/11ty-logo.svg delete mode 100644 website/static/img/cloudinary-console-details.png delete mode 100644 website/static/img/create-password.png delete mode 100644 website/static/img/decap-3.1.0-beta.0.png delete mode 100644 website/static/img/decap-3.png delete mode 100644 website/static/img/decap-cms-external-media-library.png delete mode 100644 website/static/img/decap-cms.png delete mode 100644 website/static/img/decap-logo.svg delete mode 100644 website/static/img/definition-features-best-practices.png delete mode 100644 website/static/img/discord.svg delete mode 100644 website/static/img/email-subject.png delete mode 100644 website/static/img/favicon/favicon-16x16.png delete mode 100644 website/static/img/favicon/favicon-32x32.png delete mode 100644 website/static/img/favicon/icon-512x512.png delete mode 100644 website/static/img/gatsby.svg delete mode 100644 website/static/img/github-statuses-deploy-previews.png delete mode 100644 website/static/img/hugo.svg delete mode 100644 website/static/img/hugo_shortcode_gist.png delete mode 100644 website/static/img/metalsmith.svg delete mode 100644 website/static/img/middleman.svg delete mode 100644 website/static/img/nextjs.svg delete mode 100644 website/static/img/nuxt.svg delete mode 100644 website/static/img/og-image.jpg delete mode 100644 website/static/img/preact.svg delete mode 100644 website/static/img/preview-link-check.png delete mode 100644 website/static/img/preview-link-published.png delete mode 100644 website/static/img/preview-link-unpublished.png delete mode 100644 website/static/img/pro-help.png delete mode 100644 website/static/img/screen shot 2018-01-05 at 4.25.07 pm.png delete mode 100644 website/static/img/screen-shot-2020-08-20-at-14.36.26.png delete mode 100644 website/static/img/screen-shot-2021-11-15-at-4.16.53-pm.png delete mode 100644 website/static/img/screen-shot-2021-11-16-at-1.34.18-PM.png delete mode 100644 website/static/img/screenshot-editor-2.png delete mode 100644 website/static/img/screenshot-jekyll-tutorial-blog.png delete mode 100644 website/static/img/sr-gold_medal-2023.png delete mode 100644 website/static/img/uc-logo-horizontal.svg delete mode 100644 website/static/img/version-3.1.png delete mode 100644 website/static/img/vuepress.png delete mode 100644 website/static/img/widgets-markdown.PNG delete mode 100644 website/yarn.lock diff --git a/.all-contributorsrc b/.all-contributorsrc deleted file mode 100644 index 795d49182fec..000000000000 --- a/.all-contributorsrc +++ /dev/null @@ -1,1083 +0,0 @@ -{ - "projectName": "decap-cms", - "projectOwner": "decaporg", - "files": [ - "README.md" - ], - "imageSize": 100, - "commit": false, - "badgeTemplate": "[![All Contributors](https://img.shields.io/badge/all_contributors-<%= contributors.length %>-orange.svg)](#contributors)", - "contributors": [ - { - "login": "cassiozen", - "name": "Cássio Souza", - "avatar_url": "https://avatars2.githubusercontent.com/u/33676?v=4", - "profile": "https://twitter.com/cassiozen", - "contributions": [ - "code" - ] - }, - { - "login": "erquhart", - "name": "Shawn Erquhart", - "avatar_url": "https://avatars3.githubusercontent.com/u/2112202?v=4", - "profile": "https://erquh.art", - "contributions": [ - "code" - ] - }, - { - "login": "okonet", - "name": "Andrey Okonetchnikov", - "avatar_url": "https://avatars3.githubusercontent.com/u/11071?v=4", - "profile": "http://okonet.ru", - "contributions": [ - "code" - ] - }, - { - "login": "biilmann", - "name": "Mathias Biilmann", - "avatar_url": "https://avatars0.githubusercontent.com/u/6515?v=4", - "profile": "https://www.netlify.com", - "contributions": [ - "code" - ] - }, - { - "login": "Benaiah", - "name": "Benaiah Mischenko", - "avatar_url": "https://avatars1.githubusercontent.com/u/1425133?v=4", - "profile": "http://benaiah.me", - "contributions": [ - "code" - ] - }, - { - "login": "rafaelconde", - "name": "Rafael Conde", - "avatar_url": "https://avatars0.githubusercontent.com/u/2281080?v=4", - "profile": "http://rafaelconde.net", - "contributions": [ - "design", - "code" - ] - }, - { - "login": "josephearl", - "name": "Joseph Earl", - "avatar_url": "https://avatars0.githubusercontent.com/u/2513147?v=4", - "profile": "http://josephearl.co.uk", - "contributions": [ - "code" - ] - }, - { - "login": "bdougie", - "name": "Brian Douglas", - "avatar_url": "https://avatars2.githubusercontent.com/u/5713670?v=4", - "profile": "https://briandouglas.me/", - "contributions": [ - "code" - ] - }, - { - "login": "phae", - "name": "Frances Berriman", - "avatar_url": "https://avatars3.githubusercontent.com/u/44568?v=4", - "profile": "https://fberriman.com", - "contributions": [ - "design" - ] - }, - { - "login": "calavera", - "name": "David Calavera", - "avatar_url": "https://avatars0.githubusercontent.com/u/1050?v=4", - "profile": "https://github.com/calavera", - "contributions": [ - "code" - ] - }, - { - "login": "lmcorreia", - "name": "Luis Correia", - "avatar_url": "https://avatars0.githubusercontent.com/u/8883545?v=4", - "profile": "https://luisc.pt", - "contributions": [ - "code" - ] - }, - { - "login": "tech4him1", - "name": "Caleb", - "avatar_url": "https://avatars1.githubusercontent.com/u/20345941?v=4", - "profile": "https://github.com/tech4him1", - "contributions": [ - "code" - ] - }, - { - "login": "jholmes033169", - "name": "Jerry Holmes", - "avatar_url": "https://avatars0.githubusercontent.com/u/3292160?v=4", - "profile": "http://www.pagedragon.com", - "contributions": [ - "code" - ] - }, - { - "login": "abumalick", - "name": "abumalick", - "avatar_url": "https://avatars0.githubusercontent.com/u/8377185?v=4", - "profile": "https://github.com/abumalick", - "contributions": [ - "code" - ] - }, - { - "login": "eamonnbell", - "name": "Eamonn Bell", - "avatar_url": "https://avatars1.githubusercontent.com/u/4513526?v=4", - "profile": "http://www.eamonnbell.com", - "contributions": [ - "code" - ] - }, - { - "login": "verythorough", - "name": "Jessica Parsons", - "avatar_url": "https://avatars2.githubusercontent.com/u/6111186?v=4", - "profile": "https://github.com/verythorough", - "contributions": [ - "doc" - ] - }, - { - "login": "KyleAMathews", - "name": "Kyle Mathews", - "avatar_url": "https://avatars3.githubusercontent.com/u/71047?v=4", - "profile": "https://www.bricolage.io", - "contributions": [ - "code" - ] - }, - { - "login": "americool", - "name": "americool", - "avatar_url": "https://avatars1.githubusercontent.com/u/16258690?v=4", - "profile": "https://github.com/americool", - "contributions": [ - "code" - ] - }, - { - "login": "Dammmien", - "name": "Damien Duhamel", - "avatar_url": "https://avatars3.githubusercontent.com/u/3051737?v=4", - "profile": "http://www.damienduhamel.fr", - "contributions": [ - "code" - ] - }, - { - "login": "juliankrispel", - "name": "Julian Krispel-Samsel", - "avatar_url": "https://avatars1.githubusercontent.com/u/1188186?v=4", - "profile": "http://reactrocket.com", - "contributions": [] - }, - { - "login": "HarlemSquirrel", - "name": "Kevin McCormack", - "avatar_url": "https://avatars0.githubusercontent.com/u/6445815?v=4", - "profile": "http://harlemsquirrel.github.io/", - "contributions": [] - }, - { - "login": "kalinchernev", - "name": "Kalin Chernev", - "avatar_url": "https://avatars3.githubusercontent.com/u/1923476?v=4", - "profile": "https://github.com/kalinchernev", - "contributions": [] - }, - { - "login": "tortilaman", - "name": "tortilaman", - "avatar_url": "https://avatars2.githubusercontent.com/u/5018268?v=4", - "profile": "https://github.com/tortilaman", - "contributions": [] - }, - { - "login": "vencax", - "name": "Václav Klecanda", - "avatar_url": "https://avatars0.githubusercontent.com/u/1184334?v=4", - "profile": "http://www.vxk.cz", - "contributions": [] - }, - { - "login": "DrianHillman", - "name": "DrianHillman", - "avatar_url": "https://avatars0.githubusercontent.com/u/2983665?v=4", - "profile": "http://drianhillman.me", - "contributions": [] - }, - { - "login": "seantcoyote", - "name": "Sean Crawford", - "avatar_url": "https://avatars1.githubusercontent.com/u/1198032?v=4", - "profile": "https://github.com/seantcoyote", - "contributions": [] - }, - { - "login": "rriemann", - "name": "Robert Riemann", - "avatar_url": "https://avatars1.githubusercontent.com/u/111932?v=4", - "profile": "http://blog.riemann.cc", - "contributions": [] - }, - { - "login": "rivertam", - "name": "Ben Berman", - "avatar_url": "https://avatars1.githubusercontent.com/u/4165105?v=4", - "profile": "http://jygabyte.com", - "contributions": [] - }, - { - "login": "bkniffler", - "name": "Benjamin Kniffler", - "avatar_url": "https://avatars3.githubusercontent.com/u/4349324?v=4", - "profile": "https://github.com/bkniffler", - "contributions": [] - }, - { - "login": "mwickett", - "name": "Mike Wickett", - "avatar_url": "https://avatars1.githubusercontent.com/u/845983?v=4", - "profile": "http://www.wickett.ca", - "contributions": [] - }, - { - "login": "GOGO98901", - "name": "Rory Claasen", - "avatar_url": "https://avatars1.githubusercontent.com/u/2751799?v=4", - "profile": "http://roryclaasen.me", - "contributions": [] - }, - { - "login": "freder", - "name": "Frederic Brodbeck", - "avatar_url": "https://avatars3.githubusercontent.com/u/724844?v=4", - "profile": "http://www.freder.io/", - "contributions": [] - }, - { - "login": "simplystuart", - "name": "Stuart Dum", - "avatar_url": "https://avatars2.githubusercontent.com/u/1245746?v=4", - "profile": "https://github.com/simplystuart", - "contributions": [] - }, - { - "login": "rdwatters", - "name": "Ryan Watters", - "avatar_url": "https://avatars0.githubusercontent.com/u/8184251?v=4", - "profile": "https://github.com/rdwatters", - "contributions": [] - }, - { - "login": "hsribei", - "name": "Helder S Ribeiro", - "avatar_url": "https://avatars3.githubusercontent.com/u/4315?v=4", - "profile": "https://twitter.com/hsribei", - "contributions": [] - }, - { - "login": "ArtemGovorov", - "name": "Artem Govorov", - "avatar_url": "https://avatars1.githubusercontent.com/u/979966?v=4", - "profile": "http://dm.gl", - "contributions": [] - }, - { - "login": "xuopled", - "name": "Cédric Delpoux", - "avatar_url": "https://avatars3.githubusercontent.com/u/2683300?v=4", - "profile": "http://xuopled.netlify.com/", - "contributions": [] - }, - { - "login": "imorente", - "name": "imorente", - "avatar_url": "https://avatars3.githubusercontent.com/u/83225?v=4", - "profile": "https://github.com/imorente", - "contributions": [] - }, - { - "login": "daddykotex", - "name": "David Francoeur", - "avatar_url": "https://avatars3.githubusercontent.com/u/5230460?v=4", - "profile": "http://davidfrancoeur.com", - "contributions": [] - }, - { - "login": "Rusta", - "name": "Rusta", - "avatar_url": "https://avatars3.githubusercontent.com/u/1954977?v=4", - "profile": "https://github.com/Rusta", - "contributions": [] - }, - { - "login": "hlaueriksson", - "name": "Henrik Lau Eriksson", - "avatar_url": "https://avatars1.githubusercontent.com/u/1299786?v=4", - "profile": "http://henrik.laueriksson.com", - "contributions": [] - }, - { - "login": "KraigWalker", - "name": "Kraig Walker", - "avatar_url": "https://avatars0.githubusercontent.com/u/1294877?v=4", - "profile": "https://www.kraigwalker.com", - "contributions": [] - }, - { - "login": "flaturtha", - "name": "Rich Cook", - "avatar_url": "https://avatars1.githubusercontent.com/u/2994311?v=4", - "profile": "http://www.TalesofMurder.com", - "contributions": [] - }, - { - "login": "damienvdw", - "name": "Damien Van Der Windt", - "avatar_url": "https://avatars3.githubusercontent.com/u/1309950?v=4", - "profile": "https://github.com/damienvdw", - "contributions": [] - }, - { - "login": "mattjared", - "name": "Matt Jared", - "avatar_url": "https://avatars2.githubusercontent.com/u/1571899?v=4", - "profile": "http://mattjared.github.io/", - "contributions": [] - }, - { - "login": "bruce-one", - "name": "bruce-one", - "avatar_url": "https://avatars1.githubusercontent.com/u/1100280?v=4", - "profile": "https://github.com/bruce-one", - "contributions": [] - }, - { - "login": "DirtyF", - "name": "Frank Taillandier", - "avatar_url": "https://avatars3.githubusercontent.com/u/103008?v=4", - "profile": "https://frank.taillandier.me", - "contributions": [ - "doc" - ] - }, - { - "login": "aquibm", - "name": "Aquib Master", - "avatar_url": "https://avatars0.githubusercontent.com/u/2936813?v=4", - "profile": "http://aquibm.com/", - "contributions": [ - "code" - ] - }, - { - "login": "Jinksi", - "name": "Eric Jinks", - "avatar_url": "https://avatars0.githubusercontent.com/u/3147296?v=4", - "profile": "http://ericjinks.com", - "contributions": [ - "code" - ] - }, - { - "login": "talves", - "name": "Tony Alves", - "avatar_url": "https://avatars3.githubusercontent.com/u/784848?v=4", - "profile": "https://github.com/talves", - "contributions": [ - "code" - ] - }, - { - "login": "ebello", - "name": "Ernie Bello", - "avatar_url": "https://avatars3.githubusercontent.com/u/782?v=4", - "profile": "http://ern.me", - "contributions": [ - "bug" - ] - }, - { - "login": "ackushiw", - "name": "Alexander Kushi-Willis", - "avatar_url": "https://avatars3.githubusercontent.com/u/6202476?v=4", - "profile": "https://ackushiw.com", - "contributions": [ - "doc" - ] - }, - { - "login": "igk1972", - "name": "Igor Kuznetsov", - "avatar_url": "https://avatars3.githubusercontent.com/u/54089?v=4", - "profile": "http://www.igk.ru", - "contributions": [ - "bug", - "code", - "plugin" - ] - }, - { - "login": "neutyp", - "name": "Tim Erickson", - "avatar_url": "https://avatars2.githubusercontent.com/u/1312538?v=4", - "profile": "http://neutyp.com", - "contributions": [ - "design" - ] - }, - { - "login": "davidejones", - "name": "David Jones", - "avatar_url": "https://avatars0.githubusercontent.com/u/871552?v=4", - "profile": "http://davidejones.com", - "contributions": [ - "doc" - ] - }, - { - "login": "hcavalieri", - "name": "Henrique Cavalieri", - "avatar_url": "https://avatars0.githubusercontent.com/u/27744332?v=4", - "profile": "https://kaordica.com.br", - "contributions": [ - "doc" - ] - }, - { - "login": "ebernard", - "name": "Etienne Bernard", - "avatar_url": "https://avatars0.githubusercontent.com/u/250958?v=4", - "profile": "https://github.com/ebernard", - "contributions": [ - "doc" - ] - }, - { - "login": "eliwilliamson", - "name": "Eli Williamson", - "avatar_url": "https://avatars3.githubusercontent.com/u/871660?v=4", - "profile": "http://eliwilliamson.com", - "contributions": [ - "code", - "design" - ] - }, - { - "login": "covingtondoan", - "name": "Covington Doan", - "avatar_url": "https://avatars0.githubusercontent.com/u/858837?v=4", - "profile": "https://www.covingtondoan.com", - "contributions": [ - "doc" - ] - }, - { - "login": "ziburski", - "name": "Lennart Ziburski", - "avatar_url": "https://avatars3.githubusercontent.com/u/1299080?v=4", - "profile": "http://lennartziburski.com", - "contributions": [ - "code", - "design", - "doc" - ] - }, - { - "login": "dopry", - "name": "Darrel O'Pry", - "avatar_url": "https://avatars1.githubusercontent.com/u/387640?v=4", - "profile": "http://darrelopry.com", - "contributions": [ - "code", - "infra", - "test" - ] - }, - { - "login": "yourfrienderin", - "name": "Erin Symons", - "avatar_url": "https://avatars1.githubusercontent.com/u/13856868?v=4", - "profile": "https://github.com/yourfrienderin", - "contributions": [ - "doc" - ] - }, - { - "login": "AustinGreen", - "name": "Austin Green", - "avatar_url": "https://avatars0.githubusercontent.com/u/5200555?v=4", - "profile": "https://github.com/AustinGreen", - "contributions": [ - "doc", - "example" - ] - }, - { - "login": "brob", - "name": "Bryan Robinson", - "avatar_url": "https://avatars2.githubusercontent.com/u/799360?v=4", - "profile": "http://bryanlrobinson.com", - "contributions": [ - "doc" - ] - }, - { - "login": "dardub", - "name": "Darren", - "avatar_url": "https://avatars1.githubusercontent.com/u/561983?v=4", - "profile": "https://github.com/dardub", - "contributions": [ - "doc" - ] - }, - { - "login": "rpullinger", - "name": "Richard Pullinger", - "avatar_url": "https://avatars3.githubusercontent.com/u/576512?v=4", - "profile": "http://www.richardpullinger.com", - "contributions": [ - "code" - ] - }, - { - "login": "taylorbryant", - "name": "Taylor Bryant", - "avatar_url": "https://avatars1.githubusercontent.com/u/3718939?v=4", - "profile": "https://taylorbryant.blog", - "contributions": [ - "doc" - ] - }, - { - "login": "kvanerkelens", - "name": "kvanerkelens", - "avatar_url": "https://avatars3.githubusercontent.com/u/5881826?v=4", - "profile": "https://github.com/kvanerkelens", - "contributions": [ - "doc" - ] - }, - { - "login": "pjsier", - "name": "Patrick Sier", - "avatar_url": "https://avatars1.githubusercontent.com/u/8291663?v=4", - "profile": "https://patsier.com/", - "contributions": [ - "code" - ] - }, - { - "login": "drlogout", - "name": "Christian Nolte", - "avatar_url": "https://avatars2.githubusercontent.com/u/6132191?v=4", - "profile": "http://noltech.net", - "contributions": [ - "code" - ] - }, - { - "login": "EdwardBetts", - "name": "Edward Betts", - "avatar_url": "https://avatars1.githubusercontent.com/u/3818?v=4", - "profile": "http://edwardbetts.com/", - "contributions": [ - "doc" - ] - }, - { - "login": "jhardman0830", - "name": "Josh Hardman", - "avatar_url": "https://avatars1.githubusercontent.com/u/8771435?v=4", - "profile": "https://github.com/jhardman0830", - "contributions": [ - "doc" - ] - }, - { - "login": "mistermantas", - "name": "Mantas", - "avatar_url": "https://avatars0.githubusercontent.com/u/11616378?v=4", - "profile": "https://behance.net/mistermantas", - "contributions": [ - "doc" - ] - }, - { - "login": "marcobiedermann", - "name": "Marco Biedermann", - "avatar_url": "https://avatars0.githubusercontent.com/u/5244986?v=4", - "profile": "https://www.marcobiedermann.com", - "contributions": [ - "doc" - ] - }, - { - "login": "mxstbr", - "name": "Max Stoiber", - "avatar_url": "https://avatars0.githubusercontent.com/u/7525670?v=4", - "profile": "https://mxstbr.blog/newsletter", - "contributions": [ - "doc" - ] - }, - { - "login": "berekuk", - "name": "Vyacheslav Matyukhin", - "avatar_url": "https://avatars0.githubusercontent.com/u/89368?v=4", - "profile": "http://berekuk.ru", - "contributions": [ - "doc" - ] - }, - { - "login": "jimmaaay", - "name": "jimmaaay", - "avatar_url": "https://avatars1.githubusercontent.com/u/9059048?v=4", - "profile": "https://jimmythompson.me", - "contributions": [ - "code" - ] - }, - { - "login": "Quicksaver", - "name": "Luís Miguel", - "avatar_url": "https://avatars3.githubusercontent.com/u/802086?v=4", - "profile": "https://github.com/Quicksaver", - "contributions": [ - "bug", - "code" - ] - }, - { - "login": "delucis", - "name": "Chris Swithinbank", - "avatar_url": "https://avatars2.githubusercontent.com/u/357379?v=4", - "profile": "http://chrisswithinbank.net/", - "contributions": [ - "doc", - "code" - ] - }, - { - "login": "remmah", - "name": "remmah", - "avatar_url": "https://avatars3.githubusercontent.com/u/1262221?v=4", - "profile": "https://github.com/remmah", - "contributions": [ - "doc" - ] - }, - { - "login": "sumeetjain", - "name": "Sumeet Jain", - "avatar_url": "https://avatars2.githubusercontent.com/u/29388?v=4", - "profile": "http://sumeetjain.com", - "contributions": [ - "doc" - ] - }, - { - "login": "ragasirtahk", - "name": "Sagar Khatri", - "avatar_url": "https://avatars2.githubusercontent.com/u/26816046?v=4", - "profile": "https://github.com/ragasirtahk", - "contributions": [ - "doc", - "example" - ] - }, - { - "login": "Doocey", - "name": "Kevin Doocey", - "avatar_url": "https://avatars0.githubusercontent.com/u/8182932?v=4", - "profile": "https://www.dooceykev.in", - "contributions": [ - "code" - ] - }, - { - "login": "Swieckowski", - "name": "Swieckowski", - "avatar_url": "https://avatars0.githubusercontent.com/u/31023010?v=4", - "profile": "https://www.linkedin.com/in/arthur-swieckowski/", - "contributions": [ - "code", - "doc", - "test" - ] - }, - { - "login": "pixelastic", - "name": "Tim Carry", - "avatar_url": "https://avatars2.githubusercontent.com/u/283419?v=4", - "profile": "http://www.pixelastic.com/", - "contributions": [ - "code", - "design", - "doc" - ] - }, - { - "login": "solpark", - "name": "Sol Park", - "avatar_url": "https://avatars0.githubusercontent.com/u/30510616?v=4", - "profile": "https://github.com/solpark", - "contributions": [ - "code" - ] - }, - { - "login": "MichaelRomani", - "name": "Michael Romani", - "avatar_url": "https://avatars0.githubusercontent.com/u/29218846?v=4", - "profile": "https://github.com/MichaelRomani", - "contributions": [ - "code" - ] - }, - { - "login": "xifengjin88", - "name": "Xifeng Jin", - "avatar_url": "https://avatars1.githubusercontent.com/u/15175868?v=4", - "profile": "http://linkedin/in/xifengjin88", - "contributions": [ - "bug", - "code" - ] - }, - { - "login": "peduarte", - "name": "Pedro Duarte", - "avatar_url": "https://avatars1.githubusercontent.com/u/372831?v=4", - "profile": "http://pedroduarte.me", - "contributions": [ - "bug", - "code", - "doc" - ] - }, - { - "login": "Strangehill", - "name": "Antonio Argote", - "avatar_url": "https://avatars1.githubusercontent.com/u/6064830?v=4", - "profile": "http://antonioargote.com", - "contributions": [ - "design" - ] - }, - { - "login": "ktaube", - "name": "Kristaps Taube", - "avatar_url": "https://avatars3.githubusercontent.com/u/1479451?v=4", - "profile": "https://www.ktaube.com", - "contributions": [ - "code" - ] - }, - { - "login": "daveyko", - "name": "David Ko", - "avatar_url": "https://avatars3.githubusercontent.com/u/26639499?v=4", - "profile": "https://github.com/daveyko", - "contributions": [ - "code" - ] - }, - { - "login": "igarbla", - "name": "Iñaki García", - "avatar_url": "https://avatars3.githubusercontent.com/u/440562?v=4", - "profile": "http://www.txorua.com", - "contributions": [ - "design" - ] - }, - { - "login": "gazebosx3", - "name": "Sam", - "avatar_url": "https://avatars3.githubusercontent.com/u/27162255?v=4", - "profile": "https://github.com/gazebosx3", - "contributions": [ - "code" - ] - }, - { - "login": "dzello", - "name": "Josh Dzielak", - "avatar_url": "https://avatars1.githubusercontent.com/u/174777?v=4", - "profile": "https://dzello.com", - "contributions": [ - "doc" - ] - }, - { - "login": "jeremybise", - "name": "Jeremy Bise", - "avatar_url": "https://avatars0.githubusercontent.com/u/2193?v=4", - "profile": "http://thosegeeks.com", - "contributions": [ - "doc" - ] - }, - { - "login": "terrierscript", - "name": "terrierscript", - "avatar_url": "https://avatars2.githubusercontent.com/u/13282103?v=4", - "profile": "https://terrierscript.com", - "contributions": [ - "code" - ] - }, - { - "login": "crgeary", - "name": "Christopher Geary", - "avatar_url": "https://avatars0.githubusercontent.com/u/3949335?v=4", - "profile": "https://twitter.com/crgeary", - "contributions": [ - "plugin" - ] - }, - { - "login": "brianlmacdonald", - "name": "Brian Macdonald", - "avatar_url": "https://avatars0.githubusercontent.com/u/23248886?v=4", - "profile": "https://github.com/brianlmacdonald", - "contributions": [ - "code" - ] - }, - { - "login": "jayvdb", - "name": "John Vandenberg", - "avatar_url": "https://avatars1.githubusercontent.com/u/15092?v=4", - "profile": "https://jayvdb.github.io/", - "contributions": [ - "doc" - ] - }, - { - "login": "MarkZither", - "name": "MarkZither", - "avatar_url": "https://avatars2.githubusercontent.com/u/24911956?v=4", - "profile": "https://github.com/MarkZither", - "contributions": [ - "doc" - ] - }, - { - "login": "robphoenix", - "name": "Rob Phoenix", - "avatar_url": "https://avatars1.githubusercontent.com/u/9257284?v=4", - "profile": "https://www.robphoenix.com", - "contributions": [ - "doc" - ] - }, - { - "login": "slathrop", - "name": "Steve Lathrop", - "avatar_url": "https://avatars2.githubusercontent.com/u/3028764?v=4", - "profile": "https://www.SteLa.io", - "contributions": [ - "code", - "doc", - "example" - ] - }, - { - "login": "maciejmatu", - "name": "Maciej Matuszewski", - "avatar_url": "https://avatars0.githubusercontent.com/u/10004167?v=4", - "profile": "https://github.com/maciejmatu", - "contributions": [ - "code" - ] - }, - { - "login": "ekoeryanto", - "name": "Eko Eryanto", - "avatar_url": "https://avatars0.githubusercontent.com/u/36023898?v=4", - "profile": "https://github.com/ekoeryanto", - "contributions": [ - "plugin" - ] - }, - { - "login": "tedmiston", - "name": "Taylor D. Edmiston", - "avatar_url": "https://avatars3.githubusercontent.com/u/366688?v=4", - "profile": "http://blog.tedmiston.com/", - "contributions": [ - "doc" - ] - }, - { - "login": "danielmahon", - "name": "Daniel Mahon", - "avatar_url": "https://avatars2.githubusercontent.com/u/1088089?v=4", - "profile": "https://www.mahonstudios.com", - "contributions": [ - "code" - ] - }, - { - "login": "hennessyevan", - "name": "Evan Hennessy", - "avatar_url": "https://avatars1.githubusercontent.com/u/16711653?v=4", - "profile": "https://www.hennessyevan.com", - "contributions": [ - "plugin" - ] - }, - { - "login": "hasanavi", - "name": "Hasan Azizul Haque", - "avatar_url": "https://avatars1.githubusercontent.com/u/3259517?v=4", - "profile": "https://hasanavi.me", - "contributions": [ - "code", - "doc", - "ideas" - ] - }, - { - "login": "robertkarlsson", - "name": "Robert Karlsson", - "avatar_url": "https://avatars1.githubusercontent.com/u/5166612?v=4", - "profile": "https://github.com/robertkarlsson", - "contributions": [ - "bug" - ] - }, - { - "login": "gil--", - "name": "Gil Greenberg", - "avatar_url": "https://avatars2.githubusercontent.com/u/3484527?v=4", - "profile": "http://gilgreenberg.com", - "contributions": [ - "code" - ] - }, - { - "login": "loremipson", - "name": "Tyler Ipson", - "avatar_url": "https://avatars0.githubusercontent.com/u/649890?v=4", - "profile": "http://loremipson.com", - "contributions": [ - "doc" - ] - }, - { - "login": "growdigital", - "name": "Jake Rayson", - "avatar_url": "https://avatars0.githubusercontent.com/u/1061992?v=4", - "profile": "https://www.growdigital.org/", - "contributions": [ - "code", - "blog", - "example" - ] - }, - { - "login": "mittalyashu", - "name": "Yashu Mittal", - "avatar_url": "https://avatars1.githubusercontent.com/u/29014463?v=4", - "profile": "https://mittalyashu.now.sh/", - "contributions": [ - "doc" - ] - }, - { - "login": "kurtgcollins", - "name": "Kurt collins", - "avatar_url": "https://avatars1.githubusercontent.com/u/42543284?v=4", - "profile": "https://github.com/kurtgcollins", - "contributions": [ - "doc" - ] - }, - { - "login": "cory-wc", - "name": "Cory Williamson-Cardneau", - "avatar_url": "https://avatars2.githubusercontent.com/u/1516558?v=4", - "profile": "http://cory.williamson-cardneau.com", - "contributions": [ - "doc" - ] - }, - { - "login": "cdschroeder", - "name": "Casey Schroeder", - "avatar_url": "https://avatars3.githubusercontent.com/u/31967674?v=4", - "profile": "https://github.com/cdschroeder", - "contributions": [ - "doc" - ] - }, - { - "login": "MitchellCash", - "name": "Mitchell Cash", - "avatar_url": "https://avatars2.githubusercontent.com/u/8009243?v=4", - "profile": "https://mitchellcash.com", - "contributions": [ - "bug", - "doc" - ] - }, - { - "login": "g-hodges", - "name": "Glendon Hodges", - "avatar_url": "https://avatars1.githubusercontent.com/u/22135379?v=4", - "profile": "https://github.com/g-hodges", - "contributions": [ - "doc" - ] - }, - { - "login": "bevanmw", - "name": "Bevan Wentzel", - "avatar_url": "https://avatars0.githubusercontent.com/u/13152809?v=4", - "profile": "https://github.com/bevanmw", - "contributions": [ - "code" - ] - }, - { - "login": "zebapy", - "name": "Zeb Pykosz", - "avatar_url": "https://avatars1.githubusercontent.com/u/2199845?v=4", - "profile": "https://zeb.codes", - "contributions": [ - "doc" - ] - }, - { - "login": "jbutz", - "name": "Jason Butz", - "avatar_url": "https://avatars2.githubusercontent.com/u/736696?v=4", - "profile": "http://www.jasonbutz.info", - "contributions": [ - "code" - ] - } - ], - "repoType": "github" -} diff --git a/.eslintrc.js b/.eslintrc.js index cc92a2fb86b1..6753607da287 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -101,11 +101,5 @@ module.exports = { ], }, }, - { - files: ['website/**/*'], - rules: { - 'import/no-unresolved': [0], - }, - }, ], }; diff --git a/.gitignore b/.gitignore index 3d5d79fbb1b4..5a36cf21b91b 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,6 @@ yarn-error.log .idea/ manifest.yml .imdone/ -website/data/contributors.json cypress/videos cypress/screenshots __diff_output__ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 43e1880605ae..1bae8589328b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,7 +3,7 @@ Contributions are always welcome, no matter how large or small. Before contributing, please read the [code of conduct](CODE_OF_CONDUCT.md). -For details on contributing to documentation, see [Website Directory Readme](https://github.com/decaporg/decap-cms/blob/master/website/README.md). +For details on contributing to documentation, see [Website Readme](https://github.com/decaporg/decap-website/blob/main/README.md). ## Setup diff --git a/netlify.toml b/netlify.toml index 48ae112778cc..50308491f014 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,6 +1,5 @@ [build] base = "/" - ignore = "git diff --quiet HEAD^ HEAD -- . ':!website/'" [build.environment] YARN_FLAGS = "--frozen-lockfile" diff --git a/package.json b/package.json index 1dd2de967d6e..073afe69b797 100644 --- a/package.json +++ b/package.json @@ -28,11 +28,11 @@ "mock:server:stop": "node -e 'require(\"./cypress/utils/mock-server\").stop()'", "lint": "run-p -c --aggregate-output \"lint:*\"", "lint-quiet": "run-p -c --aggregate-output \"lint:* --quiet\"", - "lint:css": "stylelint --ignore-path .gitignore \"{packages/**/*.{css,js,jsx,ts,tsx},website/**/*.css}\"", - "lint:js": "eslint --color --ignore-path .gitignore \"{{packages,scripts,website}/**/,}*.{js,jsx,ts,tsx}\"", - "lint:format": "prettier \"{{packages,scripts,website}/**/,}*.{js,jsx,ts,tsx,css}\" --list-different", + "lint:css": "stylelint --ignore-path .gitignore \"packages/**/*.{css,js,jsx,ts,tsx}\"", + "lint:js": "eslint --color --ignore-path .gitignore \"{{packages,scripts}/**/,}*.{js,jsx,ts,tsx}\"", + "lint:format": "prettier \"{{packages,scripts}/**/,}*.{js,jsx,ts,tsx,css}\" --list-different", "format": "npm run lint:js -- --fix --quiet && npm run format:prettier -- --write", - "format:prettier": "prettier \"{{packages,scripts,website}/**/,}*.{js,jsx,ts,tsx,css}\"", + "format:prettier": "prettier \"{{packages,scripts}/**/,}*.{js,jsx,ts,tsx,css}\"", "prepare": "husky install" }, "browserslist": [ diff --git a/packages/decap-cms-app/README.md b/packages/decap-cms-app/README.md index 98d90445aa76..1cc64b852963 100644 --- a/packages/decap-cms-app/README.md +++ b/packages/decap-cms-app/README.md @@ -1,12 +1,6 @@ # Decap CMS App _For a Decap CMS overview, see the general [Decap CMS project README](https://github.com/decaporg/decap-cms)._ -## Community Chat - - - Join us on Discord - - ## Purpose This package is similar to the [`decap-cms`](https://github.com/decaporg/decap-cms/tree/master/packages/decap-cms/) package, but is designed for use with extensions. It serves that purpose in the following ways. diff --git a/website/.babelrc b/website/.babelrc deleted file mode 100644 index 131352d35e84..000000000000 --- a/website/.babelrc +++ /dev/null @@ -1,14 +0,0 @@ -{ - "presets": ["babel-preset-gatsby"], - "plugins": [ - [ - "prismjs", - { - "languages": ["javascript", "css", "markup", "yaml", "json"], - "plugins": ["line-numbers"], - "theme": "tomorrow", - "css": true - } - ] - ] -} diff --git a/website/.gitignore b/website/.gitignore deleted file mode 100644 index 0174e7b8f0d6..000000000000 --- a/website/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -.cache -public -dist diff --git a/website/.markdownlint.json b/website/.markdownlint.json deleted file mode 100644 index 77811aa618ab..000000000000 --- a/website/.markdownlint.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "default": false, - "MD032": true -} diff --git a/website/.nvmrc b/website/.nvmrc deleted file mode 100644 index cbe86a238fb9..000000000000 --- a/website/.nvmrc +++ /dev/null @@ -1 +0,0 @@ ---lts diff --git a/website/README.md b/website/README.md deleted file mode 100755 index 372b27b7a77e..000000000000 --- a/website/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# Decap CMS Website & Docs - -This directory builds decapcms.org. If you'd like to propose changes to the site or docs, you'll find the source files in here. - -## Local development - -The site is built with [GatsbyJS](https://gatsbyjs.org/). - -To run the site locally, you'll need to have [Node](https://nodejs.org) version 16 and [Yarn](https://yarnpkg.com/en/) installed on your computer. - -From your terminal window, `cd` into the `website` directory of the repo, and run - -```bash -yarn -yarn start -``` - -Then visit http://localhost:8000/ - Gatsby will automatically reload CSS or -refresh the page when stylesheets or content changes. diff --git a/website/content/.keep b/website/content/.keep deleted file mode 100755 index e69de29bb2d1..000000000000 diff --git a/website/content/blog/decap-3-1-0-beta-0.md b/website/content/blog/decap-3-1-0-beta-0.md deleted file mode 100644 index d1d506b42fad..000000000000 --- a/website/content/blog/decap-3-1-0-beta-0.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: Decap 3.1.0-beta.0 -author: Martin Jagodic -description: This beta release brings React 18 -meta_description: "" -image: /img/decap-3.1.0-beta.0.png -date: 2023-10-24T09:01:53.438Z ---- -The main feature of this release is the upgrade to React 18. This is a large change with potential side effects, so we decided to release a beta version. - -We kindly invite everyone to test, especially Gatsby users, who were most eagerly awaiting this update. If you find any new issues, please report them as [GitHub Issues](https://github.com/decaporg/decap-cms/issues). - -NPM: - -GitHub Pull Request: diff --git a/website/content/blog/decap-3-1.md b/website/content/blog/decap-3-1.md deleted file mode 100644 index 38ff4d07f6d8..000000000000 --- a/website/content/blog/decap-3-1.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: Decap 3.1 -author: Martin Jagodic -date: 2024-02-01T08:00:00.000Z -description: This minor release brings several improvements, most notably React - 18 support. It was in development for quite a while, so it includes many minor - patches as well. -image: /img/version-3.1.png ---- -With this release we bring you better performance and a more up-to-date product. Contributor experience and release pipeline is also improved. - -Major updates in Decap 3.1: - -* Upgrade project to React 18 -* Avoid unnecessary rerenders -* AWS Cognito Proxy for Github -* Migrate from moment to day.js -* Migrate from yarn to npm -* Migrate from lerna to nx -* Updated documentation - -...plus many minor patches. - -There are no breaking changes. - -This changelog is a bit lacking because we are in the process of improving the release pipeline. With that we will also automate and improve the changelog. - diff --git a/website/content/blog/decap-3.md b/website/content/blog/decap-3.md deleted file mode 100644 index 510323567bbe..000000000000 --- a/website/content/blog/decap-3.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: Decap 3.0 is now available -description: >- - First release as Decap CMS is now available -date: 2023-08-23T08:00:00.000Z -author: Martin Jagodic -image: /img/decap-3.png ---- -We are happy to announce that the first release of Decap CMS is now available. It is released under 3.0 to honor the 2 major versions of the Netlify CMS. - -Decap on NPM: https://www.npmjs.com/package/decap-cms - -## Add to your site - -Via script tag in admin.html: - -```html - -``` - -or via NPM: - -```bash -npm install decap-cms-app -``` - -## Changes - -Decap 3.0 is very similar to Netlify CMS 2.10.192 (the last available version), and it's fully backward compatible. - -Notable changes are: -- Renamed project: logo, name, packages, npm, and all other references to Netlify CMS -- Updated Slate editor -- Updated Webpack -- Cypress: updated and all tests are working & passing again -- Updated Typescript -- Added Toastify notifications - -## Potential issues - -There was no beta phase as this is the first release, so there might be some issues that we didn't find. Please report them on GitHub. - -## Thanks - -Thanks to everyone in the community that waited patiently for so long. Thanks to all the contributors and other engaged users that helped us in this transition period. Thanks to Netlify for creating this amazing project and for letting us continue it. diff --git a/website/content/blog/git-based-cms-definition-features-best-practices.md b/website/content/blog/git-based-cms-definition-features-best-practices.md deleted file mode 100644 index 5d7a319be97c..000000000000 --- a/website/content/blog/git-based-cms-definition-features-best-practices.md +++ /dev/null @@ -1,62 +0,0 @@ ---- -title: "Git-Based CMS: Definition, Features, Best Practices" -author: Martin Jagodic -description: A dive into the definition, main features, caveats, and best - practices of a Git-based CMS. This will help you make an informed decision for - your next project. -image: /img/definition-features-best-practices.png -date: 2023-11-15T09:18:08.062Z ---- -In this post, we'll dive into the definition, main features, caveats, and best practices of Git-based CMS, helping you make an informed decision for your next project. - -## What is a Git-Based CMS? - -A Git-based CMS, as the name suggests, enables you to edit content that is stored in your [Git](https://git-scm.com/) repository, alongside your code. It's an integral part of the [Jamstack](https://jamstack.org/what-is-jamstack/) architecture, which separates the frontend from data and business logic. In practice, this means you'll need: - -- a static site generator or a meta-framework (like [Hugo](https://gohugo.io/), [Gatsby](https://www.gatsbyjs.com/), [Next](https://nextjs.org/)), -- a headless CMS (either Git-based or API-based), -- a build & CDN platform (like [Netlify](https://www.netlify.com/) or [Vercel](https://vercel.com/)). - -You can also think of a Git-based CMS as a visual editing layer on top of data files like Markdown, JSON, YAML, etc. This makes content management more intuitive for developers, as it brings content directly into your code editor. - -## Versioning: A Developer's Dream - -The standout feature of Git-based CMS is its robust versioning and history capability. It leverages [Git](https://git-scm.com/)'s powerful version control system, allowing you to restore exact states from any point in history, for which you can determine who did exactly what and when. Moreover, Git-based CMS works seamlessly with branches and branch-related environments, making content editing and review a breeze. This aligns it with the workflows developers are familiar with for code changes. - -## Simplicity at Its Core - -While there may be differences among Git-based CMS options, they are generally straightforward to set up. For instance, Decap CMS can be integrated with just the addition of [two files](https://decapcms.org/docs/add-to-your-site/) to your repository. Storing content alongside your code makes it easily accessible for developers, eliminating the need to switch between code editors and tools like phpMyAdmin. The user interface is designed with a focus on content, simplifying content editors’ experience and leaving out unnecessary settings and styling options. Say goodbye to dependency alerts, as you might encounter in traditional CMS platforms like WordPress. - -## Scalability: From Small to Large Projects - -Git-based CMS solutions balance simplicity and scalability, making them suitable for a wide range of projects. Scalability largely depends on the volume of your content and the speed at which you need to serve it. For static site projects, Git-based CMS can go a long way. - -But not all the way. For example, a Decap project on GitHub scales to about 10.000 entries if you have a lot of collection relations. It’s possible to have more entries if there are fewer relations. The bottleneck in this case is the GitHub API, which has a rate limit of 5000 on the personal plan and 15000 on the enterprise plan. A new user with an empty cache will eat up that limit fast because Decap will make a request per each entry to create a cache. - -To mitigate this, some Git-based CMS platforms like [Tina](https://tina.io/) and [CloudCanon](https://cloudcannon.com/) offer a cloud database proxy, enabling advanced features that might be necessary for specific projects. Those could be real-time collaboration, user roles, and other resource-intensive queries. - -It is important to understand that any limitations of the CMS are not the limitations of the frontend. The decoupled nature of Git-stored content enables this. - -## Enhanced Security and Business Flexibility - -With content stored alongside your code, the security landscape becomes simplified. You only need to secure a single source, and you can outsource this responsibility to your Git provider, such as [GitHub](https://github.com/) or [BitBucket](https://bitbucket.org/product). The CMS user interface can be further secured with the authentication service of your choice. Some Git-based CMS platforms even offer customizable logins, and others allow you to define an external or custom solution. Additionally, certain Git-based CMS platforms provide different roles for content editors, giving you fine-grained control over who can make changes. - -From a business perspective, Git-based CMS solutions offer exceptional value, with many open-source options available. Numerous platforms provide free tier options that can be upgraded as your needs evolve. Importantly, you retain ownership of your content, which is stored in universally recognized formats like [Markdown](https://en.wikipedia.org/wiki/Markdown). This means you can easily switch to another CMS with minimal effort. Depending on your business requirements, you can choose from options like simple open-source solutions to more advanced options like DB proxies and real-time collaboration, each with its pricing structure. - -## Caveats to Consider - -As with any technology, there are caveats to keep in mind when using a Git-based CMS. Content managed through a Git-based CMS is typically project-specific and not recommended for cases where you have a central repository of content serving multiple frontend clients, such as a website and a mobile app. While Git providers offer fast and reliable APIs, a CMS on a very large repository may experience performance issues. The frontend’s performance will not be affected. Some Git-based CMS platforms address this with a cloud database layer, which comes at an additional cost. - -Moreover, Git is not ideal for storing large files like images efficiently. Although Git offers a feature known as [Large File Storage](https://git-lfs.com/) (LFS), it's often more practical to use an external service such as [Cloudinary](https://cloudinary.com/) or [Uploadcare](https://uploadcare.com/) to manage large assets. These services, called digital asset managers (DAM), can be seamlessly integrated into your Git-based CMS, providing a more efficient way to handle media files. DAMs store your assets in a central repository, serve with an optimized CDN, and offer an array of transformations to optimize media delivery. - -## Best Practices for Git-Based CMS Adoption - -When considering a Git-based CMS, it's crucial to approach it within the context of your entire tech stack. It's a fundamental part of the Jamstack architecture, so it's essential to plan your project accordingly. You can add a Git-based CMS later on or replace it, but having a clear understanding of your project's requirements from the start will simplify the process. - -Research your options thoroughly, as there are numerous Git-based CMS platforms with different features. Ask yourself what you need and explore the combinations that align with your project's objectives. If you're migrating from a traditional database-driven CMS, you can find scripts online or ask for assistance to ease the transition. - -## In Conclusion - -Git-based CMS offers versioning, simplicity, and security, making it a joy to install, use, and maintain. It is suitable for small to large projects, but there is an upper limit to its scalability. - -It streamlines the CMS experience, reducing complexity and offering greater control over your content. In essence, it’s the most of CMS for the least amount of moving parts. diff --git a/website/content/blog/github-discussions.md b/website/content/blog/github-discussions.md deleted file mode 100644 index 0def41e863ae..000000000000 --- a/website/content/blog/github-discussions.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: GitHub Discussions is now the official Decap forum -description: >- - What was once category on Netlify Answers is now moving to GitHub Discussions on the main repository. -date: 2023-03-09T10:30:00.000Z -author: Martin Jagodic ---- -Netlify CMS used the Discourse subforum on https://answers.netlify.com/, which is not an option for Decap as we are not affiliated with Netlify anymore. - -We decided to officiate this service as our forum, as it provides all the features that we need. It's also very handy to move from issues to discussions and vice versa. - -[Discussion about it](https://github.com/decaporg/decap-cms/discussions/6720) - -Use it to ask questions about your config, contributing, new feature ideas, and more. This is a public space, so be respectful and help people if you can. - -Happy discussing! diff --git a/website/content/blog/introducing-decap.md b/website/content/blog/introducing-decap.md deleted file mode 100644 index ad888cc14da7..000000000000 --- a/website/content/blog/introducing-decap.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: Introducing Decap CMS -description: >- - Decap CMS is a rebranded version of Netlify CMS, offering a simple, easy-to-use, open source, git-based CMS. -date: 2023-02-23T10:30:00.000Z -author: Martin Jagodic -canonical_url: https://techhub.p-m.si/insights/introducing-decap-cms ---- -We are proud to introduce Decap CMS, the [rebranded version of Netlify CMS](https://www.netlify.com/blog/netlify-cms-to-become-decap-cms/). We took this step because we didn't like that this awesome project was slowly dying, and we wanted to ensure that it would continue to be supported and improved. - -We love Netlify CMS for multiple reasons. Its ease of configuration and how simple it is for editors to use. Additionally it ships with lots of features and is highly customisable. It is also an integral part of the great Jamstack and open source community. - -As the new maintainers of Decap CMS, our plan is to continue on the premise of a simple, easy-to-use, open source, git-based CMS. We are excited about the potential for this type of product and we strive that it remains a viable option for developers and editors alike. - -First we plan to solve deprecation issues, then we will evaluate what are the next chapters for Decap. In the mean time, we will appreciate any contributions in form of pull requests, issues and discussions on GitHub. - -We understand that there may be some growing pains as we transition to being the maintainers of this project, but please bear with us as we try to bring this project from the dead. We are excited to continue developing and improving Decap CMS with your help! - -We would like to thank Netlify for entrusting us with the Netlify CMS project. We are excited and grateful for this opportunity. - -Team of maintainers at [PM](https://techhub.p-m.si/) diff --git a/website/content/blog/march-23-status-update.md b/website/content/blog/march-23-status-update.md deleted file mode 100644 index 10e263d7c379..000000000000 --- a/website/content/blog/march-23-status-update.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: March 2023 Status Update -description: >- - Updating Slate, fixing Cypress tests, and preparing for the first PR -date: 2023-03-31T08:00:00.000Z -author: Anže Demšar ---- -We took over this project a month ago and although there were not many commits to the main repository, we have been working on the project under the hood. We want the first Decap release to be a drop-in replacement, and we want to make sure that it works. - -We figured that the only way to upgrade libraries and not make breaking changes is to make the tests pass without changing any conditions. Very soon it also became clear that in order to do that, Slate will have to be upgraded and this is the rabbit hole that I am now slowly crawling out of. - -Slate was rewritten from scratch a few years ago and there were more and more problems with the deprecated version that Decap is using. These bugs also destroyed any possibilities of Cypress tests going through. - -The good news is that the serialization process was Slate -> Remark -> Markdown, so we only had to change the Slate -> Remark part and renderers. The bad news is that toolbar button functionalities (including lists) are no longer part of the base editor and we had to do this part on our own (we have considered some of the existing list plugins, but none of them seemed to be close to the one that Decap is currently using). - -I am now at a working version that passes all but two markdown tests. I suspect Cypress for one, the other one is a shortcode. After that, the code needs a huge refactor, and then (after our internal review) I will open a pull request. - -When the PR is ready, I’d love for invested contributors to review the code so that the update is reliable. This merge will open the possibilities for any kind of other contributions that we all want to see. - -We will then comb through the open PRs and merge what is beneficial. After that, my personal favorites would be moving the codebase to Typescript, changing components from class to functional, and supporting the ongoing UI efforts as much as possible. diff --git a/website/content/blog/moving-to-discord.md b/website/content/blog/moving-to-discord.md deleted file mode 100644 index 24dc9be316d3..000000000000 --- a/website/content/blog/moving-to-discord.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: Moving to Discord -description: >- - We are migrating our community chat from Slack to Discord -date: 2023-03-01T10:30:00.000Z -author: Martin Jagodic ---- -During the transition period, we will be active on both services, and Slack will remain open until it dies off. This decision was based on the fact that when we took over, the most requested feature on Slack was to migrate to Discord, and we were already considering it ourselves. - -Here is the [Discord invite link](https://discord.gg/KZRDXmTm9v). - -Slack is not ideal because messages disappear and invite links expire after 30 days. Additionally, it is a walled garden, where you need a separate account for each workspace. This is good for companies but bad for communities. - -Discord is a great alternative because messages stay forever, and the invite link does not expire. It is open to everyone and is therefore more accessible. A lot of open source communities rely on it, so it will be a familiar service for many. - -This solves community chat problem, but the problem of a public forum still remains. We are considering using Discourse because it is a great platform, and Netlify Answers' CMS subforum is already on Discourse. Hopefully this means that we could transfer all that knowledge to the new instance. - -If you have any suggestions on how to structure the Discord server, tell us on Discord 💬 - diff --git a/website/content/blog/software-reviews-gold-medal-2023.md b/website/content/blog/software-reviews-gold-medal-2023.md deleted file mode 100644 index 5d85a3c4b101..000000000000 --- a/website/content/blog/software-reviews-gold-medal-2023.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: Decap Receives Software Reviews Gold Medal for 2023 -author: Martin Jagodic -description: Decap has been named a top content marketing tool in the Software - Reviews Content Marketing Data Quadrant Awards for 2023. -image: /img/sr-gold_medal-2023.png -date: 2023-05-15T08:00:00.000Z ---- -Decap (ex-Netlify CMS) has been recognized as a top content marketing tool in the 2023 Software Reviews Content Marketing Data Quadrant Awards. With a score of 9.1 out of 10 and 100% user satisfaction, Decap proves its value in enhancing content marketing workflows. - -
- - Software Reviews Gold Medal 2023 - -
- -The Software Reviews Awards evaluate tools based on user feedback. Decap's high score and unanimous approval demonstrate its effectiveness in meeting user needs. - -According to users, Decap CMS stands out for its intuitive interface, robust and extensive features, and good collaboration among content teams. Real-time previews and integration with git streamline workflows, leading to increased productivity and smoother content creation and editing processes. The tool's extensive content publishing capabilities enable businesses to distribute content across various channels and tailor it to target audiences. This customization maximizes engagement and drives better results. - -This award belongs to the community that built this tool over the years. For us (the new maintainers) this proves that we are responsible for an awesome tool and it gives us motivation to keep it alive and kicking. diff --git a/website/content/docs/access-your-content.md b/website/content/docs/access-your-content.md deleted file mode 100644 index 44ec1b393e96..000000000000 --- a/website/content/docs/access-your-content.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -group: Add -weight: 5 -title: 4. Access Your Content ---- - -Your site CMS is now fully configured and ready for login! - -If you set your registration preference to "Invite only," invite yourself (and anyone else you choose) as a site user. To do this, select the **Identity** tab from your site dashboard, and then select the **Invite users** button. Invited users receive an email invitation with a confirmation link. Clicking the link will take you to your site with a login prompt. - -If you left your site registration open, or for return visits after confirming an email invitation, access your site's CMS at `yoursite.com/admin/`. - -**Note:** No matter where you access Decap CMS — whether running locally, in a staging environment, or in your published site — it always fetches and commits files in your hosted repository (for example, on GitHub), on the branch you configured in your Decap CMS `config.yml` file. - -This means: - -- Content fetched in the admin UI matches the content in the repository, which may be different from your locally running site. -- Content saved using the admin UI saves directly to the hosted repository, even if you're running the UI locally or in staging. diff --git a/website/content/docs/architecture.md b/website/content/docs/architecture.md deleted file mode 100755 index 0c276d8d4bf7..000000000000 --- a/website/content/docs/architecture.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: Architecture -position: 90 -group: Contributing -weight: 200 ---- - -Decap CMS is a React application, using Redux for state management with immutable data structures (immutable.js). - -The core abstractions for content editing are `collections`, `entries`, and `widgets`. - -* Each `collection` represents a group of entries. This might be similar entries which share the same structure, or entries where each has its own structure. -* The structure of an `entry` is defined as a series of fields, each with a `name`, a `label`, and a `widget`. -* The `widget` determines the UI widget that the content editor will use when editing this field of an entry, as well as how the content of the field is presented in the editing preview. - -Entries are loaded and persisted through a `backend` that will typically represent a `git` repository. - -## State shape / reducers - -- **Auth:** Keeps track of the logged state and the current user. - -- **Config:** Holds the environment configuration (backend type, available collections, and fields). - -- **Collections:** List of available collections, their fields, and metadata information. - -- **Entries:** Entries for each field. - -- **EntryDraft:** Reused for each entry that is edited or created. It holds the entry's temporary data until it's persisted on the backend. - -## Selectors -Selectors are functions defined within reducers used to compute derived data from the Redux store. The available selectors are: - - -- **`selectEntry`:** Selects a single entry, given the collection and a slug. - -- **`selectEntries`:** Selects all entries for a given collection. - -- **`getAsset`:** Selects a single `AssetProxy` object for the given path. - -## Value Objects -**`AssetProxy`:** `AssetProxy` is a Value Object that holds information regarding an asset file (for example, an image), whether it's persisted online or held locally in cache. - -For a file persisted online, the `AssetProxy` only keeps information about its URI. For local files, the AssetProxy will keep a reference to the actual `File` object while generating the expected final URIs and on-demand blobs for local preview. - -The `AssetProxy` object can be used directly inside a media tag (such as ``), as it will always return something that can be used by the media tag to render correctly (either the URI for the online file or a single-use blob). - -## Components structure and Workflows -Components are separated into two main categories: **Container components** and **Presentational components**. - -### Entry Editing -For either updating an existing entry or creating a new one, the `EntryEditor` is used and the flow is the same: - -* When mounted, the `EntryPage` container component dispatches the `createDraft` action, setting the `entryDraft` state to a blank state (in case of a new entry) or to a copy of the selected entry (in case of an edit). -* The `EntryPage` will also render widgets for each field type in the given entry. -* Widgets are used for editing entry fields. There are different widgets for different field types, and they are always defined in a pair containing a `control` component and a `preview` component. The control component is responsible for presenting the user with the appropriate interface for manipulating the current field value. The preview component is responsible for displaying the value with the appropriate styling. - -#### Widget components implementation -The control component receives one (1) callback as a prop: `onChange`. - -* **`onChange`** (required): Should be called when the users changes the current value. It will ultimately end up updating the `EntryDraft` object in the Redux Store, thus updating the preview component. -* **`onAddAsset`** & **`onRemoveAsset`** (optionals): Should be invoked with an `AssetProxy` value object if the field accepts file uploads for media (images, for example). `onAddAsset` will get the current media stored in the Redux state tree while `onRemoveAsset` will remove it. `AssetProxy` objects are stored in the `Medias` object and referenced in the `EntryDraft` object on the state tree. - -Both control and preview widgets receive a `getAsset` selector via props. Displaying the media (or its URI) for the user should always be done via `getAsset`, as it returns an `AssetProxy` that can return the correct value for both medias already persisted on the server and cached media not yet uploaded. - -The actual persistence of the content and medias inserted into the control component is delegated to the backend implementation. The backend will be called with the updated values and a list of `assetProxy` objects for each field of the entry, and should return a promise that can resolve into the persisted entry object and the list of the persisted media URIs. - - -## Editorial Workflow implementation - -Instead of adding logic to `CollectionPage` and `EntryPage`, the Editorial Workflow is implemented as Higher Order Components, adding UI and dispatching additional actions. - -Furthermore, all editorial workflow state is managed in Redux; there's an `actions/editorialWorkflow.js` file and a `reducers/editorialWorkflow.js` file. - -### About metadata - -Decap CMS embraces the idea of Git-as-backend for storing metadata. The first time it runs with the `editorial_workflow` setup, it creates a new ref called `meta/_decap_cms`, pointing to an empty, orphan tree. - -Actual data are stored in individual `json` files committed to this tree. diff --git a/website/content/docs/azure-backend.md b/website/content/docs/azure-backend.md deleted file mode 100644 index 6e7f3f5882bb..000000000000 --- a/website/content/docs/azure-backend.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -group: Accounts -weight: 20 -title: Azure ---- - -For repositories stored on Azure, the `azure` backend allows CMS users to log in directly with their Azure account. Note that all users must have write access to your content repository for this to work. - -In order to get Decap CMS working with Azure DevOps, you need a Tenant Id and an Application Id. - -1. If you do not have an Azure account, [create one here](https://azure.microsoft.com/en-us/free/?WT.mc_id=A261C142F) and make sure to have a credit card linked to the account. -2. If you do not have an Azure Active Directory Tenant Id, [set one up here](https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-create-new-tenant). -3. [Register an application with Azure AD](https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app). Configure it as a Single tenant Web application and add a redirect URI (e.g. `http://localhost:8080/`) -4. Add the `Azure DevOps->user_impersonation` [permission](https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-configure-app-access-web-apis#add-permissions-to-access-your-web-api) for the created application. -5. [Grant admin consent](https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-configure-app-access-web-apis#admin-consent-button) for the application. -6. Under `Authentication->Implicit grant` enable [Access tokens](https://docs.microsoft.com/en-us/azure/active-directory/develop/access-tokens) for the application and click `Save`. -7. Verify your Azure DevOps organization is connected to the same directory as your tenant under: `https://dev.azure.com//_settings/organizationAad` -8. Add the following lines to your Decap CMS `config.yml` file: - -```yaml -backend: - name: azure - repo: organization/project/repo # replace with actual path - tenant_id: tenantId # replace with your tenantId - app_id: appId # replace with your appId -``` - -### Limitations - -1. Pagination is not supported so some endpoints might return missing data - -2. Nested collection are partially supported as Azure doesn't allow [renaming and editing](https://docs.microsoft.com/en-us/rest/api/azure/devops/git/pushes/create?view=azure-devops-rest-6.1&source=docs#rename-a-file) in a single operation diff --git a/website/content/docs/backends-overview.md b/website/content/docs/backends-overview.md deleted file mode 100644 index de88391802d8..000000000000 --- a/website/content/docs/backends-overview.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -group: Accounts -weight: 1 -title: Overview ---- - -A backend is JavaScript code that allows Decap CMS to communicate with a service that stores content - typically a Git host like GitHub or GitLab. It provides functions that Decap CMS can use to do things like read and update files using API's provided by the service. - -## Backend Configuration - -Individual backends should provide their own configuration documentation, but there are some configuration options that are common to multiple backends. A full reference is below. Note that these are properties of the `backend` field, and should be nested under that field. - -| Field | Default | Description | -| --------------- | -------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- | -| `repo` | none | **Required** for `github`, `gitlab`, `azure`, `gitea` and `bitbucket` backends; ignored by `git-gateway`. Follows the pattern `[org-or-username]/[repo-name]`. | -| `branch` | `master` | The branch where published content is stored. All CMS commits and PRs are made to this branch. | -| `api_root` | `https://api.github.com` (GitHub), `https://gitlab.com/api/v4` (GitLab), `https://try.gitea.io/api/v1` (Gitea) or `https://api.bitbucket.org/2.0` (Bitbucket) | The API endpoint. Only necessary in certain cases, like with GitHub Enterprise or self-hosted GitLab/Gitea. | -| `site_domain` | `location.hostname` (or `cms.netlify.com` when on `localhost`) | Sets the `site_id` query param sent to the API endpoint. Non-Netlify auth setups will often need to set this for local development to work properly. | -| `base_url` | `https://api.netlify.com` (GitHub, Bitbucket), `https://gitlab.com` (GitLab) or `https://try.gitea.io` (Gitea) | OAuth client hostname (just the base domain, no path). **Required** when using an external OAuth server or self-hosted GitLab/Gitea. | -| `auth_endpoint` | `auth` (GitHub, Bitbucket) or `oauth/authorize` (GitLab) | Path to append to `base_url` for authentication requests. Optional. | -| `cms_label_prefix` | `decap-cms/` | Pull (or Merge) Requests label prefix when using editorial workflow. Optional. | - -## Creating a New Backend - -Anyone can write a backend, but we don't yet have a finalized and documented API. If you would like to write your own backend for a service that does not have one currently, we recommend using the [GitHub backend](https://github.com/decaporg/decap-cms/tree/master/packages/decap-cms-backend-github) as a reference for API and best practices. diff --git a/website/content/docs/basic-steps.md b/website/content/docs/basic-steps.md deleted file mode 100644 index 108bfc5e96db..000000000000 --- a/website/content/docs/basic-steps.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: Basic Steps -group: Add -weight: 1 ---- - -This tutorial guides you through the steps for adding Decap CMS to a site that's built with a common [static site generator](https://www.staticgen.com/), like Jekyll, Hugo, Hexo, or Gatsby. -Alternatively, you can [start from a template](/docs/start-with-a-template) or dive right into [configuration options](/docs/configuration-options). The process for adding Decap CMS to a static site can be divided into four main steps: - -**1. Install Decap CMS** - -This is a single page app available at the `/admin` route of your website. -Check out the [general overview](/docs/intro/) to see what the installation process entails. - -**2. Choosing a Backend** - -The most common backends are GitHub, GitLab, Bitbucket, and Azure. The backend serves two purpose: Secure access to your website's Decap CMS and allows it to read and update content files in your git repo. More information about configuring the backend can be found [here](/docs/backends-overview/). - -If you are experimenting with Decap CMS or developing, you can connect to it via a [local Git repository instead](/docs/working-with-a-local-git-repository/) of a remote backend. - -**3. Configure Decap CMS** - -The basic configuration includes required information like Git backend provider, branch, and collections to save files to. -It is recommended to start simple as possible. Once you've gotten the hang of it, you can edit your `config.yml` file to -build whatever collections and content modeling you want. - -Check out the [Configuration Options](/docs/configuration-options/) page for full details about all available options. - -**4. Access Your Content** - -Decap CMS manages your content and provides editorial and admin features via a webpage in a browser, but it doesn't deliver content. Decap CMS only makes your content available through an API. It is up to developers to determine how to build the raw content into something useful and delightful on the frontend within your static site generator. - -
- -

- If you are ready to get started, proceed to step 1. -

-
diff --git a/website/content/docs/bitbucket-backend.md b/website/content/docs/bitbucket-backend.md deleted file mode 100644 index 035134181fd8..000000000000 --- a/website/content/docs/bitbucket-backend.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -group: Accounts -weight: 20 -title: Bitbucket ---- -For repositories stored on Bitbucket, the `bitbucket` backend allows CMS users to log in directly with their Bitbucket account. Note that all users must have write access to your content repository for this to work. - -To enable it: - -1. Follow the authentication provider setup steps in the [Netlify docs](https://www.netlify.com/docs/authentication-providers/#using-an-authentication-provider). -2. Add the following lines to your Decap CMS `config.yml` file: - - ```yaml - backend: - name: bitbucket - repo: owner-name/repo-name # Path to your Bitbucket repository - ``` - -### Client-Side Implicit Grant (Bitbucket) - -With Bitbucket's Implicit Grant, users can authenticate with Bitbucket directly from the client. To do this: - -1. Follow the [Atlassian docs](https://confluence.atlassian.com/bitbucket/oauth-on-bitbucket-cloud-238027431.html) to create an OAuth consumer. Make sure you allow `Account/Read` and `Repository/Write` permissions. To use the [Editorial Workflow](https://www.decapcms.org/docs/configuration-options/#publish-mode), allow `PullRequests/Write` permissions. For the **Callback URL**, enter the address where you access Decap CMS, for example, `https://www.mysite.com/admin/`. -2. Bitbucket gives you a **Key**. Copy this Key and enter it in your Decap CMS `config.yml` file, along with the following settings: - - ```yaml - backend: - name: bitbucket - repo: owner-name/repo-name - branch: default - auth_type: implicit - app_id: # The Key from your Bitbucket settings - ``` - -**Warning:** With Bitbucket implicit grant, the authentication is valid for 1 hour only. After that, the user has to login again, **which can lead to data loss** if the expiration occurs while content is being edited. diff --git a/website/content/docs/choosing-a-backend.md b/website/content/docs/choosing-a-backend.md deleted file mode 100644 index fe470febcbda..000000000000 --- a/website/content/docs/choosing-a-backend.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -group: Add -weight: 3 -title: 2. Choosing a Backend ---- - -Now that you have your Decap CMS files in place and configured, all that's left is to enable authentication. We're using the [Netlify](https://www.netlify.com/) platform here because it's one of the quickest ways to get started, but you can learn about other authentication options in the [Backends](/docs/backends-overview) doc. - -### Setup on Netlify - -Netlify offers a built-in authentication service called Identity. In order to use it, connect your site repo with Netlify. Netlify has published a general [Step-by-Step Guide](https://www.netlify.com/blog/2016/10/27/a-step-by-step-guide-deploying-a-static-site-or-single-page-app/) for this, along with detailed guides for many popular static site generators, including [Jekyll](https://www.netlify.com/blog/2015/10/28/a-step-by-step-guide-jekyll-3.0-on-netlify/), [Hugo](https://www.netlify.com/blog/2016/09/21/a-step-by-step-guide-victor-hugo-on-netlify/), [Hexo](https://www.netlify.com/blog/2015/10/26/a-step-by-step-guide-hexo-on-netlify/), [Middleman](https://www.netlify.com/blog/2015/10/01/a-step-by-step-guide-middleman-on-netlify/), [Gatsby](https://www.netlify.com/blog/2016/02/24/a-step-by-step-guide-gatsby-on-netlify/), and more. - -### Enable Identity and Git Gateway - -Netlify's Identity and Git Gateway services allow you to manage CMS admin users for your site without requiring them to have an account with your Git host or commit access on your repo. From your site dashboard on Netlify: - -1. Go to **Settings > Identity**, and select **Enable Identity service**. -2. Under **Registration preferences**, select **Open** or **Invite only**. In most cases, you want only invited users to access your CMS, but if you're just experimenting, you can leave it open for convenience. -3. If you'd like to allow one-click login with services like Google and GitHub, check the boxes next to the services you'd like to use, under **External providers**. -4. Scroll down to **Services > Git Gateway**, and click **Enable Git Gateway**. This authenticates with your Git host and generates an API access token. In this case, we're leaving the **Roles** field blank, which means any logged in user may access the CMS. For information on changing this, check the [Netlify Identity documentation](https://www.netlify.com/docs/identity/). - -### Add the Netlify Identity Widget - -With the backend configured to handle authentication, now you need a frontend interface to connect to it. The open source Netlify Identity Widget is a drop-in widget made for just this purpose. To include the widget in your site, add the following script tag in two places: - -```html - -``` - -Add this to the `` of your CMS index page at `/admin/index.html`, as well as the `` of your site's main index page. Depending on how your site generator is set up, this may mean you need to add it to the default template, or to a "partial" or "include" template. If you can find where the site stylesheet is linked, that's probably the right place. Alternatively, you can include the script in your site using Netlify's [Script Injection](https://www.netlify.com/docs/inject-analytics-snippets/) feature. - -When a user logs in with the Netlify Identity widget, an access token directs to the site homepage. In order to complete the login and get back to the CMS, redirect the user back to the `/admin/` path. To do this, add the following script before the closing `body` tag of your site's main index page: - -```html - -``` - -**Note:** This example script requires modern JavaScript and does not work on IE11. For legacy browser support, use function expressions (`function () {}`) in place of the arrow functions (`() => {}`), or use a transpiler such as [Babel](https://babeljs.io/). - - -
- -

- Once this is completed, proceed to step 3. -

-
diff --git a/website/content/docs/cloudinary.md b/website/content/docs/cloudinary.md deleted file mode 100644 index e992c550c45e..000000000000 --- a/website/content/docs/cloudinary.md +++ /dev/null @@ -1,136 +0,0 @@ ---- -title: Cloudinary -group: Media -weight: 10 ---- -Cloudinary is a digital asset management platform with a broad feature set, including support for responsive image generation and url based image transformation. They also provide a powerful media library UI for managing assets, and tools for organizing your assets into a hierarchy. - -The Cloudinary media library integration for Decap CMS uses Cloudinary's own media library interface within Decap CMS. To get started, you'll need a Cloudinary account and Decap CMS 2.3.0 or greater. - -## Creating a Cloudinary Account - -You can [sign up for Cloudinary](https://cloudinary.com/users/register/free) for free. Once you're logged in, you'll need to retrieve your Cloud name and API key from the upper left corner of the Cloudinary console. - -![Cloudinary console screenshot](/img/cloudinary-console-details.png) - -## Connecting Cloudinary to Decap CMS - -To use the Cloudinary media library within Decap CMS, you'll need to update your Decap CMS configuration file with the information from your Cloudinary account: - -```yaml -media_library: - name: cloudinary - config: - cloud_name: your_cloud_name - api_key: your_api_key -``` - -**Note:** The user must be logged in to the Cloudinary account connected to the `api_key` used in your Decap CMS configuration. - -**Note:** The Decap CMS media library extensions for Cloudinary are not included in `decap-cms-app`. If you're using `decap-cms-app`, you'll need to register the media libraries yourself. - -### Security Considerations -Although this setup exposes the `cloud_name` and `api_key` publicly via the `/admin/config.yml` endpoint, this information is not sensitive. Any integration of the Cloudinary media library requires this information to be exposed publicly. To use this library or use the restricted Cloudinary API endpoints, the user must have access to the Cloudinary account login details or the `api_secret` associated with the `cloud_name` and `api_key`. - -## Decap CMS configuration options - -The following options are specific to the Decap CMS integration for Cloudinary: - -* **`output_filename_only`**: _(default: `false`)_\ - By default, the value provided for a selected image is a complete URL for the asset on Cloudinary's CDN. Setting `output_filename_only` to `true` will instead produce just the filename (e.g. `image.jpg`). This should be `true` if you will be directly embedding cloudinary transformation urls in page templates. Refer to [Inserting Cloudinary URL in page templates](#inserting-cloudinary-url-in-page-templates). -* **`use_transformations`**: _(default: `true`)_\ - If `true`, uses derived url when available (the url will have image transformation segments included). Has no effect if `output_filename_only` is set to `true`. -* **`use_secure_url`**: _(default: `true`)_\ - Controls whether an `http` or `https` URL is provided. Has no effect if `output_filename_only` is set to `true`. - -## Cloudinary configuration options - -The following options are used to configure the media library. All options are listed in Cloudinary's [media library documentation](https://cloudinary.com/documentation/media_library_widget#3_set_the_configuration_options), but only options listed below are available or recommended for the Decap CMS integration: - -### Authentication - -* `cloud_name` -* `api_key` - -### Media library behavior - -* `default_transformations` _\- only the first [image transformation](#image-transformations) is used, be sure to use the `SDK Parameter` column transformation names from the_ [_transformation reference_](https://cloudinary.com/documentation/image_transformation_reference) -* `max_files` _\- has no impact on images inside the [markdown widget](/docs/widgets/#markdown)_. Refer to [media library documentation](https://cloudinary.com/documentation/media_library_widget#3_set_the_configuration_options) for details on this property -* `multiple` _\- has no impact on images inside the [markdown widget](/docs/widgets/#markdown)_. Refer to [media library documentation](https://cloudinary.com/documentation/media_library_widget#3_set_the_configuration_options) for details on this property - -## Image transformations - -The Cloudinary integration allows images to be transformed in two ways: directly within Decap CMS via [Cloudinary's Media Library](#transforming-images-via-media-library), and separately from the CMS via Cloudinary's [dynamic URL's](https://cloudinary.com/documentation/image_transformations#delivering_media_assets_using_dynamic_urls) by [inserting cloudinary urls](#inserting-cloudinary-url-in-page-templates). - -### Transforming images via Media Library -If you transform and insert images from within the Cloudinary media library, the transformed image URL will be output by default. This gives the editor complete freedom to make changes to the image output. -There are two ways to configure image transformation via media library - [globally](#global-configuration) and per [field](#field-configuration). Global options will be overridden by field options. - -#### Global configuration - -Global configuration, which is meant to affect the Cloudinary widget at all times, can be provided -as seen below, under the primary `media_library` property. Settings applied here will affect every -instance of the Cloudinary widget. - -```yaml -# global -media_library: - name: cloudinary - output_filename_only: false - config: - default_transformations: - - - fetch_format: auto - width: 160 - quality: auto - crop: scale -``` - -#### Field configuration - -Configuration can also be provided for individual fields that use the media library. The structure -is very similar to the global configuration, except the settings are added to an individual `field`. -For example: - -```yaml -# field -fields: # The fields each document in this collection have -- label: 'Cover Image' - name: 'image' - widget: 'image' - required: false - tagname: '' - media_library: - config: - default_transformations: - - - fetch_format: auto - width: 300 - quality: auto - crop: fill - effect: grayscale -``` - -## Inserting Cloudinary URL in page templates - -If you prefer to provide direction so that images are transformed in a specific way, or dynamically retrieve images based on viewport size, you can do so by providing your own base Cloudinary URL and only storing the asset filenames in your content: - -* Either globally or for specific fields, configure the Cloudinary extension to only output the asset filename - -```yaml -# global -media_library: - name: cloudinary - output_filename_only: true -# field -media_library: - name: cloudinary - output_filename_only: true -``` - -* Provide a dynamic URL in the site template - -```handlebars -{{! handlebars example }} - -``` - -Your dynamic URL can be formed conditionally to provide any desired transformations - please see Cloudinary's [image transformation reference](https://cloudinary.com/documentation/image_transformation_reference) for available transformations. diff --git a/website/content/docs/collection-file.md b/website/content/docs/collection-file.md deleted file mode 100644 index be85dbee2f2a..000000000000 --- a/website/content/docs/collection-file.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -group: Collections -weight: 20 -title: File Collections ---- - -Collections with type `files` displays in the left sidebar of the Content page of the editor UI along with other types. - -A `files` collection contains one or more uniquely configured files. Unlike items in `folder` collections, which repeat the same configuration over all files in the folder, each item in a `files` collection has an explicitly set path, filename, and configuration. This can be useful for unique files with a custom set of fields, like a settings file or a custom landing page with a unique content structure. - -When configuring a `files` collection, configure each file in the collection separately, and list them under the `files` field of the collection. Each file has its own list of `fields` and a unique filepath specified in the `file` field (relative to the base of the repo). - -**Note:** Files listed in a file collection must already exist in the hosted repository branch set in your Decap CMS [backend configuration](/docs/backends-overview). Files must also have a valid value for the file type. For example, an empty file works as valid YAML, but a JSON file must have a non-empty value to be valid, such as an empty object. - -Example: - -```yaml -collections: - - label: "Pages" - name: "pages" - files: - - label: "About Page" - name: "about" - file: "site/content/about.yml" - fields: - - {label: Title, name: title, widget: string} - - {label: Intro, name: intro, widget: markdown} - - label: Team - name: team - widget: list - fields: - - {label: Name, name: name, widget: string} - - {label: Position, name: position, widget: string} - - {label: Photo, name: photo, widget: image} - - label: "Locations Page" - name: "locations" - file: "site/content/locations.yml" - fields: - - {label: Title, name: title, widget: string} - - {label: Intro, name: intro, widget: markdown} - - label: Locations - name: locations - widget: list - fields: - - {label: Name, name: name, widget: string} - - {label: Address, name: address, widget: string} -``` - diff --git a/website/content/docs/collection-folder.md b/website/content/docs/collection-folder.md deleted file mode 100644 index 695e699d8964..000000000000 --- a/website/content/docs/collection-folder.md +++ /dev/null @@ -1,152 +0,0 @@ ---- -group: Collections -weight: 10 -title: Folder Collections ---- - -Collections with type `folder` displays in the left sidebar of the Content page of the editor UI along with other types. - -Folder collections represent one or more files with the same format, fields, and configuration options, all stored within the same folder in the repository. You might use a folder collection for blog posts, product pages, author data files, etc. - -Unlike file collections, folder collections have the option to allow editors to create new items in the collection. This is set by the boolean `create` field. - -Folder collections must have at least one field with the name `title` for creating new entry slugs. That field should use the default `string` widget. The `label` for the field can be any string value. If you wish to use a different field as your identifier, set `identifier_field` to the field name. See the [Collections reference doc](/docs/configuration-options/#collections) for details on how collections and fields are configured. If you forget to add this field, you will get an error that your collection "must have a field that is a valid entry identifier". - -Example: - -```yaml -collections: - - label: "Blog" - name: "blog" - folder: "_posts/blog" - create: true - fields: - - {label: "Title", name: "title", widget: "string"} - - {label: "Publish Date", name: "date", widget: "datetime"} - - {label: "Featured Image", name: "thumbnail", widget: "image"} - - {label: "Body", name: "body", widget: "markdown"} -``` - -With `identifier_field`: - -```yaml -- label: "Blog" - name: "blog" - folder: "_posts/blog" - create: true - identifier_field: name - fields: - - {label: "Name", name: "name", widget: "string"} - - {label: "Publish Date", name: "date", widget: "datetime"} - - {label: "Featured Image", name: "thumbnail", widget: "image"} - - {label: "Body", name: "body", widget: "markdown"} -``` - -### Filtered Folder Collections - -The entries for any folder collection can be filtered based on the value of a single field. By filtering a folder into different collections, you can manage files with different fields, options, extensions, etc. in the same folder. - -The `filter` option requires two fields: - -* `field`: The name of the collection field to filter on. -* `value`: The desired field value. - -The example below creates two collections in the same folder, filtered by the `language` field. The first collection includes posts with `language: en`, and the second, with `language: es`. - -```yaml -collections: - - label: "Blog in English" - name: "english_posts" - folder: "_posts" - create: true - filter: {field: "language", value: "en"} - fields: - - {label: "Language", name: "language", widget: "select", options: ["en", "es"]} - - {label: "Title", name: "title", widget: "string"} - - {label: "Content", name: "body", widget: "markdown"} - - label: "Blog en Español" - name: "spanish_posts" - folder: "_posts" - create: true - filter: {field: "language", value: "es"} - fields: - - {label: "Lenguaje", name: "language", widget: "select", options: ["en", "es"]} - - {label: "Titulo", name: "title", widget: "string"} - - {label: "Contenido", name: "body", widget: "markdown"} -``` - - -### Folder Collections Path - -By default the CMS stores folder collection content under the folder specified in the collection setting. - -For example configuring `folder: posts` for a collection will save the content under `posts/post-title.md`. - -You can now specify an additional `path` template (similar to the `slug` template) to control the content destination. - -This allows saving content in subfolders, e.g. configuring `path: '{{year}}/{{slug}}'` will save the content under `posts/2019/post-title.md`. - -### Media and Public Folder - -By default the CMS stores media files for all collections under a global `media_folder` directory as specified in the configuration. - -When using the global `media_folder` directory any entry field that points to a media file will use the absolute path to the published file as designated by the `public_folder` configuration. - -For example configuring: - -```yaml -media_folder: static/media -public_folder: /media -``` - -And saving an entry with an image named `image.png` will result in the image being saved under `static/media/image.png` and relevant entry fields populated with the value of `/media/image.png`. - -Some static site generators (e.g. Gatsby) work best when using relative image paths. - -This can now be achieved using a per collection `media_folder` configuration which specifies a relative media folder for the collection. - -For example, the following configuration will result in media files being saved in the same directory as the entry, and the image field being populated with the relative path to the image. - -```yaml -media_folder: static/media -public_folder: /media -collections: - - name: posts - label: Posts - label_singular: 'Post' - folder: content/posts - path: '{{slug}}/index' - media_folder: '' - public_folder: '' - fields: - - label: Title - name: title - widget: string - - label: 'Cover Image' - name: 'image' - widget: 'image' -``` - -More specifically, saving an entry with a title of `example post` with an image named `image.png` will result in a directory structure of: - -```bash -content - posts - example-post - index.md - image.png -``` - -And for the image field being populated with a value of `image.png`. - -**Note: When specifying a `path` on a folder collection, `media_folder` defaults to an empty string.** - -**Available template tags:** - -Supports all of the [`slug` templates](/docs/configuration-options#slug) and: - -* `{{dirname}}` The path to the file's parent directory, relative to the collection's `folder`. -* `{{filename}}` The file name without the extension part. -* `{{extension}}` The file extension. -* `{{media_folder}}` The global `media_folder`. -* `{{public_folder}}` The global `public_folder`. diff --git a/website/content/docs/collection-nested.md b/website/content/docs/collection-nested.md deleted file mode 100644 index 9c31ec9a91b4..000000000000 --- a/website/content/docs/collection-nested.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -group: Collections -weight: 30 -title: Nested Collections (beta) ---- - -There is beta support for Folder Collections which can also handle `nested` folder structures. - -Nested collections is a beta feature that allows a folder collection to show a nested structure of entries and edit the locations of the entries. This feature is useful when you have a complex folder structure and may not want to create separate collections for every directory. As it is in beta, please use with discretion. - -Example configuration: - -```yaml -collections: - - name: pages - label: Pages - label_singular: 'Page' - folder: content/pages - create: true - # adding a nested object will show the collection folder structure - nested: - depth: 100 # max depth to show in the collection tree - summary: '{{title}}' # optional summary for a tree node, defaults to the inferred title field - fields: - - label: Title - name: title - widget: string - - label: Body - name: body - widget: markdown - # adding a meta object with a path property allows editing the path of entries - # moving an existing entry will move the entire sub tree of the entry to the new location - meta: { path: { widget: string, label: 'Path', index_file: 'index' } } -``` - -Nested collections expect the following directory structure: - -```bash -content -└── pages - ├── authors - │ ├── author-1 - │ │ └── index.md - │ └── index.md - ├── index.md - └── posts - ├── hello-world - │ └── index.md - └── index.md -``` diff --git a/website/content/docs/configuration-options.md b/website/content/docs/configuration-options.md deleted file mode 100644 index 68fbb4d6d675..000000000000 --- a/website/content/docs/configuration-options.md +++ /dev/null @@ -1,486 +0,0 @@ ---- -group: Configuration -weight: 10 -title: Configuration Options ---- -## Configuration File - -All configuration options for Decap CMS are specified in a `config.yml` file, in the folder where you access the editor UI (usually in the `/admin` folder). - -Alternatively, you can specify a custom config file using a link tag: - -```html - - -``` - -To see working configuration examples, you can [start from a template](../start-with-a-template) or check out the [CMS demo site](https://demo.decapcms.org). (No login required: click the login button and the CMS will open.) You can refer to the demo [configuration code](https://github.com/decaporg/decap-cms/blob/master/dev-test/config.yml) to see how each option was configured. - -You can find details about all configuration options below. Note that [YAML syntax](https://en.wikipedia.org/wiki/YAML#Basic_components) allows lists and objects to be written in block or inline style, and the code samples below include a mix of both. - -## Backend - -*This setting is required.* - -The `backend` option specifies how to access the content for your site, including authentication. Full details and code samples can be found in [Backends](/docs/backends-overview). - -**Note**: no matter where you access Decap CMS — whether running locally, in a staging environment, or in your published site — it will always fetch and commit files in your hosted repository (for example, on GitHub), on the branch you configured in your Decap CMS config.yml file. This means that content fetched in the admin UI will match the content in the repository, which may be different from your locally running site. It also means that content saved using the admin UI will save directly to the hosted repository, even if you're running the UI locally or in staging. If you want to have your local CMS write to a local repository, try the `local_backend` setting, [currently in beta](/docs/working-with-a-local-git-repository/). - -### Commit Message Templates - -You can customize the templates used by Decap CMS to generate commit messages by setting the `commit_messages` option under `backend` in your Decap CMS `config.yml`. - -Template tags wrapped in curly braces will be expanded to include information about the file changed by the commit. For example, `{{path}}` will include the full path to the file changed. - -Setting up your Decap CMS `config.yml` to recreate the default values would look like this: - -```yaml -backend: - commit_messages: - create: Create {{collection}} “{{slug}}” - update: Update {{collection}} “{{slug}}” - delete: Delete {{collection}} “{{slug}}” - uploadMedia: Upload “{{path}}” - deleteMedia: Delete “{{path}}” - openAuthoring: '{{message}}' -``` - -Decap CMS generates the following commit types: - -| Commit type | When is it triggered? | Available template tags | -| --------------- | ---------------------------------------- | ----------------------------------------------------------- | -| `create` | A new entry is created | `slug`, `path`, `collection`, `author-login`, `author-name` | -| `update` | An existing entry is changed | `slug`, `path`, `collection`, `author-login`, `author-name` | -| `delete` | An existing entry is deleted | `slug`, `path`, `collection`, `author-login`, `author-name` | -| `uploadMedia` | A media file is uploaded | `path`, `author-login`, `author-name` | -| `deleteMedia` | A media file is deleted | `path`, `author-login`, `author-name` | -| `openAuthoring` | A commit is made via a forked repository | `message`, `author-login`, `author-name` | - -Template tags produce the following output: - -* `{{slug}}`: the url-safe filename of the entry changed -* `{{collection}}`: the name of the collection containing the entry changed -* `{{path}}`: the full path to the file changed -* `{{message}}`: the relevant message based on the current change (e.g. the `create` message when an entry is created) -* `{{author-login}}`: the login/username of the author -* `{{author-name}}`: the full name of the author (might be empty based on the user's profile) - - -## Publish Mode - -By default, all entries created or edited in the Decap CMS are committed directly into the main repository branch. The `publish_mode` option allows you to enable [Editorial Workflow](/docs/editorial-workflows/) mode for more control over the content publishing phases. You can enable the Editorial Workflow with the following line in your Decap CMS `config.yml` file: - -```yaml -# /admin/config.yml -publish_mode: editorial_workflow -``` - - -## Media and Public Folders - -Decap CMS users can upload files to your repository using the Media Gallery. The following settings specify where these files are saved, and where they can be accessed on your built site. - -### Media Folder - -*This setting is required.* - -The `media_folder` option specifies the folder path where uploaded files should be saved, relative to the base of the repo. - -```yaml -media_folder: "static/images/uploads" -``` - -### Public Folder - -The `public_folder` option specifies the folder path where the files uploaded by the media library will be accessed, relative to the base of the built site. For fields controlled by \[file] or \[image] widgets, the value of the field is generated by prepending this path to the filename of the selected file. Defaults to the value of `media_folder`, with an opening `/` if one is not already included. - -```yaml -public_folder: "/images/uploads" -``` - -Based on the settings above, if a user used an image widget field called `avatar` to upload and select an image called `philosoraptor.png`, the image would be saved to the repository at `/static/images/uploads/philosoraptor.png`, and the `avatar` field for the file would be set to `/images/uploads/philosoraptor.png`. - -This setting can be set to an absolute URL e.g. `https://netlify.com/media` should you wish, however in general this is not advisable as content should have relative paths to other content. - -## Media Library - -Media library integrations are configured via the `media_library` property, and its value should be an object with at least a `name` property. A `config` property can also be used for options that should be passed to the library in use. - -**Example:** - -```yaml -media_library: - name: uploadcare - config: - publicKey: demopublickey -``` - -## Site URL - -The `site_url` setting should provide a URL to your published site. May be used by the CMS for various functionality. Used together with a collection's `preview_path` to create links to live content. - -**Example:** - -```yaml -site_url: https://your-site.com -``` - -## Display URL - -When the `display_url` setting is specified, the CMS UI will include a link in the fixed area at the top of the page, allowing content authors to easily return to your main site. The text of the link consists of the URL with the protocol portion (e.g., `https://your-site.com`). - -Defaults to `site_url`. - -**Example:** - -```yaml -display_url: https://your-site.com -``` - -## Custom Logo - -When the `logo_url` setting is specified, the CMS UI will change the logo displayed at the top of the login page, allowing you to brand the CMS with your own logo. `logo_url` is assumed to be a URL to an image file. - -**Example:** - -```yaml -logo_url: https://your-site.com/images/logo.svg -``` - -## Locale - -The CMS locale. - -Defaults to `en`. - -Other languages than English must be registered manually. - -**Example** - -In your `config.yml`: - -```yaml -locale: 'de' -``` - -And in your custom JavaScript code: - -```js -import CMS from 'decap-cms-app'; -import { de } from 'decap-cms-locales'; - -CMS.registerLocale('de', de); -``` - -When a translation for the selected locale is missing the English one will be used. - -> When importing `decap-cms` all locales are registered by default (so you only need to update your `config.yml`). - -## Show Preview Links - -[Deploy preview links](../deploy-preview-links) can be disabled by setting `show_preview_links` to `false`. - -**Example:** - -```yaml -show_preview_links: false -``` - -## Search - -The search functionally requires loading all collection(s) entries, which can exhaust rate limits on large repositories. -It can be disabled by setting the top level `search` property to `false`. - -Defaults to `true` - -**Example:** - -```yaml -search: false -``` - -## Slug Type - -The `slug` option allows you to change how filenames for entries are created and sanitized. It also applies to filenames of media inserted via the default media library.\ -For modifying the actual data in a slug, see the per-collection option below. - -`slug` accepts multiple options: - -* `encoding` - - * `unicode` (default): Sanitize filenames (slugs) according to [RFC3987](https://tools.ietf.org/html/rfc3987) and the [WHATWG URL spec](https://url.spec.whatwg.org/). This spec allows non-ASCII (or non-Latin) characters to exist in URLs. - * `ascii`: Sanitize filenames (slugs) according to [RFC3986](https://tools.ietf.org/html/rfc3986). The only allowed characters are (0-9, a-z, A-Z, `_`, `-`, `~`). -* `clean_accents`: Set to `true` to remove diacritics from slug characters before sanitizing. This is often helpful when using `ascii` encoding. -* `sanitize_replacement`: The replacement string used to substitute unsafe characters, defaults to `-`. - -**Example** - -```yaml -slug: - encoding: "ascii" - clean_accents: true - sanitize_replacement: "_" -``` - -## Collections - -*This setting is required.* - -The `collections` setting is the heart of your Decap CMS configuration, as it determines how content types and editor fields in the UI generate files and content in your repository. Each collection you configure displays in the left sidebar of the Content page of the editor UI, in the order they are entered into your Decap CMS `config.yml` file. - -`collections` accepts a list of collection objects, each with the following options: - -* `name` (required): unique identifier for the collection, used as the key when referenced in other contexts (like the [relation widget](../widgets/#relation)) -* `identifier_field`: see detailed description below -* `label`: label for the collection in the editor UI; defaults to the value of `name` -* `label_singular`: singular label for certain elements in the editor; defaults to the value of `label` -* `description`: optional text, displayed below the label when viewing a collection -* `files` or `folder` (requires one of these): specifies the collection type and location; details in [Collection Types](../collection-types) -* `filter`: optional filter for `folder` collections; details in [Collection Types](../collection-types) -* `create`: for `folder` collections only; `true` allows users to create new items in the collection; defaults to `false` -* `publish`: for `publish_mode: editorial_workflow` only; `false` hides UI publishing controls for a collection; defaults to `true` -* `hide`: `true` hides a collection in the CMS UI; defaults to `false`. Useful when using the relation widget to hide referenced collections. -* `delete`: `false` prevents users from deleting items in a collection; defaults to `true` -* `extension`: see detailed description below -* `format`: see detailed description below -* `frontmatter_delimiter`: see detailed description under `format` -* `slug`: see detailed description below -* `preview_path`: see detailed description below -* `preview_path_date_field`: see detailed description below -* `fields` (required): see detailed description below -* `editor`: see detailed description below -* `summary`: see detailed description below -* `sortable_fields`: see detailed description below -* `view_filters`: see detailed description below -* `view_groups`: see detailed description below - -The last few options require more detailed information. - -### `identifier_field` - -Decap CMS expects every entry to provide a field named `"title"` that serves as an identifier for the entry. The identifier field serves as an entry's title when viewing a list of entries, and is used in [slug](#slug) creation. If you would like to use a field other than `"title"` as the identifier, you can set `identifier_field` to the name of the other field. - -**Example** - -```yaml -collections: - - name: posts - identifier_field: name -``` - -### `extension` and `format` - -These settings determine how collection files are parsed and saved. Both are optional—Decap CMS will attempt to infer your settings based on existing items in the collection. If your collection is empty, or you'd like more control, you can set these fields explicitly. - -`extension` determines the file extension searched for when finding existing entries in a folder collection and it determines the file extension used to save new collection items. It accepts the following values: `yml`, `yaml`, `toml`, `json`, `md`, `markdown`, `html`. - -You may also specify a custom `extension` not included in the list above, as long as the collection files can be parsed and saved in one of the supported formats below. - -`format` determines how collection files are parsed and saved. It will be inferred if the `extension` field or existing collection file extensions match one of the supported extensions above. It accepts the following values: - -* `yml` or `yaml`: parses and saves files as YAML-formatted data files; saves with `yml` extension by default -* `toml`: parses and saves files as TOML-formatted data files; saves with `toml` extension by default -* `json`: parses and saves files as JSON-formatted data files; saves with `json` extension by default -* `frontmatter`: parses files and saves files with data frontmatter followed by an unparsed body text (edited using a `body` field); saves with `md` extension by default; default for collections that can't be inferred. Collections with `frontmatter` format (either inferred or explicitly set) can parse files with frontmatter in YAML, TOML, or JSON format. However, they will be saved with YAML frontmatter. -* `yaml-frontmatter`: same as the `frontmatter` format above, except frontmatter will be both parsed and saved only as YAML, followed by unparsed body text. The default delimiter for this option is `---`. -* `toml-frontmatter`: same as the `frontmatter` format above, except frontmatter will be both parsed and saved only as TOML, followed by unparsed body text. The default delimiter for this option is `+++`. -* `json-frontmatter`: same as the `frontmatter` format above, except frontmatter will be both parsed and saved as JSON, followed by unparsed body text. The default delimiter for this option is `{` `}`. - -### `frontmatter_delimiter` - -If you have an explicit frontmatter format declared, this option allows you to specify a custom delimiter like `~~~`. If you need different beginning and ending delimiters, you can use an array like `["(", ")"]`. - -### `slug` - -For folder collections where users can create new items, the `slug` option specifies a template for generating new filenames based on a file's creation date and `title` field. (This means that all collections with `create: true` must have a `title` field (a different field can be used via [`identifier_field`](#identifier_field)). - -The slug template can also reference a field value by name, eg. `{{title}}`. If a field name conflicts with a built in template tag name - for example, if you have a field named `slug`, and would like to reference that field via `{{slug}}`, you can do so by adding the explicit `fields.` prefix, eg. `{{fields.slug}}`. - -**Available template tags:** - -* Any field can be referenced by wrapping the field name in double curly braces, eg. `{{author}}` -* `{{slug}}`: a url-safe version of the `title` field (or identifier field) for the file -* `{{year}}`: 4-digit year of the file creation date -* `{{month}}`: 2-digit month of the file creation date -* `{{day}}`: 2-digit day of the month of the file creation date -* `{{hour}}`: 2-digit hour of the file creation date -* `{{minute}}`: 2-digit minute of the file creation date -* `{{second}}`: 2-digit second of the file creation date - -**Example:** - -```yaml -slug: "{{year}}-{{month}}-{{day}}_{{slug}}" -``` - -**Example using field names:** - -```yaml -slug: "{{year}}-{{month}}-{{day}}_{{title}}_{{some_other_field}}" -``` - -**Example using field name that conflicts with a template tag:** - -```yaml -slug: "{{year}}-{{month}}-{{day}}_{{fields.slug}}" -``` - -### `preview_path` - -A string representing the path where content in this collection can be found on the live site. This allows deploy preview links to direct to lead to a specific piece of content rather than the site root of a deploy preview. - -**Available template tags:** - -Template tags are the same as those for [slug](#slug), with the following exceptions: - -* `{{slug}}` is the entire slug for the current entry (not just the url-safe identifier, as is the case with [`slug` configuration](#slug)) -* The date based template tags, such as `{{year}}` and `{{month}}`, are pulled from a date field in your entry, and may require additional configuration - see [`preview_path_date_field`](#preview_path_date_field) for details. If a date template tag is used and no date can be found, `preview_path` will be ignored. -* `{{dirname}}` The path to the file's parent directory, relative to the collection's `folder`. -* `{{filename}}` The file name without the extension part. -* `{{extension}}` The file extension. - -**Examples:** - -```yaml -collections: - - name: posts - preview_path: "blog/{{year}}/{{month}}/{{slug}}" -``` - -```yaml -collections: - - name: posts - preview_path: "blog/{{year}}/{{month}}/{{filename}}.{{extension}}" -``` - -### `preview_path_date_field` - -The name of a date field for parsing date-based template tags from `preview_path`. If this field is not provided and `preview_path` contains date-based template tags (eg. `{{year}}`), Decap CMS will attempt to infer a usable date field by checking for common date field names, such as `date`. If you find that you need to specify a date field, you can use `preview_path_date_field` to tell Decap CMS which field to use for preview path template tags. - -**Example:** - -```yaml -collections: - - name: posts - preview_path_date_field: "updated_on" -``` - -### `fields` - -The `fields` option maps editor UI widgets to field-value pairs in the saved file. The order of the fields in your Decap CMS `config.yml` file determines their order in the editor UI and in the saved file. - -`fields` accepts a list of collection objects, each with the following options: - -* `name` (required): unique identifier for the field, used as the key when referenced in other contexts (like the [relation widget](../widgets/#relation)) -* `label`: label for the field in the editor UI; defaults to the value of `name` -* `widget`: defines editor UI and inputs and file field data types; details in [Widgets](../widgets) -* `default`: specify a default value for a field; available for most widget types (see [Widgets](../widgets) for details on each widget type). Please note that field default value only works for folder collection type. -* `required`: specify as `false` to make a field optional; defaults to `true` -* `hint`: optionally add helper text directly below a widget. Useful for including instructions. Accepts markdown for bold, italic, strikethrough, and links. -* `pattern`: add field validation by specifying a list with a regex pattern and an error message; more extensive validation can be achieved with [custom widgets](../custom-widgets/#advanced-field-validation) -* `comment`: optional comment to add before the field (only supported for `yaml`) - -In files with frontmatter, one field should be named `body`. This special field represents the section of the document (usually markdown) that comes after the frontmatter. - -**Example:** - -```yaml -fields: - - label: "Title" - name: "title" - widget: "string" - pattern: ['.{20,}', "Must have at least 20 characters"] - - {label: "Layout", name: "layout", widget: "hidden", default: "blog"} - - {label: "Featured Image", name: "thumbnail", widget: "image", required: false} - - {label: "Body", name: "body", widget: "markdown"} - comment: 'This is a multiline\ncomment' -``` - -### `editor` - -This setting changes options for the editor view of a collection or a file inside a files collection. It has one option so far: - -* `preview`: set to `false` to disable the preview pane for this collection or file; defaults to `true` - -**Example:** - -```yaml - editor: - preview: false -``` - -**Note**: Setting this as a top level configuration will set the default for all collections - -### `summary` - -This setting allows the customization of the collection list view. Similar to the `slug` field, a string with templates can be used to include values of different fields, e.g. `{{title}}`. This option over-rides the default of `title` field and `identifier_field`. - -**Available template tags:** - -Template tags are the same as those for [slug](#slug), with the following additions: - -* `{{dirname}}` The path to the file's parent directory, relative to the collection's `folder`. -* `{{filename}}` The file name without the extension part. -* `{{extension}}` The file extension. -* `{{commit_date}}` The file commit date on supported backends (git based backends). -* `{{commit_author}}` The file author date on supported backends (git based backends). - -**Example** - -```yaml - summary: "Version: {{version}} - {{title}}" -``` - -### `sortable_fields` - -An optional list of sort fields to show in the UI. - -Defaults to inferring `title`, `date`, `author` and `description` fields and will also show `Update On` sort field in git based backends. - -When `author` field can't be inferred commit author will be used. - -**Example** - -```yaml - # use dot notation for nested fields - sortable_fields: ['commit_date', 'title', 'commit_author', 'language.en'] -``` - -### `view_filters` - -An optional list of predefined view filters to show in the UI. - -Defaults to an empty list. - -**Example** - -```yaml - view_filters: - - label: "Alice's and Bob's Posts" - field: author - pattern: 'Alice|Bob' - - label: 'Posts published in 2020' - field: date - pattern: '2020' - - label: Drafts - field: draft - pattern: true -``` - -### `view_groups` - -An optional list of predefined view groups to show in the UI. - -Defaults to an empty list. - -**Example** - -```yaml - view_groups: - - label: Year - field: date - # groups items based on the value matched by the pattern - pattern: \d{4} - - label: Drafts - field: draft -``` diff --git a/website/content/docs/configure-decap-cms.md b/website/content/docs/configure-decap-cms.md deleted file mode 100644 index a9ef2a760232..000000000000 --- a/website/content/docs/configure-decap-cms.md +++ /dev/null @@ -1,149 +0,0 @@ ---- -group: Add -weight: 4 -title: 3. Configure Decap CMS ---- - -Configuration is different for every site, so we'll break it down into parts. Add all the code snippets in this section to your `admin/config.yml` file. - -### Backend - -We're using [Netlify](https://www.netlify.com) for our hosting and authentication in this tutorial, so backend configuration is fairly straightforward. - -For GitHub and GitLab repositories, you can start your Decap CMS `config.yml` file with these lines: - -```yaml -backend: - name: git-gateway - branch: main # Branch to update (optional; defaults to master) -``` - -*(For Bitbucket repositories, use the [Bitbucket backend](/docs/bitbucket-backend) instructions instead.)* - -The configuration above specifies your backend protocol and your publication branch. Git Gateway is an open source API that acts as a proxy between authenticated users of your site and your site repo. (We'll get to the details of that in the [Authentication section](#authentication) below.) If you leave out the `branch` declaration, it defaults to `master`. - -### Media and Public Folders - -Decap CMS allows users to upload images directly within the editor. For this to work, the CMS needs to know where to save them. If you already have an `images` folder in your project, you could use its path, possibly creating an `uploads` sub-folder, for example: - -```yaml -# This line should *not* be indented -media_folder: "images/uploads" # Media files will be stored in the repo under images/uploads -``` - -If you're creating a new folder for uploaded media, you'll need to know where your static site generator expects static files. You can refer to the paths outlined above in [App File Structure](#app-file-structure), and put your media folder in the same location where you put the `admin` folder. - -Note that the `media_folder` file path is relative to the project root, so the example above would work for Jekyll, GitBook, or any other generator that stores static files at the project root. However, it would not work for Hugo, Hexo, Middleman, or others that store static files in a subfolder. Here's an example that could work for a Hugo site: - -```yaml -# These lines should *not* be indented -media_folder: "static/images/uploads" # Media files will be stored in the repo under static/images/uploads -public_folder: "/images/uploads" # The src attribute for uploaded media will begin with /images/uploads -``` - -The configuration above adds a new setting: `public_folder`. Whereas `media_folder` specifies where uploaded files are saved in the repo, `public_folder` indicates where they are found in the published site. Image `src` attributes use this path, which is relative to the file where it's called. For this reason, we usually start the path at the site root, using the opening `/`. - -*__Note:__ If `public_folder` is not set, Decap CMS defaults to the same value as `media_folder`, adding an opening `/` if one is not included.* - -### Collections - -Collections define the structure for the different content types on your static site. Since every site is different, the `collections` settings differ greatly from one site to the next. - -Let's say your site has a blog, with the posts stored in `_posts/blog`, and files saved in a date-title format, like `1999-12-31-lets-party.md`. Each post begins with settings in yaml-formatted front matter, like so: - -```yaml ---- -layout: blog -title: "Let's Party" -date: 1999-12-31 11:59:59 -0800 -thumbnail: "/images/prince.jpg" -rating: 5 ---- - -This is the post body, where I write about our last chance to party before the Y2K bug destroys us all. -``` - -Given this example, our `collections` settings would look like this in your Decap CMS `config.yml` file: - -```yaml -collections: - - name: "blog" # Used in routes, e.g., /admin/collections/blog - label: "Blog" # Used in the UI - folder: "_posts/blog" # The path to the folder where the documents are stored - create: true # Allow users to create new documents in this collection - slug: "{{year}}-{{month}}-{{day}}-{{slug}}" # Filename template, e.g., YYYY-MM-DD-title.md - fields: # The fields for each document, usually in front matter - - {label: "Layout", name: "layout", widget: "hidden", default: "blog"} - - {label: "Title", name: "title", widget: "string"} - - {label: "Publish Date", name: "date", widget: "datetime"} - - {label: "Featured Image", name: "thumbnail", widget: "image"} - - {label: "Rating (scale of 1-5)", name: "rating", widget: "number"} - - {label: "Body", name: "body", widget: "markdown"} -``` - -Let's break that down: - - - - - - - - - - - - - - - - - - - - - - - - - - -
namePost type identifier, used in routes. Must be unique.
labelWhat the admin UI calls the post type.
folderWhere files of this type are stored, relative to the repo root.
createSet to true to allow users to create new files in this collection. -
slugTemplate for filenames. {{year}}, {{month}}, and {{day}} pulls from the post's date field or save date. {{slug}} is a URL-safe version of the post's title. Default is simply {{slug}}. -
fieldsFields listed here are shown as fields in the content editor, then saved as front matter at the beginning of the document (except for body, which follows the front matter). Each field contains the following properties: -
    -
  • label: Field label in the editor UI.
  • -
  • name: Field name in the document front matter.
  • -
  • widget: Determines UI style and value data type (details below).
  • -
  • default (optional): Sets a default value for the field.
  • -
-
- -As described above, the `widget` property specifies a built-in or custom UI widget for a given field. When a content editor enters a value into a widget, that value is saved in the document front matter as the value for the `name` specified for that field. A full listing of available widgets can be found in the [Widgets doc](../widgets). - -Based on this example, you can go through the post types in your site and add the appropriate settings to your Decap CMS `config.yml` file. Each post type should be listed as a separate node under the `collections` field. See the [Collections reference doc](../configuration-options/#collections) for more configuration options. - -### Filter - -The entries for any collection can be filtered based on the value of a single field. The example collection below only shows post entries with the value `en` in the `language` field. - -```yaml -collections: - - name: "posts" - label: "Post" - folder: "_posts" - filter: - field: language - value: en - fields: - - {label: "Language", name: "language"} -``` - -
- -

- Once this is completed, proceed to step 4. -

-
diff --git a/website/content/docs/contributor-guide.md b/website/content/docs/contributor-guide.md deleted file mode 100644 index 61e89efa3aac..000000000000 --- a/website/content/docs/contributor-guide.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: Contributor Guide -weight: 20 -group: Contributing ---- - -We're hoping that Decap CMS will do for the [Jamstack](https://www.jamstack.org) what WordPress did for dynamic sites back in the day. We know we can't do that without building a thriving community of contributors and users, and we'd love to have you join us. - -## Getting started with contributing -Being a developer is not a requirement for contributing to Decap CMS, you only need the desire, a web browser, and a [GitHub account](https://github.com/join). The GitHub repo has a step-by-step [guide](https://github.com/decaporg/decap-cms/blob/master/CONTRIBUTING.md) to get started with the code. - -## The basics of the Decap CMS docs -The documentation for Decap CMS is written in [Markdown](http://daringfireball.net/projects/markdown/) (a good cheatsheet on Markdown is [here](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet)), with the source residing on [GitHub](https://github.com/decaporg/decap-cms) in the `/website/content/docs` folder. - -The GitHub website allows you to submit issues, work with files, search for content, and browse changes that have been submitted in the past and those that are being submitted now (aka Pull Requests). - -## Style guidelines -A [style guide](/docs/writing-style-guide/) is available to help provide context around grammar, code styling, syntax, etc. - -## Filing issues -If you have a GitHub account, you can file an [issue](https://github.com/decaporg/decap-cms/issues) (aka bug report) against the Decap CMS docs. Even if you're not able to, or don't know how to, fix the issue (see [Improve existing content](#improve-existing-content)), it helps to start the conversation. - -When filing an issue, it is important to remember the [Code of Conduct](https://github.com/decaporg/decap-cms/blob/master/CODE_OF_CONDUCT.md). - -## Improve existing content -If you are able to offer up a change to existing content, we welcome this. Once you've forked the repo, and changed the content, you would file a pull request (PR). The repo [Contributing file](https://github.com/decaporg/decap-cms/blob/master/CONTRIBUTING.md) lays out the correct format for PRs. - -## Other places to get involved -While we work on building this page (and you can help!), here are some links with more information about getting involved: - -* [Setup instructions and Contribution Guidelines](https://github.com/decaporg/decap-cms/blob/master/CONTRIBUTING.md) -* [Join our Community Chat](https://decapcms.org/chat) -* [Code of Conduct](https://github.com/decaporg/decap-cms/blob/master/CODE_OF_CONDUCT.md) -* [Project Milestones](https://github.com/decaporg/decap-cms/milestones) -* [Good First Issues](https://github.com/decaporg/decap-cms/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22good+first+issue%22+-label%3Aclaimed) diff --git a/website/content/docs/custom-formatters.md b/website/content/docs/custom-formatters.md deleted file mode 100644 index f03dc4c5365b..000000000000 --- a/website/content/docs/custom-formatters.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: Custom formatters -weight: 60 -group: Customization ---- - -To manage content with other file formats than the built in ones, you can register a custom formatter: - -```js -const JSON5 = require('json5'); - -CMS.registerCustomFormat('json5', 'json5', { - fromFile: text => JSON5.parse(text), - toFile: value => JSON5.stringify(value, null, 2), -}); -``` - -Then include `format: json5` in your collection configuration. See the [Collection docs](https://www.netlifycms.org/docs/configuration-options/#collections) for more details. - -You can also override the in-built formatters. For example, to change the YAML serialization method from [`yaml`](https://npmjs.com/package/yaml) to [`js-yaml`](https://npmjs.com/package/js-yaml): - -```js -const jsYaml = require('js-yaml'); - -CMS.registerCustomFormat('yml', 'yml', { - fromFile: text => jsYaml.load(text), - toFile: value => jsYaml.dump(value), -}); -``` diff --git a/website/content/docs/custom-mounting.md b/website/content/docs/custom-mounting.md deleted file mode 100644 index fd8c5c5552ad..000000000000 --- a/website/content/docs/custom-mounting.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: Custom Mount Element -weight: 90 -group: Customization ---- - -Decap CMS always creates its own DOM element for mounting the application, which means it always takes over the entire page, and is generally inflexible if you're trying to do something creative, like injecting it into a shared context. - -You can now provide your own element for Decap CMS to mount in by setting the target element's ID as `id="nc-root"`. If Decap CMS finds an element with this ID during initialization, it will mount within that element instead of creating its own. - -This is useful if you want to create a wrapper around the CMS, like a custom header, footer, or sidebar. - -**Example** - -Adding the following div to `admin/index.html` will cause the CMS to load within it: - -
diff --git a/website/content/docs/custom-widgets.md b/website/content/docs/custom-widgets.md deleted file mode 100644 index 2874ed609f06..000000000000 --- a/website/content/docs/custom-widgets.md +++ /dev/null @@ -1,563 +0,0 @@ ---- -group: Fields -weight: 20 -title: Creating Custom Widgets ---- -Decap CMS exposes a `window.CMS` global object that you can use to register custom widgets, previews, and editor plugins. The same object is also the default export if you import Decap CMS as an npm module. The available widget extension methods are: - -* **registerWidget:** registers a custom widget. -* **registerEditorComponent:** adds a block component to the Markdown editor. - -### Writing React Components inline - -The `registerWidget` requires you to provide a React component. If you have a build process in place for your project, it is possible to integrate with this build process. - -However, although possible, it may be cumbersome or even impractical to add a React build phase. For this reason, Decap CMS exposes two constructs globally to allow you to create components inline: ‘createClass’ and ‘h’ (alias for React.createElement). - -## `registerWidget` - -Register a custom widget. - -```js -// Using global window object -CMS.registerWidget(name, control, [preview], [schema]); - -// Using npm module import -import CMS from 'decap-cms-app'; -CMS.registerWidget(name, control, [preview], [schema]); -``` - -### Params - -| Param | Type | Description | -| ----------- | ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `name` | `string` | Widget name, allows this widget to be used via the field `widget` property in config | -| `control` | `React.Component` or `string` |
  • React component that renders the control, receives the following props:
    • **value:** Current field value
    • **field:** Immutable map of current field configuration
    • **forID:** Unique identifier for the field
    • **classNameWrapper:** class name to apply CMS styling to the field
    • **onChange:** Callback function to update the field value
  • Name of a registered widget whose control should be used (includes built in widgets).
| -| [`preview`] | `React.Component`, optional | Renders the widget preview, receives the following props:
  • **value:** Current preview value
  • **field:** Immutable map of current field configuration
  • **metadata:** Immutable map of any available metadata for the current field
  • **getAsset:** Function for retrieving an asset url for image/file fields
  • **entry:** Immutable Map of all entry data
  • **fieldsMetaData:** Immutable map of metadata from all fields.
| -| [`schema`] | `JSON Schema object`, optional | Enforces a schema for the widget's field configuration | - -### Example - -`admin/index.html` - -```html - - -``` - -`admin/config.yml` - -```yml -collections: - - name: posts - label: Posts - folder: content/posts - fields: - - name: title - label: Title - widget: string - - name: categories - label: Categories - widget: categories - separator: __ -``` - -## `registerEditorComponent` - -Register a block level component for the Markdown editor: - -```js -CMS.registerEditorComponent(definition) -``` - -### Params - -* **definition:** The component definition; must specify: id, label, fields, patterns, fromBlock, toBlock, toPreview - -> Additional properties are optional and will be passed to the underlying widget control (object widget by default). For example, adding a `collapsed: true` property will collapse the widget by default. - -### Example - -```html - - -``` - -## Advanced field validation - -All widget fields, including those for built-in widgets, [include basic validation](../widgets/#common-widget-options) capability using the `required` and `pattern` options. - -With custom widgets, the widget control can also optionally implement an `isValid` method to perform custom validations, in addition to presence and pattern. The `isValid` method will be automatically called, and it can return either a boolean value, an object with an error message or a promise. Examples: - -### Boolean - -No errors: - -```javascript - isValid = () => { - // Do internal validation - return true; - }; -``` - -Existing error: - -```javascript - isValid = () => { - // Do internal validation - return false; - }; -``` - -### Object with `error` (useful for returning custom error messages) - -Existing error: - -```javascript - isValid = () => { - // Do internal validation - return { error: { message: 'Your error message.' } }; - }; -``` - -### Promise - -You can also return a promise from `isValid`. While the promise is pending, the widget will be marked as "in error". When the promise resolves, the error is automatically cleared. - -```javascript - isValid = () => { - return this.existingPromise; - }; -``` - -**Note:** Do not create a promise inside `isValid` - `isValid` is called right before trying to persist. This means that even if a previous promise was already resolved, when the user hits 'save', `isValid` will be called again. If it returns a new promise, it will be immediately marked as "in error" until the new promise resolves. - -## Writing custom widgets as a separate package - -Widgets are inputs for the Decap CMS editor interface. It's a React component that receives user input and outputs a serialized value. Those are the only rules - the component can be extremely simple, like text input, or extremely complicated, like a full-blown markdown editor. They can make calls to external services, and generally do anything that JavaScript can do. - -For writing custom widgets as a separate package you should follow these steps: - -1. Create a directory - - ```javascript - mkdir my-custom-widget - ``` -2. Navigate to the directory - - ```javascript - cd my-custom-widget - ``` -3. For setting up a new npm package run this command: - - ```javascript - npm init - ``` -4. Answer the questions in the command line questionnaire. -5. In order to build React components, we need to set up a build step. We'll be using Webpack. Please run the following commands to install the required dependencies: - -```javascript - npm install --save-dev babel-loader@7 babel-core babel-plugin-transform-class-properties babel-plugin-transform-export-extensions babel-plugin-transform-object-rest-spread babel-preset-env babel-preset-react cross-env css-loader html-webpack-plugin decap-cms react source-map-loader style-loader webpack webpack-cli webpack-serve -``` - -```javascript - npm install --save prop-types -``` - -And you should manually add "**peerDependencies**" and "**scripts**" as shown below. - -Here is the content of `package.json` that you will have at the end: - -```javascript -{ - "name": "decap-cms-widget-starter", - "description": "A boilerplate for creating Decap CMS widgets.", - "author": "name of developer", - "keywords": [ - "netlify", - "decap-cms", - "cms", - "widget", - "starter", - "boilerplate" - ], - "version": "0.0.1", - "homepage": "https://github.com/decaporg/decap-cms-widget-starter", - "license": "MIT", - "main": "dist/main.js", - "devDependencies": { - "babel-loader": "^7.1.4", - "babel-plugin-transform-class-properties": "^6.24.1", - "babel-plugin-transform-export-extensions": "^6.22.0", - "babel-plugin-transform-object-rest-spread": "^6.26.0", - "babel-preset-env": "^1.6.1", - "babel-preset-react": "^6.24.1", - "cross-env": "^5.1.4", - "css-loader": "^0.28.11", - "html-webpack-plugin": "^3.2.0", - "decap-cms": "^1.5.0", - "react": "^16.3.2", - "source-map-loader": "^0.2.3", - "style-loader": "^0.20.3", - "webpack": "^4.6.0", - "webpack-cli": "^2.0.14", - "webpack-serve": "^0.3.1" - }, - "dependencies": { - "prop-types": "^15.6.1" - }, - "peerDependencies": { - "react": "^16" - }, - "scripts": { - "start": "webpack-serve --static public --open" - } -} -``` - -5. Create a Webpack configuration file with this content: - - `webpack.config.js` - - ```javascript - const path = require('path') - const HtmlWebpackPlugin = require('html-webpack-plugin') - - const developmentConfig = { - mode: 'development', - entry: './dev/index.js', - output: { - path: path.resolve(__dirname, 'public'), - }, - optimization: { minimize: false }, - module: { - rules: [ - { - test: /\.js$/, - loader: 'source-map-loader', - enforce: 'pre', - }, - { - test: /\.jsx?$/, - exclude: /node_modules/, - loader: 'babel-loader', - }, - { - test: /\.css$/, - use: [{ loader: 'style-loader' }, { loader: 'css-loader' }], - }, - ], - }, - plugins: [ - new HtmlWebpackPlugin(), - ], - devtool: 'eval-source-map', - } - - const productionConfig = { - mode: 'production', - module: { - rules: [ - { - test: /\.jsx?$/, - loader: 'babel-loader', - }, - ], - }, - devtool: 'source-map', - } - - module.exports = process.env.NODE_ENV === 'production' ? productionConfig : developmentConfig - ``` -6. The `.babelrc` file is our local configuration for our code in the project. You should create it under the root of the application repo. It will affect all files that Babel processes. So, create a `.babelrc` file under the main project with this content: - -```javascript -{ - "presets": [ - "react", - "env", - ], - "plugins": [ - "transform-export-extensions", - "transform-class-properties", - "transform-object-rest-spread", - ], -} -``` - -7. Create a `src` directory with the files `Control.js`, `Preview.js` and `index.js` - -`src/Control.js` - -```javascript - import PropTypes from 'prop-types'; - import React from 'react'; - - export default class Control extends React.Component { - static propTypes = { - onChange: PropTypes.func.isRequired, - forID: PropTypes.string, - value: PropTypes.node, - classNameWrapper: PropTypes.string.isRequired, - } - - static defaultProps = { - value: '', - } - - render() { - const { - forID, - value, - onChange, - classNameWrapper, - } = this.props; - - return ( - onChange(e.target.value)} - /> - ); - } - } -``` - -`src/Preview.js` - -```javascript -import PropTypes from 'prop-types'; -import React from 'react'; - -export default function Preview({ value }) { - return
{ value }
; -} - -Preview.propTypes = { - value: PropTypes.node, -}; -``` - -`src/index.js` - -```javascript -import Control from './Control' -import Preview from './Preview' - -if (typeof window !== 'undefined') { - window.Control = Control - window.Preview = Preview -} - -export { Control, Preview } -``` - -8. Now you need to set up the locale example site. - Under the main project, create a `dev` directory with the files `bootstrap.js` and `index.js` - -`bootstrap.js` - -```javascript -window.CMS_MANUAL_INIT = true -``` - -`index.js` - -```javascript -import './bootstrap.js' -import CMS, { init } from 'decap-cms-app' -import 'decap-cms/dist/cms.css' -import { Control, Preview } from '../src' - -const config = { -backend: { - name: 'test-repo', - login: false, -}, -media_folder: 'assets', -collections: [{ - name: 'test', - label: 'Test', - files: [{ - file: 'test.yml', - name: 'test', - label: 'Test', - fields: [ - { name: 'test_widget', label: 'Test Widget', widget: 'test'}, - ], - }], -}], -} - -CMS.registerWidget('test', Control, Preview) - -init({ config }) -``` - -### Development - -To run a copy of Decap CMS with your widget for development, use the start script: - -```javascript -npm start -``` - -Your widget source is in the `src` directory, where there are separate files for the `Control` and `Preview` components. - -### Production & Publishing - -You'll want to take a few steps before publishing a production built package to npm: - -1. Customize `package.json` with details for your specific widget, e.g. name, description, author, version, etc. - - ```json - { - "name": "decap-cms-widget-starter", - "description": "A boilerplate for creating Decap CMS widgets.", - "author": "name of developer", - "keywords": [ - "netlify", - "decap-cms", - "cms", - "widget", - "starter", - "boilerplate" - ], - "version": "0.0.1", - // ... rest - } - ``` -2. For discoverability, ensure that your package name follows the pattern `decap-cms-widget-`. -3. Delete this `README.md`, rename `README_TEMPLATE.md` to `README.md`, and update the new file for your specific widget. -4. Rename the exports in `src/index.js`. For example, if your widget is `decap-cms-widget-awesome`, you would do: - -```javascript -if (typeof window !== 'undefined') { - window.AwesomeControl = Control - window.AwesomePreview = Preview -} - -export { Control as AwesomeControl, Preview as AwesomePreview } -``` - -5. Optional: customize the component and file names in `src`. -6. If you haven't already, push your repo to your GitHub account so the source available to other developers. -7. Create a production build, which will be output to `dist`: - -```javascript -npm run build -``` - -8. Finally, if you're sure things are tested and working, publish! - -```javascript -npm publish -``` diff --git a/website/content/docs/customization.md b/website/content/docs/customization.md deleted file mode 100644 index 446cf380baf1..000000000000 --- a/website/content/docs/customization.md +++ /dev/null @@ -1,199 +0,0 @@ ---- -title: Creating Custom Previews -weight: 50 -group: Customization ---- - -The Decap CMS exposes a `window.CMS` global object that you can use to register custom widgets, previews and editor plugins. The available customization methods are: - -* **registerPreviewStyle:** Register a custom stylesheet to use on the preview pane. -* **registerPreviewTemplate:** Registers a template for a collection. - -### React Components inline interaction - -Decap CMS is a collection of React components and exposes two constructs globally to allow you to create components inline: ‘createClass’ and ‘h’ (alias for React.createElement). - -## `registerPreviewStyle` - -Register a custom stylesheet to use on the preview pane. - -```js -CMS.registerPreviewStyle(file); -``` - -**Params:** - -* **file:** css file path - -**Example:** - -```html -// index.html - - -``` - -```css -/* example.css */ - -html, -body { - color: #444; - font-size: 14px; - font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; -} - -body { - padding: 20px; -} -``` - -## Raw CSS in `registerPreviewStyle` - -`registerPreviewStyle` can now accept a CSS string, in addition to accepting a url. The feature is activated by passing in an object as the second argument, with `raw` set to a truthy value. This is critical for integrating with modern build tooling. Here's an example using webpack: - -```js -/** - * Assumes a webpack project with `sass-loader` and `css-loader` installed. - * Takes advantage of the `toString` method in the return value of `css-loader`. - */ -import CMS from 'decap-cms-app'; -import styles from '!css-loader!sass-loader!../main.scss'; -CMS.registerPreviewStyle(styles.toString(), { raw: true }); -``` - - -## `registerPreviewTemplate` - -Registers a template for a folder collection or an individual file in a file collection. - -`CMS.registerPreviewTemplate(name, react_component);` - -**Params:** - -* name: The name of the collection (or file for file collections) which this preview component will be used for. - * Folder collections: Use the name of the collection - * File collections: Use the name of the file -* react_component: A React component that renders the collection data. Six props will be passed to your component during render: - * entry: Immutable collection containing the entry data. - * widgetFor: Returns the appropriate widget preview component for a given field. - * [widgetsFor](#lists-and-objects): Returns an array of objects with widgets and associated field data. For use with list and object type entries. - * getAsset: Returns the correct filePath or in-memory preview for uploaded images. - **Example:** - - ```html - - - ``` - * document: The preview pane iframe's [document instance](https://github.com/ryanseddon/react-frame-component/tree/9f8f06e1d3fc40da7122f0a57c62f7dec306e6cb#accessing-the-iframes-window-and-document). - * window: The preview pane iframe's [window instance](https://github.com/ryanseddon/react-frame-component/tree/9f8f06e1d3fc40da7122f0a57c62f7dec306e6cb#accessing-the-iframes-window-and-document). - - ### Lists and Objects - The API for accessing the individual fields of list- and object-type entries is similar to the API for accessing fields in standard entries, but there are a few key differences. Access to these nested fields is facilitated through the `widgetsFor` function, which is passed to the preview template component during render. - **Note**: as is often the case with the Decap CMS API, arrays and objects are created with Immutable.js. If some of the methods that we use are unfamiliar, such as `getIn`, check out [their docs](https://facebook.github.io/immutable-js/docs/#/) to get a better understanding. - **List Example:** - ```html - - ``` - - **Object Example:** - ```html - - ``` - ### Accessing Metadata - Preview Components also receive an additional prop: `fieldsMetaData`. It contains additional information (besides the plain textual value of each field) that can be useful for preview purposes. For example, the Relation widget passes the whole selected relation data in `fieldsMetaData`. - ```js - export default class ArticlePreview extends React.Component { - render() { - const {entry, fieldsMetaData} = this.props; - const author = fieldsMetaData.getIn(['authors', data.author]); - - return

{ entry.getIn(['data', 'title']) }

- {author &&} -
- } - } - ``` diff --git a/website/content/docs/deploy-preview-links.md b/website/content/docs/deploy-preview-links.md deleted file mode 100644 index bf948945ab42..000000000000 --- a/website/content/docs/deploy-preview-links.md +++ /dev/null @@ -1,149 +0,0 @@ ---- -group: Workflow -weight: 10 -title: Deploy Preview Links ---- -When using the editorial workflow, content editors can create and save content without publishing it -to a live site. Deploy preview links provide a way to view live content when it has not been -published, provided that you're using a continuous deployment platform to provide "deploy previews" -of your unmerged content. - -## Using deploy preview links - -Deploy preview links will work without configuration when all of the following requirements are met: - -* Decap CMS version is 2.4.0+ for GitHub support and 2.10.6+ for GitLab/Bitbucket support -* Using editorial workflow -* Have a continuous deployment platform that builds every commit and provides statuses to your repo - -Any site created using one of the Deploy to Netlify options on our [starters -page](../start-with-a-template) will automatically meet these criteria (barring any changes made to -your Netlify settings), but you may need to [update](../update-the-cms-version) your Decap CMS version to get the -functionality. - -**Note:** If you're using a custom backend (one that is not included with Decap CMS), please check the -documentation for that backend for more information about enabling deploy preview links. - -Deploy preview links are provided in the editor toolbar, near the publishing controls: - -![Deploy preview link for unpublished content](/img/preview-link-unpublished.png) - -### Waiting for builds - -Deploy your site preview may take ten seconds or ten minutes, depending on many factors. For maximum -flexibility, Decap CMS provides a "Check for Preview" refresh button when the deploy preview is -pending, which a content editor can use to manually check for a finished preview until it's ready: - -![Deploy preview link for unpublished content](/img/preview-link-check.png) - -## Configuring preview paths - -Deploy preview links point to the site root by default, but you'll probably want them to point to -the specific piece of content that the content editor is viewing. You can do this by providing a -`preview_path` string template for each collection, or for individual files in a files collection. - -Let's say we have a `blog` collection that stores content in our repo under `content/blog`. The path -to a post in your repo may look like `content/blog/2018-01-new-post.md`, but the path to that post -on your site would look more like: `/blog/2018-01-new-post/`. Here's how you would use -`preview_path` in your configuration for this scenario: - -```yaml -collections: - - name: blog - folder: content/blog - slug: {{year}}-{{month}}-{{slug}} - preview_path: blog/{{slug}} -``` - -Similarly, for an `about` page in a files collection under `content/pages` which maps to `/about-the-project` -on your site, you would configure `preview_path` like this: - -```yaml -collections: - - name: pages - files: - - name: about - file: content/pages/about.md - preview_path: about-the-project -``` - -With the above configuration, the deploy preview URL from your backend will be combined with your -preview path to create a URL to a specific blog post. - -**Note:** `{{slug}}` in `preview_path` is different than `{{slug}}` in `slug`. In the `slug` -template, `{{slug}}` is only the url-safe [identifier -field](../configuration-options/#identifier_field), while in the `preview_path` template, `{{slug}}` -is the entire slug for the entry. For example: - -```yaml -# for an entry created Jan 1, 2000 with identifier "My New Post!" -collections: - - name: posts - slug: {{year}}-{{month}}-{{slug}} # {{slug}} will compile to "my-new-post" - preview_path: blog/{{slug}} # {{slug}} will compile to "2000-01-my-new-post" -``` - -### Dates in preview paths - -Some static site generators allow URL's to be customized with date parameters - for example, Hugo -can be configured to use values like `year` and `month` in a URL. These values are generally derived -by the static site generator from a date field in the content file. `preview_path` accepts these -parameters as well, similar to the `slug` configuration, except `preview_path` populates date values -based on a date value from the entry, just like static site generators do. Decap CMS will attempt -to infer an obvious date field, but you can also specify which date field to use for `preview_path` -template tags by using -[`preview_path_date_field`](../configuration-options/#preview_path_date_field). - -Together with your other field values, dates can be used to configure most URL schemes available -through static site generators. - -**Example** - -```yaml -# This collection's date field will be inferred because it has a field named `"date"` -collections: - - name: posts - preview_path: blog/{{year}}/{{month}}/{{title}} - fields: - - { name: title, label: Title } - { name: date, label: Date, widget: date } - { name: body, label: Body, widget: markdown } -# This collection requires `path_preview_date_field` because the no obvious date field is available -collections: - - name: posts - preview_path: blog/{{year}}/{{month}}/{{title}} - preview_path_date_field: published_at - fields: - - { name: title, label: Title } - { name: published_at, label: Published At, widget: date } - { name: body, label: Body, widget: markdown } -``` - -## Preview links for published content - -You may also want preview links for published content as a convenience. You can do this by providing -a `site_url` in your configuration, which will be used in place of the deploy preview URL that a -backend would provide for an unpublished entry. Just as for deploy preview links to unpublished -content, links to published content will use any `preview_path` values that are defined in the -collection configurations. - -Preview links for published content will also work if you are not using the editorial workflow. - -![Deploy preview link for unpublished content](/img/preview-link-unpublished.png) - -## Disabling deploy preview links - -To disable deploy preview links, set `show_preview_links` to false in your CMS configuration. - -## How it works - -Deploy preview links are provided through your CMS backend, and Decap CMS is unopinionated about -where the links come from or how they're created. That said, the general approach for Git backends -like GitHub is powered by "commit statuses". Continuous deployment platforms like Netlify can deploy -a version of your site for every commit that is pushed to your remote Git repository, and then send -a commit status back to your repository host with the URL. - -The deploy preview URL provided by a backend will lead to the root of the deployed site. Decap CMS -will then use the `preview_path` template in an entry's collection configuration to build a path to -a specific piece of content. If a `preview_path` is not provided for an entry's collection, the URL -will be used as is. diff --git a/website/content/docs/docusaurus.md b/website/content/docs/docusaurus.md deleted file mode 100644 index cd12a3dbe5b6..000000000000 --- a/website/content/docs/docusaurus.md +++ /dev/null @@ -1,256 +0,0 @@ ---- -group: Guides -weight: 80 -title: Docusaurus ---- -This guide instructs you on how to integrate Decap CMS with Docusaurus. - -### Before you begin - -* Sign up for [GitHub](www.github.com) and [Netlify](www.netlify.com). -* Download [Node.js](https://nodejs.org/en/download/) version 14 or above. -* Install the [GitHub CLI](https://cli.github.com/). -* Install and authenticate the [Netlify CLI](https://docs.netlify.com/cli/get-started/). - -## Create a new Docusaurus project - -```bash -# 1. Use Docusaurus to create a site scaffold. -npx create-docusaurus@latest my-website classic - -# 2. Run the development server. -cd my-website -npm run start -``` - -A browser window opens at `http://localhost:3000`. - -The development server now serves your website at `http://localhost:3000`. As you edit the source files in `/my-website/`, you can visit `http://localhost:3000` to preview your changes. - - - - - -## Push your project to GitHub - -Decap CMS requires a [backend](https://www.decapcms.org/docs/backends-overview/) to store content. Decap CMS supports using Git hosts, like GitHub or GitLab, as backends. This guide uses GitHub. - -```bash -# 1. Initialize your local Git repository. -git init - -# 2. Rename your initial branch to match GitHub. -git branch -m main - -# 3. Stage all your local files to your repository. -git add . - -# 4. Commit your staged changes. -git commit -m 'Initial commit' - -# 5. Create a remote repository on GitHub using the GitHub CLI. -gh repo create my-website -``` - -Don't add a license or a .gitignore. Do add an "origin" git remote. - -![](/img/screen-shot-2021-11-15-at-4.16.53-pm.png) - -```bash -# 6. Update your remote repository with your staged changes. -git push -u origin main -``` - -## Publish your project using Netlify CLI - -
    -
  1. Connect Netlify CLI to your GitHub repository. - -```bash -netlify init -``` - -
  2. -
  3. Choose Create & configure a new site.
  4. -
  5. Choose your team and site name.
  6. -
  7. Choose yarn build for your build command.
  8. -
  9. Choose build for your deployment directory.
  10. -
- -![](/img/screen-shot-2021-11-16-at-1.34.18-PM.png) - -Choose the default option for everything else. - -Your website is now deployed. Netlify provides you with a randomly generated domain name. Run `netlify open --site` to view your deployed site. - -## Add Decap CMS to your project - -### Before you begin - -
    - -
  1. Remove all existing posts from /blog. - -```bash -rm -rf ./blog/* -``` - -
  2. - -
  3. Create a new blog post post titled 2021-11-15-first-blog-post.md. - -```bash -touch ./blog/2021-11-15-first-blog-post.md -``` - -
  4. - -
  5. Edit 2021-11-15-first-blog-post.md to look like this: - -```yaml ---- -title: First Blog Post -slug: first-blog-post -tags: - - foo - - bar -authors: - - name: Garrison McMullen - title: Instruction Writer - url: https://github.com/garrison0 - image_url: https://avatars.githubusercontent.com/u/4089393?v=4 ---- -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. -``` - -
  6. - -
- -### Procedure - -
    - -
  1. Create an admin directory inside static. - -```bash -cd static -mkdir admin -``` - -
  2. - -
  3. In the admin directory, create a config.yml file and an index.html file. - -```bash -cd admin -touch config.yml -touch index.html -``` - -
  4. - -
  5. Edit index.html to look like this: - -```html - - - - - - Content Manager - - - - - - -``` - -`index.html` displays the Decap CMS admin interface. You'll use the admin interface to edit your blog posts. - -
  6. - -
  7. Edit config.yml to look like this: - -```yaml -backend: - name: github - branch: main - repo: /my-website - -# These lines should *not* be indented -media_folder: "static/img" # Media files will be stored in the repo under static/images/uploads -public_folder: "/img/" # The src attribute for uploaded media will begin with /images/uploads - -collections: -- name: blog - label: "blog" - folder: blog - identifier_field: title - extension: md - widget: "list" - create: true - slug: "{{year}}-{{month}}-{{day}}-{{slug}}" # Filename template, e.g., YYYY-MM-DD-title.md - fields: - - { name: title, label: Title, widget: string } - - { name: body, label: Body, widget: markdown } - - { name: slug, label: Slug, widget: string } - - label: "Tags" - name: "tags" - widget: "list" - - label: "Authors" - name: "authors" - widget: "list" - fields: - - { name: name, label: Name, widget: string } - - { name: title, label: Title, widget: string } - - { name: url, label: URL, widget: string } - - { name: imageUrl, label: ImageURL, widget: string } -``` - -`config.yml` specifies what kind of content your blog posts have. The content specification enables Decap CMS to edit existing posts and create new ones with the same format. To learn more, read about Decap CMS' [](https://www.decapcms.org/docs/configuration-options/)[Configuration options](https://www.decapcms.org/docs/configuration-options/). -
  8. - -
  9. -Visit localhost:3000/admin - -You can now view and edit `2021-11-15-first-blog-post.md` through the admin interface. You can also create new blog posts. - -**Warning:** Any changes you publish through the admin interface will only effect your *remote GitHub repository*. To retrieve these changes locally, `git pull` from your local repository. -
  10. - -
  11. Commit and push your new changes to your remote repository. - -```bash -git add . -git commit -m "Add Decap CMS" -git push -``` - -Netlify builds and deploys your new changes. - -
  12. - -
- -## Add GitHub as an authentication provider - -Before you can access `/admin/` through your Netlify domain, you need to set up an authentication provider. The authentication provider allows Decap CMS to determine whether users have read and write access to `/admin/`. This guide uses GitHub credentials for authentication. - -### Configure GitHub - -1. Create a new [GitHub OAuth application](https://github.com/settings/applications/new). -2. Enter your Netlify domain as the **Homepage URL**. -3. Enter https://api.netlify.com/auth/done as the **Authorization callback URL**. -4. Click **Register application.** -5. Click **Generate a new client secret.** -6. Copy the provided client secret and client ID. - -### Configure Netlify - -1. On Netlify, under `Site Settings > Access control > OAuth > Authentication Providers`, click **Install provider**. -2. Enter your client secret and client ID from GitHub. -3. Click **Install**. - -🎉 All done! Now you can access the admin interface through your Netlify URL. diff --git a/website/content/docs/dynamic-default-values.md b/website/content/docs/dynamic-default-values.md deleted file mode 100644 index 775886150ca8..000000000000 --- a/website/content/docs/dynamic-default-values.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: Dynamic Default Values -group: Fields -weight: 30 ---- - -When linking to `/admin/#/collections/posts/new` you can pass URL parameters to pre-populate an entry. - -For example given the configuration: - -```yaml -collections: - - name: posts - label: Posts - folder: content/posts - create: true - fields: - - label: Title - name: title - widget: string - - label: Object - name: object - widget: object - fields: - - label: Title - name: title - widget: string - - label: body - name: body - widget: markdown -``` - -clicking the following link: `/#/collections/posts/new?title=first&object.title=second&body=%23%20content` - -will open the editor for a new post with the `title` field populated with `first`, the nested `object.title` field -with `second` and the markdown `body` field with `# content`. - -**Note:** URL Encoding might be required for certain values (e.g. in the previous example the value for `body` is URL encoded). diff --git a/website/content/docs/editorial-workflows.md b/website/content/docs/editorial-workflows.md deleted file mode 100644 index 3ec702446e47..000000000000 --- a/website/content/docs/editorial-workflows.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -group: Workflow -weight: 20 -title: Editorial Workflows ---- - - -By default, saving a post in the CMS interface pushes a commit directly to the publication branch specified in `backend`. However, you also have the option to edit the [Publish Mode](../configuration-options/#publish-mode), which adds an interface for drafting, reviewing, and approving posts. To do this, add the following line to your Decap CMS `config.yml`: - -```yaml -# This line should *not* be indented -publish_mode: editorial_workflow -``` - -From a technical perspective, the workflow translates editor UI actions into common Git commands: - -| Actions in Netlify UI | Perform these Git actions | -| ------------------------- | ----------------------------------------------------------------------------------------------------------------- | -| Save draft | Commits to a new branch (named according to the pattern `cms/collectionName/entrySlug`), and opens a pull request | -| Edit draft | Pushes another commit to the draft branch/pull request | -| Approve and publish draft | Merges pull request and deletes branch | - -**Note:** Editorial workflow works with GitHub repositories, and support for [GitLab](/docs/gitlab-backend/) and [Bitbucket](/docs/bitbucket-backend/). - - -### Bitbucket Support - -In order to track unpublished entries statuses the Bitbucket implementation uses -[pull requests comments](https://confluence.atlassian.com/bitbucketserver/commenting-on-a-pull-request-1027119882.html). - -### GitLab Support - -In order to track unpublished entries statuses the GitLab implementation uses -[merge requests labels](https://docs.gitlab.com/ee/user/project/labels.html). - - -## Squash merge GitHub pull requests - -When using the **Editorial Workflow** with the `github` or GitHub-connected `git-gateway` backends, Decap CMS creates a pull request for each unpublished entry. Every time the unpublished entry is changed and saved, a new commit is added to the pull request. When the entry is published, the pull request is merged, and all of those commits are added to your project commit history in a merge commit. - -The squash merge option causes all commits to be "squashed" into a single commit when the pull request is merged, and the resulting commit is rebased onto the target branch, avoiding the merge commit altogether. - -To enable this feature, you can set the following option in your Decap CMS `config.yml`: - -```yaml -backend: - squash_merges: true -``` diff --git a/website/content/docs/examples.md b/website/content/docs/examples.md deleted file mode 100644 index 023791ce61e7..000000000000 --- a/website/content/docs/examples.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -group: Contributing -weight: 110 -title: Examples ---- - -Do you have a great, open source example? Submit a pull request to this page! - -Example | Tools | Type | Source | More info | ---- | --- | --- | --- | --- -[Gatsby & Decap CMS Meetup Group Template](https://github.com/robertcoopercode/gatsby-netlify-cms) | Gatsby | demo | [robertcoopercode/gatsby-netlify-cms](https://github.com/robertcoopercode/gatsby-netlify-cms) | [blog post](https://blog.logrocket.com/gatsby-netlify-cms-a-perfect-pairing-d50d59d16f67) -[This Developing Journey](https://briandouglas.me) | middleman | blog | [bdougie/blog](https://github.com/bdougie/blog) | [blog post](https://www.netlify.com/blog/2017/04/20/creating-a-blog-with-middleman-and-netlify-cms/) -[Jamstack Recipes](https://jamstack-cms.netlify.com) | Hugo, Azure | demo | [hlaueriksson/jamstack-cms](https://github.com/hlaueriksson/jamstack-cms) | [blog post](http://conductofcode.io/post/managing-content-for-a-jamstack-site-with-netlify-cms/) -[Bael](https://bael-theme.jake101.com/) | Vue, Nuxt | blog | [jake-101/bael-template](https://github.com/jake-101/bael-template) | [blog post](https://bael-theme.jake101.com/blog/2018-06-19-top-10-reasons-why) -[Forest Garden Wales](https://github.com/forestgardenwales/forestgarden.wales) | Hugo | blog | [forestgardenwales/forestgarden.wales](https://github.com/forestgardenwales/forestgarden.wales) | [blog post](https://www.forestgarden.wales/blog/now-using-netlify-cms/) -[Jekyll Demo](https://jekyll-netlifycms.netlify.com/) | Jekyll, Gulp | demo | [NickStees/jekyll-cms](https://github.com/NickStees/jekyll-cms) | [read me](https://github.com/NickStees/jekyll-cms) -[Jekyll feat Alembic Theme Demo](https://alembic-kit-demo.netlify.com/) | Jekyll | demo | [DavidDarnes/alembic-netlifycms-kit](https://github.com/daviddarnes/alembic-netlifycms-kit) | [read me](https://github.com/daviddarnes/alembic-netlifycms-kit#starter-kit-for-alembic-with-netlify-cms) -[Eleventy Starter Project](https://eleventy-netlify-boilerplate.netlify.com/) | Eleventy | demo | [danurbanowicz/eleventy-netlify-boilerplate](https://github.com/danurbanowicz/eleventy-netlify-boilerplate) | [read me](https://github.com/danurbanowicz/eleventy-netlify-boilerplate) -[YellowCake - Complete website with blog](https://yellowcake.netlify.com) | Gatsby, Netlify-CMS, Uploadcare | demo | [thriveweb/yellowcake](https://github.com/thriveweb/yellowcake/) | [blog post](https://thriveweb.com.au/the-lab/yellowcake-gatsby-react-js-starter-project/) -[Vue.js - Nuxt.js Starter Project](https://github.com/renestalder/nuxt-netlify-cms-starter-template) | Vue, Nuxt | demo | [renestalder/nuxt-netlify-cms-starter-template](https://github.com/renestalder/nuxt-netlify-cms-starter-template) | [read me](https://github.com/renestalder/nuxt-netlify-cms-starter-template) -[Hexo Demo](https://hexo-boilerplate.netlify.app/) | Hexo | demo | [DemoMacro/Hexo-NetlifyCMS](https://github.com/DemoMacro/Hexo-NetlifyCMS) | [read me](https://github.com/DemoMacro/Hexo-NetlifyCMS) -[Gitbook Demo](https://gitbook-boilerplate.netlify.app/) | Gitbook | demo | [DemoMacro/Gitbook-NetlifyCMS](https://github.com/DemoMacro/Gitbook-NetlifyCMS) | [read me](https://github.com/DemoMacro/Gitbook-NetlifyCMS) -[VuePress Demo](https://vuedn.netlify.app/) | VuePress | demo | [NdagiStanley/VueDN](https://github.com/NdagiStanley/VueDN) | [read me](https://github.com/NdagiStanley/VueDN) -[Jigsaw Blog Starter Template Demo](https://jigsaw-blog-netlify-netlifycms-template.netlify.com/) | Jigsaw | demo | [erickpatrick/jigsaw-blog-netlify-netlifycms-template](https://github.com/erickpatrick/jigsaw-blog-netlify-netlifycms-template) | [blog post](https://www.erickpatrick.net/blog/augmenting-tightenco-jigsaw-with-netlifycms/) -[Nuxt & NetlifyCMS Boilerplate](https://nuxt-netlifycms-boilerplate.netlify.com/) | Vue, Nuxt | demo | [tylermercer/nuxt-netlifycms-boilerplate](https://github.com/tylermercer/nuxt-netlifycms-boilerplate) | [read me](https://github.com/tylermercer/nuxt-netlifycms-boilerplate) -[Next.js demo](https://netlifycms-nextjs.netlify.com) | Next.js | blog | [masives/netlifycms-nextjs](https://github.com/masives/netlifycms-nextjs) | [read me](https://github.com/masives/netlifycms-nextjs) -[Delog - Jamstack Blog with Decap CMS](https://delog-w3layouts.netlify.com/) | Gatsby, Netlify-CMS | demo | [W3Layouts/gatsby-starter-delog](https://github.com/W3Layouts/gatsby-starter-delog) | [blog post](https://w3layouts.com/articles/delog-gatsby-starter-netlify-cms/) -[Decap CMS template for Gridsome](https://netlifycms-gridsome.suits.at/) | Gridsome, Vue | demo | [suits-at/netlifycms-gridsome](https://github.com/suits-at/netlifycms-gridsome) | [read me](https://github.com/suits-at/netlifycms-gridsome) -[Next.js blogging template for Netlify](https://nextjs-netlify-blog-template.netlify.app/) | Next.js, Netlify | blog | [wutali/nextjs-netlify-blog-template](https://github.com/wutali/nextjs-netlify-blog-template) | [read me](https://github.com/wutali/nextjs-netlify-blog-template) -[Decap CMS and OAuth server on AWS](https://github.com/pulumi/examples/tree/master/aws-ts-netlify-cms-and-oauth) | Netlify, Pulumi, AWS | blog | [pulumi/examples/aws-ts-netlify-cms-and-oauth](https://github.com/pulumi/examples/tree/master/aws-ts-netlify-cms-and-oauth) | [blog post](https://www.pulumi.com/blog/deploying-the-infrastructure-of-oauth-server-for-cms-app/) -[Eleventy Starter Boilerplate](https://creativedesignsguru.com/demo/Eleventy-Starter-Boilerplate/eleventy-starter-boilerplate-presentation/) | Eleventy, Netlify | demo | [ixartz/Eleventy-Starter-Boilerplate](https://github.com/ixartz/Eleventy-Starter-Boilerplate) | [read me](https://github.com/ixartz/Eleventy-Starter-Boilerplate) -[Nuxt, Tailwind & NetlifyCMS Boilerplate](https://ntn-boilerplate.netlify.app/) | Vue, Nuxt | demo | [Knogobert/ntn-boilerplate](https://github.com/Knogobert/ntn-boilerplate) | [read me](https://github.com/Knogobert/ntn-boilerplate#readme) -[Gatsby & Decap CMS Personal Portfolio](https://kind-mestorf-5a2bc0.netlify.com/) | Gatsby | portfolio | [EarlGeorge/React-Gatsby](https://github.com/EarlGeorge/React-Gatsby) | [read me](https://github.com/EarlGeorge/React-Gatsby/blob/master/README.md) -[Gatsby, Tailwind CSS & NetlifyCMS Starter](https://infallible-varahamihira-058515.netlify.app/) | Gatsby v3, Netlify-CMS, Tailwind CSS | demo | [jimmybutton/gatsby-netlifycms-tailwind-starter](https://github.com/jimmybutton/gatsby-netlifycms-tailwind-starter) | [read me](https://github.com/jimmybutton/gatsby-netlifycms-tailwind-starter#readme) -[Metalsmith NetlifyCMS Starter](https://metalsmith-netlify-starter.netlify.app/) | Metalsmith and Netlify-CMS | demo | [metalsmith-netlify-starter](https://github.com/wernerglinka/metalsmith-netlify-starter) | [read me](https://github.com/wernerglinka/metalsmith-netlify-starter#readme) diff --git a/website/content/docs/external-oauth-clients.md b/website/content/docs/external-oauth-clients.md deleted file mode 100644 index efeceb186ccd..000000000000 --- a/website/content/docs/external-oauth-clients.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -group: Accounts -weight: 60 -title: External OAuth Clients ---- -If you would like to facilitate your own OAuth authentication rather than use Netlify's service or a client side flow like implicit or PKCE, you can use one of the community-maintained projects below. Feel free to hit the "Edit this page" button if you'd like to add yours! - -| Author | Supported Git hosts | Language(s)/Platform(s) | Link | -| ------------------------------------------------------------ | --------------------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| [@vencax](https://github.com/vencax) | GitHub, GitHub Enterprise | Node.js | [Repo](https://github.com/vencax/netlify-cms-github-oauth-provider) | -| [@igk1972](https://github.com/igk1972) | GitHub, GitHub Enterprise | Go | [Repo](https://github.com/igk1972/netlify-cms-oauth-provider-go) | -| [@davidejones](https://github.com/davidejones) | GitHub, GitHub Enterprise | Python | [Repo](https://github.com/davidejones/netlify-cms-oauth-provider-python) | -| [@marcelkornblum](https://github.com/marcelkornblum) | GitHub, GitHub Enterprise | Google AppEngine with Python | [Repo](https://github.com/signal-noise/netlify-cms-oauth-provider-python-appengine) | -| [@marksteele](https://github.com/marksteele) | GitHub, GitHub Enterprise | Serverless | [Repo](https://github.com/marksteele/netlify-serverless-oauth2-backend), [Blog](https://www.control-alt-del.org/blog/serverless-blog-howto/) | -| [@Herohtar](https://github.com/Herohtar) | GitHub, GitHub Enterprise | Firebase Cloud Function | [Repo](https://github.com/Herohtar/netlify-cms-oauth-firebase) | -| [@abcalderon3](https://github.com/abcalderon3) | GitHub, GitHub Enterprise | Google Cloud Function with Python | [Repo](https://github.com/abcalderon3/netlify-cms-oauth-client-cloud-function) | -| [@TSV-Zorneding-1920](https://github.com/TSV-Zorneding-1920) | GitHub, GitHub Enterprise | PHP | [Repo](https://github.com/TSV-Zorneding-1920/netlify-cms-oauth-provider-php) | -| [@bericp1](https://github.com/bericp1) | GitHub, GitHub Enterprise | Node.js, Vercel Serverless | [Repo](https://github.com/bericp1/netlify-cms-oauth-provider-node) | -| [@mcdeck](https://github.com/mcdeck) | GitHub, GitHub Enterprise, GitLab | PHP | [Repo](https://github.com/mcdeck/netlify-cms-oauth-provider-php), [Blog](https://www.van-porten.de/blog/2021/01/netlify-auth-provider/) | -| [@deepbass](https://github.com/deepbass) | GitHub, GitHub Enterprise | Node.js Azure Functions | [Repo](https://github.com/deepbass/serverless-cms-azure), [Blog](https://www.danielbass.dev/building-a-serverless-cms-on-azure-with-netlify-cms-and-gatsby/) | -| [@adrian-ub](https://github.com/adrian-ub) | GitHub, GitLab | TypeScript | [Repo](https://github.com/ublabs/netlify-cms-oauth) | -| [@hatappo](https://github.com/hatappo) | GitHub | ClojureScript, Firebase Functions | [Repo](https://github.com/hatappo/netlifycms-oauth-server) | -| [@njfamirm](https://github.com/njfamirm) | GitHub | Node.js, Typescript | [Repo](https://github.com/njfamirm/decap-cms-github-backend), [Blog](https://www.njfamirm.ir/en/blog/self-hosting-decap-cms/) | -| [@augustogunsch](https://github.com/augustogunsch) | GitHub, GitHub Enterprise, GitLab | Rust | [Repo](https://github.com/augustogunsch/decap_oauth) | - -Check each project's documentation for instructions on installation and usage. diff --git a/website/content/docs/gatsby.md b/website/content/docs/gatsby.md deleted file mode 100644 index ad280baa3d29..000000000000 --- a/website/content/docs/gatsby.md +++ /dev/null @@ -1,138 +0,0 @@ ---- -title: Gatsby -group: Guides -weight: 10 ---- -This guide will help you get started using Decap CMS and Gatsby. - -To get up and running with Gatsby, you’ll need to have [Node.js](https://nodejs.org/) installed on your computer. *Note: Gatsby's minimum supported Node.js version is Node 8.* - -## Create a new Gatsby site - -Let's create a new site using the default Gatsby Starter Blog. Run the following commands in the terminal, in the folder where you'd like to create the blog: - -```bash -npm install -g gatsby-cli -gatsby new blog https://github.com/gatsbyjs/gatsby-starter-blog -cd blog -``` - -## Get to know Gatsby - -In your favorite code editor, open up the code generated for your "Gatsby Starter Blog" site, and take a look at the `content` directory. - -You will see that there are multiple Markdown files that represent blog posts. Open one `.md` file and you will see something like this: - -```yml ---- -title: New Beginnings -date: "2015-05-28T22:40:32.169Z" -description: This is an optional description for SEO and Open Graph purposes, rather than the default generated excerpt. ---- - -Far far away, behind the word mountains, far from the countries Vokalia and -Consonantia, there live the blind texts. -``` - -We can see above that each blog post has a title, a date, a description and a body. Now, let's recreate this using Decap CMS. - -## Add Decap CMS to your site - -First let's install some dependencies. We'll need `decap-cms-app` and `gatsby-plugin-netlify-cms`. Run the following command in the terminal at the root of your site: - -```bash -npm install --save decap-cms-app gatsby-plugin-netlify-cms -``` - -### Configuration - -For the purpose of this guide we will deploy to Netlify from a GitHub repository which requires the minimum configuration. - -Create a `config.yml` file in the directory structure you see below: - -```bash -├── static -│ ├── admin -│ │ ├── config.yml -``` - -In your `config.yml` file paste the following configuration: - -```yml -backend: - name: git-gateway - branch: main # Branch to update (optional; defaults to master) - -media_folder: static/img -public_folder: /img - -collections: - - name: 'blog' - label: 'Blog' - folder: 'content/blog' - create: true - slug: 'index' - media_folder: '' - public_folder: '' - path: '{{title}}/index' - editor: - preview: false - fields: - - { label: 'Title', name: 'title', widget: 'string' } - - { label: 'Publish Date', name: 'date', widget: 'datetime' } - - { label: 'Description', name: 'description', widget: 'string' } - - { label: 'Body', name: 'body', widget: 'markdown' } -``` - -**Note:** The above configuration allows assets to be stored relative to their content. Therefore posts would be stored in the format below as it is in `gatsby-starter-blog`. - -```bash -content/ -├── blog -│ ├── first-post-title -│ │ ├── index.md -│ │ └── post-image.jpg -└── └── second-post-title - ├── index.md - └── post-image.jpg -``` - -Finally, add the plugin to your `gatsby-config.js`. - -```javascript -plugins: [`gatsby-plugin-netlify-cms`] -``` - -### Push to GitHub - -It's now time to commit your changes and push to GitHub. The Gatsby starter initializes Git automatically for you, so you only need to do: - -```bash -git add . -git commit -m "Initial Commit" -git remote add origin https://github.com/YOUR_USERNAME/NEW_REPO_NAME.git -git push -u origin main -``` - -### Add your repo to Netlify - -Go to Netlify and select 'New Site from Git'. Select GitHub and the repository you just pushed to. Click Configure Netlify on GitHub and give access to your repository. Finish the setup by clicking Deploy Site. Netlify will begin reading your repository and starting building your project. - -### Enable Identity and Git Gateway - -Netlify's Identity and Git Gateway services allow you to manage CMS admin users for your site without requiring them to have an account with your Git host or commit access on your repo. From your site dashboard on Netlify: - -1. Go to **Settings > Identity**, and select **Enable Identity service**. -2. Under **Registration preferences**, select **Open** or **Invite only**. In most cases, you want only invited users to access your CMS, but if you're just experimenting, you can leave it open for convenience. -3. If you'd like to allow one-click login with services like Google and GitHub, check the boxes next to the services you'd like to use, under **External providers**. -4. Scroll down to **Services > Git Gateway**, and click **Enable Git Gateway**. This authenticates with your Git host and generates an API access token. In this case, we're leaving the **Roles** field blank, which means any logged in user may access the CMS. For information on changing this, check the [Netlify Identity documentation](https://www.netlify.com/docs/identity/). - -## Start publishing - -It's time to create your first blog post. Login to your site's `/admin/` page and create a new post by clicking New Blog. Add a title, a date and some text. When you click Publish, a new commit will be created in your GitHub repo with this format `Create Blog “year-month-date-title”`. - -Then Netlify will detect that there was a commit in your repo, and will start rebuilding your project. When your project is deployed you'll be able to see the post you created. - -### Cleanup - -It is now safe to remove the default Gatsby blog posts. diff --git a/website/content/docs/git-gateway-backend.md b/website/content/docs/git-gateway-backend.md deleted file mode 100644 index 3766bde33fcd..000000000000 --- a/website/content/docs/git-gateway-backend.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: Git Gateway -weight: 10 -group: Accounts ---- - -[Git Gateway](https://github.com/netlify/git-gateway) is a Netlify open source project that allows you to add editors to your site CMS without giving them direct write access to your GitHub or GitLab repository. (For Bitbucket repositories, use the [Bitbucket backend](../bitbucket-backend/) instead.) - -## Git Gateway with Netlify - -The [Netlify Identity](https://www.netlify.com/docs/identity/) service can handle the authentication and provides a simple interface for user management. The Decap CMS [featured templates](../start-with-a-template) are working examples of this backend. - -To use it in your own project stored on GitHub or GitLab, follow these steps: - -1. Head over to the [Netlify Identity docs](https://www.netlify.com/docs/identity) and follow the steps to get started. -2. Add the following lines to your Decap CMS `config.yml` file: - -```yaml -backend: - name: git-gateway -``` - -## Reconnect after Changing Repository Permissions - -If you change ownership on your repository, or convert a repository from public to private, you may need to reconnect Git Gateway with proper permissions. Find further instructions in the [Netlify Git Gateway docs](https://www.netlify.com/docs/git-gateway/#reconnect-after-changing-repository-permissions). - -## Git Gateway without Netlify - -You can use [Git Gateway](https://github.com/netlify/git-gateway) without Netlify by setting up your own Git Gateway server and connecting it with your own instance of [GoTrue](https://www.gotrueapi.org) (the open source microservice that powers Netlify Identity), or with any other identity service that can issue JSON Web Tokens (JWT). - -To configure in Decap CMS, use the same `backend` settings in your Decap CMS `config.yml` file as described in Step 2 of the [Git Gateway with Netlify Identity](#git-gateway-with-netlify-identity) instructions above. diff --git a/website/content/docs/gitea-backend.md b/website/content/docs/gitea-backend.md deleted file mode 100644 index e9faaf392a6a..000000000000 --- a/website/content/docs/gitea-backend.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: Gitea -group: Accounts -weight: 25 ---- - -For repositories stored on Gitea, the `gitea` backend allows CMS users to log in directly with their Gitea account. Note that all users must have push access to your content repository for this to work. - -Please note that only Gitea **1.20** and upwards is supported due to API limitations in previous versions. - -## Authentication - -With Gitea's PKCE authorization, users can authenticate with Gitea directly from the client. To do this: - -1. Add your Decap CMS instance as an OAuth application in your user/organization settings or through the admin panel of your Gitea instance. Please make sure to uncheck the **Confidential Client** checkbox. For the **Redirect URIs**, enter the addresses where you access Decap CMS, for example, `https://www.mysite.com/admin/`. -2. Gitea provides you with a **Client ID**. Copy it and insert it into your `config` file along with the other options: - -```yaml -backend: - name: gitea - repo: owner-name/repo-name # Path to your Gitea repository - app_id: your-client-id # The Client ID provided by Gitea - api_root: https://gitea.example.com/api/v1 # API URL of your Gitea instance - base_url: https://gitea.example.com # Root URL of your Gitea instance - # optional, defaults to master - # branch: main -``` - -## Git Large File Storage (LFS) - -Please note that the Gitea backend **does not** support [git-lfs](https://git-lfs.github.com/). diff --git a/website/content/docs/github-backend.md b/website/content/docs/github-backend.md deleted file mode 100644 index dfbebd3965a0..000000000000 --- a/website/content/docs/github-backend.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -group: Accounts -weight: 30 -title: GitHub ---- -For repositories stored on GitHub, the `github` backend allows CMS users to log in directly with their GitHub account. Note that all users must have push access to your content repository for this to work. - -Because GitHub [requires a server](https://github.com/decaporg/decap-cms/issues/663#issuecomment-335023723) for authentication, Netlify facilitates basic GitHub authentication. - -To enable basic GitHub authentication: - -1. Follow the authentication provider setup steps in the [Netlify docs](https://www.netlify.com/docs/authentication-providers/#using-an-authentication-provider). -2. Add the following lines to your Decap CMS `config.yml` file: - -```yaml -backend: - name: github - repo: owner-name/repo-name # Path to your GitHub repository - # optional, defaults to master - # branch: main -``` - -## Specifying a status for deploy previews - -The GitHub backend supports [deploy preview links](../deploy-preview-links). Decap CMS checks the -`context` of a commit's [statuses](https://help.github.com/articles/about-status-checks/) and infers -one that seems to represent a deploy preview. If you need to customize this behavior, you can -specify which context to look for using `preview_context`: - -```yaml -backend: - name: github - repo: my/repo - preview_context: my-provider/deployment -``` - -The above configuration would look for the status who's `"context"` is `"my-provider/deployment"`. - -## Git Large File Storage (LFS) - -Please note that the GitHub backend **does not** support [git-lfs](https://git-lfs.github.com/), see [this issue](https://github.com/decaporg/decap-cms/issues/1206) for more information. - - -## GraphQL API - -**Note: not compatible with `git-gateway`** - -GraphQL allows to retrieve data using less individual API requests compared to a REST API. GitHub's GraphQL API still does not support all mutations necessary to completely replace their REST API, so this feature only calls the new GraphQL API where possible. - -You can use the GraphQL API for the GitHub backend by setting `backend.use_graphql` to `true` in your CMS config: - -```yml -backend: - name: github - repo: owner/repo # replace this with your repo info - use_graphql: true -``` - -Learn more about the benefits of GraphQL in the [GraphQL docs](https://graphql.org). diff --git a/website/content/docs/gitlab-backend.md b/website/content/docs/gitlab-backend.md deleted file mode 100644 index da898714fb7c..000000000000 --- a/website/content/docs/gitlab-backend.md +++ /dev/null @@ -1,115 +0,0 @@ ---- -title: GitLab -group: Accounts -weight: 40 ---- -For repositories stored on GitLab, the `gitlab` backend allows CMS users to log in directly with their GitLab account. Note that all users must have push access to your content repository for this to work. - -**Note:** GitLab default branch is protected by default, thus typically requires `maintainer` permissions in order for users to have push access. - -The GitLab API allows for three types of OAuth2 flows: - -* [Authorization Code Flow](https://docs.gitlab.com/ce/api/oauth2.html#authorization-code-flow), which works much like the GitHub OAuth flow described above. -* [Authorization Code with PKCE Flow](https://docs.gitlab.com/ce/api/oauth2.html#authorization-code-with-proof-key-for-code-exchange-pkce), which operates *without* the need for an authentication server. -* (DEPRECATED [Implicit Grant Flow](https://docs.gitlab.com/ce/api/oauth2.html#implicit-grant-flow), which operates *without* the need for an authentication server. - -## Authorization Code Flow with Netlify - -When using GitLab's Authorization Code Flow for authentication, you can use Netlify to handle the server-side authentication requests. - -To enable it: - -1. Follow the [GitLab docs](https://docs.gitlab.com/ee/integration/oauth_provider.html#adding-an-application-through-the-profile) to add your Decap CMS instance as an OAuth application. For the **Redirect URI**, enter `https://api.netlify.com/auth/done`, and check the box for `api` scope. -2. Follow the [Netlify docs](https://www.netlify.com/docs/authentication-providers/#using-an-authentication-provider) to add your new GitLab Application ID and Secret to your Netlify site dashboard. -3. In your repository, add the following lines to your Decap CMS `config.yml` file: - -```yaml -backend: - name: gitlab - repo: owner-name/repo-name # Path to your GitLab repository -``` - - -## Client-Side PKCE Authorization - -With GitLab's PKCE authorization, users can authenticate with GitLab directly from the client. To do this: - -1. Follow the [GitLab docs](https://docs.gitlab.com/ee/integration/oauth_provider.html#adding-an-application-through-the-profile) to add your Decap CMS instance as an OAuth application and uncheck the **Confidential** checkbox. For the **Redirect URI**, enter the address where you access Decap CMS, for example, `https://www.mysite.com/admin/`. For scope, select `api`. -2. GitLab gives you an **Application ID**. Copy this ID and enter it in your Decap CMS `config.yml` file, along with the following settings: - - ```yaml - backend: - name: gitlab - repo: owner-name/repo-name # Path to your GitLab repository - auth_type: pkce # Required for pkce - app_id: your-app-id # Application ID from your GitLab settings - ``` - - You can also use PKCE Authorization with a self-hosted GitLab instance. This requires adding `api_root`, `base_url`, and `auth_endpoint` fields: - - ```yaml - backend: - name: gitlab - repo: owner-name/repo-name # Path to your GitLab repository - auth_type: pkce # Required for pkce - app_id: your-app-id # Application ID from your GitLab settings - api_root: https://my-hosted-gitlab-instance.com/api/v4 - base_url: https://my-hosted-gitlab-instance.com - auth_endpoint: oauth/authorize - ``` - - -**Note:** In all cases, GitLab also provides you with a client secret. You should *never* store this in your repo or reveal it in the client. - - -## GraphQL API - -**Note: not compatible with `git-gateway`** - -GraphQL allows to retrieve data using less individual API requests compared to a REST API. -The current implementation uses the GraphQL API in specific cases, where using the REST API can be slow and lead to exceeding GitLab's rate limits. As we receive feedback and extend the feature, we'll migrate more functionality to the GraphQL API. - -You can enable the GraphQL API for the GitLab backend by setting `backend.use_graphql` to `true` in your CMS config: - -```yml -backend: - name: gitlab - repo: owner/repo # replace this with your repo info - use_graphql: true - - # optional, defaults to 'https://gitlab.com/api/graphql'. Can be used to configure a self hosted GitLab instance. - graphql_api_root: https://my-self-hosted-gitlab.com/api/graphql -``` - -Learn more about the benefits of GraphQL in the [GraphQL docs](https://graphql.org). - - -## (DEPRECATED) Client-Side Implicit Grant - -**Note:** This method is not recommended and will be deprecated both [by GitLab](https://gitlab.com/gitlab-org/gitlab/-/issues/288516) and [in the OAuth 2.1 specification](https://oauth.net/2.1/) in the future. - -With GitLab's Implicit Grant, users can authenticate with GitLab directly from the client. To do this: - -1. Follow the [GitLab docs](https://docs.gitlab.com/ee/integration/oauth_provider.html#adding-an-application-through-the-profile) to add your Decap CMS instance as an OAuth application and uncheck the **Confidential** checkbox. For the **Redirect URI**, enter the address where you access Decap CMS, for example, `https://www.mysite.com/admin/`. For scope, select `api`. -2. GitLab gives you an **Application ID**. Copy this ID and enter it in your Decap CMS `config.yml` file, along with the following settings: - -```yaml -backend: - name: gitlab - repo: owner-name/repo-name # Path to your GitLab repository - auth_type: implicit # Required for implicit grant - app_id: your-app-id # Application ID from your GitLab settings -``` - -You can also use Implicit Grant with a self-hosted GitLab instance. This requires adding `api_root`, `base_url`, and `auth_endpoint` fields: - -```yaml -backend: - name: gitlab - repo: owner-name/repo-name # Path to your GitLab repository - auth_type: implicit # Required for implicit grant - app_id: your-app-id # Application ID from your GitLab settings - api_root: https://my-hosted-gitlab-instance.com/api/v4 - base_url: https://my-hosted-gitlab-instance.com - auth_endpoint: oauth/authorize -``` diff --git a/website/content/docs/gridsome.md b/website/content/docs/gridsome.md deleted file mode 100644 index 6f26adb1c2db..000000000000 --- a/website/content/docs/gridsome.md +++ /dev/null @@ -1,159 +0,0 @@ ---- -group: Guides -weight: 70 -title: Gridsome ---- -This guide will help you get started using Decap CMS and Gridsome. - -## How to install Gridsome -### 1. Install Gridsome CLI tool - -```bash -# Using Yarn -yarn global add @gridsome/cli - -# Using NPM -npm install --global @gridsome/cli -``` - -## Create a new Gridsome website - -```bash -# To create a new project run -gridsome create gridsome-netlify-blog - -# Then navigate to the project folder -cd gridsome-netlify-blog - -# To start local dev server at http://localhost:8080 -gridsome develop -``` - -### Install Decap CMS the required dependencies to your project - -```bash - -# Using Yarn -yarn add decap-cms gridsome-plugin-netlify-cms @gridsome/source-filesystem @gridsome/transformer-remark - -# Using NPM -npm add decap-cms gridsome-plugin-netlify-cms @gridsome/source-filesystem @gridsome/transformer-remark -``` - -Now that the plugins are installed, it's time to setup the configuration. Open the `gridsome.config.js` file and update its content to: - -```js -module.exports = { - siteName: 'Gridsome', - transformers: { - remark: { - externalLinksTarget: '_blank', - externalLinksRel: ['nofollow', 'noopener', 'noreferrer'], - anchorClassName: 'icon icon-link' - } - }, - - plugins: [ - { - use: '@gridsome/source-filesystem', - options: { - path: 'posts/**/*.md', - typeName: 'Post' - } - }, - { - use: `gridsome-plugin-decap-cms`, - options: { - publicPath: `/admin` - } - }, - ] -} -``` - -Please read [gridsome-plugin-netlify-cms](https://gridsome.org/plugins/gridsome-plugin-netlify-cms), [transformer-remark](https://gridsome.org/plugins/@gridsome/transformer-remark) for more information. - -## Decap CMS setup - -1. Create an `admin` directory inside the `src` -2. Create an `uploads` directory inside the root of your project -3. Add `index.html`, `index.js` and a `config.yml` file to your `admin` directory - -Your `index.html` should look like this: - -```html - - - - - - Decap CMS - - - - - -``` - -Your `index.js` should look like this: - -```js -import CMS from "decap-cms" -``` - -Your `config.yml` for GitHub should look like this: - -```yml -backend: - name: git-gateway - branch: main # Branch to update (optional; defaults to master) - -media_folder: "static/uploads" -public_folder: "/uploads" - -collections: - - name: "posts" - label: "Posts" - folder: "posts" - create: true - slug: "{{slug}}" - fields: - - {label: "Title", name: "title", widget: "string"} - - {label: "Excerpt", name: "excerpt", widget: "string"} - - {label: "Publish Date", name: "date", widget: "datetime"} - - {label: "Body", name: "body", widget: "markdown"} -``` - -## Push to GitHub - -It's now time to commit your changes and push to GitHub. - -```bash -git init -git add . -git commit -m "Initial Commit" -git remote add origin https://github.com/YOUR_USERNAME/NEW_REPO_NAME.git -git push -u origin main -``` - -### Add your repo to Netlify - -Go to Netlify and select 'New Site from Git'. Select GitHub and the repository you just pushed to. Click Configure Netlify on GitHub and give access to your repository. Finish the setup by clicking Deploy Site. Netlify will begin reading your repository and starting building your project. - -### Enable Identity and Git Gateway - -Netlify's Identity and Git Gateway services allow you to manage CMS admin users for your site without requiring them to have an account with your Git host or commit access on your repo. From your site dashboard on Netlify: - -1. Go to **Settings > Identity**, and select **Enable Identity service**. -2. Under **Registration preferences**, select **Open** or **Invite only**. In most cases, you want only invited users to access your CMS, but if you're just experimenting, you can leave it open for convenience. -3. If you'd like to allow one-click login with services like Google and GitHub, check the boxes next to the services you'd like to use, under **External providers**. -4. Scroll down to **Services > Git Gateway**, and click **Enable Git Gateway**. This authenticates with your Git host and generates an API access token. In this case, we're leaving the **Roles** field blank, which means any logged in user may access the CMS. For information on changing this, check the [Netlify Identity documentation](https://www.netlify.com/docs/identity/). - - -## Start publishing - -It's time to create your first blog post. Login to your site's `/admin/` page and create a new post by clicking New Blog. Add a title, a date and some text. When you click Publish, a new commit will be created in your GitHub repo with this format `Create Blog “year-month-date-title”`. - -Then Netlify will detect that there was a commit in your repo, and will start rebuilding your project. When your project is deployed you'll be able to see the post you created. - -Your basic blog scaffold is done, now you can query data from the GraphQL server just like you're working with the filesystem. For more info read [querying data](https://gridsome.org/docs/querying-data). diff --git a/website/content/docs/hugo.md b/website/content/docs/hugo.md deleted file mode 100644 index 1c3430bbea64..000000000000 --- a/website/content/docs/hugo.md +++ /dev/null @@ -1,246 +0,0 @@ ---- -title: Hugo -group: Guides -weight: 20 ---- -## Introduction - -This guide will walk you through how to integrate Decap CMS with Hugo. This is a good place to start if you want to learn from the ground up how these two tools work together. If you want to get up-and-running quicker, you can use one of the pre-existing and amazing [starter templates](/docs/start-with-a-template/)! - -## Getting started with Hugo - -### Installation - -To get started with Hugo, you should first install the command line tool. If you've already got it installed, you can [skip this step](#creating-a-new-site). On MacOS and Linux you can do this with: - -```bash -brew install hugo -``` - -To test that it's successfully installed, you can try this command, to get a list of Hugo's options: - -```bash -hugo help -``` - -### Creating a new site - -Create a new Hugo project and start it up using the following commands. - -```bash -hugo new site -cd -hugo server -``` - -You won't actually see anything, just yet, and that's because you don't have any template files. That's easily resolved. In the `layouts/` directory, create a file `index.html` and put a basic HTML structure in there: - -```html - - - - - - - Document - - -

Nice. It's looking good already.

- - -``` - -You'll also add some files to the `content/` and `data/` directories to make sure git tracks them. - -```bash -touch content/.keep data/.keep -``` - -This is as basic as you can get with a Hugo project. There's just enough here now for us to install Decap CMS. - -## Getting Started With Decap CMS - -### Add the Decap CMS files to Hugo - -In Hugo, static files that don't need to be processed by the build commands live in the `static/` directory. You'll install the Decap CMS admin and config files there. Create a directory `admin/` and within it, create two files `index.html` and `config.yml`. In the `index.html`, add the following content: - -```html - - - - - - Content Manager - - - - - - - - -``` - -In the `config.yml` file, you can add this basic configuration — you can customize as you see fit, this sample file is just to get you started. - -```yaml -backend: - name: git-gateway - branch: main # Branch to update (optional; defaults to master) -media_folder: static/img -public_folder: /img -collections: - - name: 'blog' - label: 'Blog' - folder: 'content/blog' - create: true - slug: '{{year}}-{{month}}-{{day}}-{{slug}}' - editor: - preview: false - fields: - - { label: 'Title', name: 'title', widget: 'string' } - - { label: 'Publish Date', name: 'date', widget: 'datetime' } - - { label: 'Description', name: 'description', widget: 'string' } - - { label: 'Body', name: 'body', widget: 'markdown' } -``` - -**Note:** You won't be able to access the CMS just yet — you still need to deploy the project with **Netlify** and authenticate with **Netlify Identity**. You'll handle this in the next few steps of this guide. - -### Pushing to GitHub - -It's now time to commit your changes and push to GitHub. You can run the following commands to initialize a git repository and push the changes so far. - -```bash -git init # Initialize a git repository -git add . # Add every file -git commit -m "Initial Commit" # Commit every file with the message 'Initial Commit' -git remote add origin https://github.com/YOUR_USERNAME/NEW_REPO_NAME.git # Create a new repo on GitHub and add it to this project as a remote repository. -git push -u origin main # Push your changes -``` - -### Deploying With Netlify - -Now you can go ahead and deploy to Netlify. Go to your Netlify dashboard and click **[New site from Git](https://app.netlify.com/start)**. Select the repo you just created. Under **Basic build settings**, you can set the build command to `hugo` and the publish directory to `public`. Click **Deploy site** to get the process going. - -### Authenticating with Netlify Identity - -**Add the Netlify Identity Widget** - -You've already added the Netlify Identity widget to our `admin/index.html`. The next thing to do is add the Netlify Identity widget to our site's index page. In `layouts/index.html`, we can add the following to the `` tag on the page: - -```html - -``` - -Once you've added this, make sure to push your changes to GitHub! - -### Enable Identity & Git Gateway in Netlify - -Back in your [Netlify dashboard](https://app.netlify.com/): - -1. Go to **Settings > Identity**, and select **Enable Identity service**. -2. Once enabled, select **Settings and usage**, and scroll down to **Registration preferences**. You can set this to either **Open** or **Invite only**, but usually **Invite only** is your best bet for a personal site. -3. If you don't want to create an account, or would like to use an external provider such as GitHub or Google, you can enable those services under **External providers**. -4. Scroll down to **Services** and click **Enable Git Gateway**. - -### Accessing the CMS - -Once you've reached this point, you should be able to access the CMS in your browser at `http://localhost:1313/admin`. You'll be prompted to add the URL of your Netlify site. Once you've added that URL, you can log in with an Identity account or with one of the External Providers you enabled in step 3 above. For the sake of this tutorial, you can create a blog post in the CMS, and publish it! Once you `git pull` in your project, the blog post will show up in the project at `content/blog/.md`. - -And that's it! From this point on, it's just a matter of following [the Hugo documentation](https://gohugo.io/templates/) for outputting the content from your `content/` directory into templates! For more information on configuring Decap CMS, feel free to check out the [Decap CMS configuration options documentation](/docs/configuration-options/). - -## Using Decap CMS content in Hugo - -### Creating a list of posts - -In your `layouts/index.html` file, you'll create an unordered list element and use a Hugo `range` to output all posts. Inside that range, you can add a list item element with each post title and a link to the post inside it. - -**Note:** To learn more about Hugo's `range` function, check out [the Hugo documentation](https://gohugo.io/functions/range). - -```html - -

Nice. It's looking good already.

- - -``` - -That link won't work just right just yet. You'll need to make a single page layout for blog posts, so Hugo can create a page for the `.RelPermalink` to link to. - -### Creating a single page post layout - -Create a file `layouts/blog/single.html`, and put the following content in there: - -```html - - - - - - - {{ .Title }} - - -

{{ .Title }}

-

{{ .Date }}

-

{{ .Params.description }}

-
- {{ .Content }} -
- - -``` - -You can see this basic template includes all the fields you've specified in your Decap CMS `config.yml` file. You can access any custom front-matter fields with `.Params.`! - -### Using Hugo shortcodes in the Markdown Editor - -Using `registerEditorComponent` we can register a block level component for the Markdown editor. You can use it to add Hugo's inbuilt shortcodes like `gist`,`youtube` and others as block components to the markdown editor. - -You can refer to [registering editor components](https://www.decapcms.org/docs/custom-widgets/#registereditorcomponent) for a getting started guide or for creating your own editor components. - -**Example** - -```javascript -CMS.registerEditorComponent({ - id: "gist", - label: "Gist", - fields: [{ - name: "username", - label: "GitHub Username", - widget: "string" - }, - { - name: "gid", - label: "Gist ID", - widget: "string" - }, - ], - pattern: /^{{< gist ([a-zA-Z0-9]+) ([a-zA-Z0-9]+) >}}/, - fromBlock: function(match) { - return { - username: match[1], - gid: match[2], - }; - }, - toBlock: function(obj) { - return `{{< gist ${obj.username} ${obj.gid} >}}`; - }, - toPreview: function(obj) { - return 'gist'; - }, -}); -``` - -**Result** - -![Gist](/img/hugo_shortcode_gist.png "Gist") - -For getting started quickly you can refer to this amazing prebuilt resource of [hugo shortcodes editor components](https://github.com/sharadcodes/hugo-shortcodes-netlify-cms)! diff --git a/website/content/docs/i18n.md b/website/content/docs/i18n.md deleted file mode 100644 index 4384b9eca1eb..000000000000 --- a/website/content/docs/i18n.md +++ /dev/null @@ -1,127 +0,0 @@ ---- -group: Configuration -weight: 10 -title: i18n Support ---- - -The CMS can provide a side by side interface for authoring content in multiple languages. -Configuring the CMS for i18n support requires top level configuration, collection level configuration and field level configuration. - -### Top level configuration - -```yaml -i18n: - # Required and can be one of multiple_folders, multiple_files or single_file - # multiple_folders - persists files in `//.` - # multiple_files - persists files in `/..` - # single_file - persists a single file in `/.` - structure: multiple_folders - - # Required - a list of locales to show in the editor UI - locales: [en, de, fr] - - # Optional, defaults to the first item in locales. - # The locale to be used for fields validation and as a baseline for the entry. - default_locale: en -``` - -### Collection level configuration - -```yaml -collections: - - name: i18n_content - # same as the top level, but all fields are optional and defaults to the top level - # can also be a boolean to accept the top level defaults - i18n: true -``` - -When using a file collection, you must also enable i18n for each individual file: - -```yaml -collections: - - name: pages - label: Pages - # Configure i18n for this collection. - i18n: - structure: single_file - locales: [en, de, fr] - files: - - name: about - label: About Page - file: site/content/about.yml - # Enable i18n for this file. - i18n: true - fields: - - { label: Title, name: title, widget: string, i18n: true } -``` - -### Field level configuration - -```yaml -fields: - - label: Title - name: title - widget: string - # same as 'i18n: translate'. Allows translation of the title field - i18n: true - - label: Date - name: date - widget: datetime - # The date field will be duplicated from the default locale. - i18n: duplicate - - label: Body - name: body - # The markdown field will be omitted from the translation. - widget: markdown -``` - -Example configuration: - -```yaml -i18n: - structure: multiple_folders - locales: [en, de, fr] - -collections: - - name: posts - label: Posts - folder: content/posts - create: true - i18n: true - fields: - - label: Title - name: title - widget: string - i18n: true - - label: Date - name: date - widget: datetime - i18n: duplicate - - label: Body - name: body - widget: markdown -``` - -### Limitations - -1. File collections support only `structure: single_file`. -2. List widgets only support `i18n: true`. `i18n` configuration on sub fields is ignored. -3. Object widgets only support `i18n: true` and `i18n` configuration should be done per field: - -```yaml -- label: 'Object' - name: 'object' - widget: 'object' - i18n: true - fields: - - { label: 'String', name: 'string', widget: 'string', i18n: true } - - { label: 'Date', name: 'date', widget: 'datetime', i18n: duplicate } - - { label: 'Boolean', name: 'boolean', widget: 'boolean', i18n: duplicate } - - { - label: 'Object', - name: 'object', - widget: 'object', - i18n: true, - field: { label: 'String', name: 'string', widget: 'string', i18n: duplicate }, - } -``` diff --git a/website/content/docs/install-decap-cms.md b/website/content/docs/install-decap-cms.md deleted file mode 100644 index 05fc5161bd42..000000000000 --- a/website/content/docs/install-decap-cms.md +++ /dev/null @@ -1,87 +0,0 @@ ---- -group: Add -weight: 2 -title: 1. Install Decap CMS ---- - -A static `admin` folder contains all Decap CMS files, stored at the root of your published site. Where you store this folder in the source files depends on your static site generator. Here's the static file location for a few of the most popular static site generators: - -| These generators | store static files in | -| ------------------------------------------------------- | --------------------- | -| Jekyll, GitBook | `/` (project root) | -| Hugo, Gatsby, Nuxt 2, Gridsome, Zola, Sapper, SvelteKit | `/static` | -| Next, Nuxt 3, Astro | `/public` | -| Hexo, Middleman, Jigsaw | `/source` | -| Wyam | `/input` | -| Pelican | `/content` | -| Spike | `/views` | -| VuePress | `/.vuepress/public` | -| Elmstatic | `/_site` | -| 11ty | `/_site` | -| preact-cli | `/src/static` | -| Docusaurus | `/static` | -| MkDocs | `/site` | -| Lume | `/_site` | - -If your generator isn't listed here, you can check its documentation, or as a shortcut, look in your project for a `css` or `images` folder. The contents of folders like that are usually processed as static files, so it's likely you can store your `admin` folder next to those. (When you've found the location, feel free to add it to these docs by [filing a pull request](https://github.com/decaporg/decap-cms/blob/master/CONTRIBUTING.md#pull-requests)!) - -Inside the `admin` folder, you'll create two files: - -```bash -admin - ├ index.html - └ config.yml -``` - -The first file, `admin/index.html`, is the entry point for the Decap CMS admin interface. This means that users navigate to `yoursite.com/admin/` to access it. On the code side, it's a basic HTML starter page that loads the Decap CMS JavaScript file. - -The second file, `admin/config.yml`, is the heart of your Decap CMS installation, and a bit more complex. The [Configuration](#configuration) section covers the details. - -In this example, we pull the `admin/index.html` file from a public CDN. - -```html - - - - - - - Content Manager - - - - - - -``` - -In the code above the `script` is loaded from the `unpkg` CDN. Should there be any issue, `jsDelivr` can be used as an alternative source. Simply set the `src` to `https://cdn.jsdelivr.net/npm/decap-cms@^3.0.0/dist/decap-cms.js` - -### Installing with npm - -You can also use Decap CMS as an npm module. Wherever you import Decap CMS, it automatically runs, taking over the current page. Make sure the script that imports it only runs on your CMS page. - -First install the package and save it to your project: - -```bash -npm install decap-cms-app --save -``` - -Then import it (assuming your project has tooling for imports): - -```js -import CMS from 'decap-cms-app' -// Initialize the CMS object -CMS.init() -// Now the registry is available via the CMS object. -CMS.registerPreviewTemplate('my-template', MyTemplate) -``` - -
- -

- Once this is completed, proceed to step 2. -

-
diff --git a/website/content/docs/intro.md b/website/content/docs/intro.md deleted file mode 100755 index 5e9ecbc782c1..000000000000 --- a/website/content/docs/intro.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: Overview -group: Intro -weight: 1 ---- - -Decap CMS (formerly Netlify CMS) is an open source content management system for your Git workflow that enables you to provide editors with a friendly UI and intuitive workflows. You can use it with any static site generator to create faster, more flexible web projects. Content is stored in your Git repository alongside your code for easier versioning, multi-channel publishing, and the option to handle content updates directly in Git. - -At its core, Decap CMS is an open-source React app that acts as a wrapper for the Git workflow, using the GitHub, GitLab, or Bitbucket API. This provides many advantages, including: - -* **Fast, web-based UI:** With rich-text editing, real-time preview, and drag-and-drop media uploads. -* **Platform agnostic:** Works with most static site generators. -* **Easy installation:** Add two files to your site and hook up the backend by including those files in your build process or linking to our Content Delivery Network (CDN). -* **Modern authentication:** Using GitHub, GitLab, or Bitbucket and JSON web tokens. -* **Flexible content types:** Specify an unlimited number of content types with custom fields. -* **Fully extensible:** Create custom-styled previews, UI widgets, and editor plugins. - -## Decap CMS vs. Netlify - -[Netlify.com](https://www.netlify.com/) is a platform you can use to automatically build, deploy, serve, and manage your frontend sites and web apps. It also provides a variety of other features like form processing, serverless functions, and split testing. Not all Netlify sites use Decap CMS, and not all sites using Decap CMS are on Netlify. - -The folks at Netlify created Netlify CMS to fill a gap in the static site generation pipeline. There were some great proprietary headless CMS options, but no real contenders that were open source and extensible—that could turn into a community-built ecosystem like WordPress or Drupal. For that reason, Netlify CMS is _made_ to be community-driven, and has never been locked to the Netlify platform (despite the name). In February 2023 [Netlify CMS became Decap CMS](https://www.netlify.com/blog/netlify-cms-to-become-decap-cms/). - -With this in mind, you can: - -* Use Decap CMS without Netlify and deploy your site where you always have, hooking up your own CI, site hosting, CDN, etc. -* Use Netlify without Decap CMS and edit your static site in your code editor. -* Or, use them together and have a fully-working CMS-enabled site with [one click](../start-with-a-template/)! - -If you hook up Decap CMS to your website, you're basically adding a tool for content editors to make commits to your site repository without touching code or learning Git. - -### Find out more - -- Get a feel for the UI in the [demo site](https://demo.decapcms.org). (No login required. Click the login button to go straight to the CMS editor UI.) -- [Start with a template](../start-with-a-template/) to make a Decap CMS-enabled site of your own. -- Configure your existing site by following a [tutorial](../add-to-your-site/) or checking [configuration options](../configuration-options). -- Ask questions and share ideas in the Decap CMS [community chat](https://decapcms.org/chat). -- Get involved in new developments and become a [contributor](../contributor-guide/). diff --git a/website/content/docs/jekyll.md b/website/content/docs/jekyll.md deleted file mode 100644 index b5dfb3a0b215..000000000000 --- a/website/content/docs/jekyll.md +++ /dev/null @@ -1,299 +0,0 @@ ---- -group: Guides -weight: 30 -title: Jekyll ---- -## Introduction - -This section will help you integrate Decap CMS with a new or existing Jekyll project. - -[Jekyll](https://jekyllrb.com/) is a blog-aware static site generator built with Ruby. [GitHub Pages](https://pages.github.com/) are powered by Jekyll, making it a popular choice for developer blogs and project pages. - -If you're starting a new project, the fastest route to publishing on a Jekyll website with Decap CMS is to [deploy a template on Netlify](https://templates.netlify.com/). - -## Setup - -This guide will use the blog you get if you follow the [really excellent official Jekyll step by step tutorial](https://jekyllrb.com/docs/step-by-step/01-setup/) as a starting point. If you're new to Jekyll - I recommended you start by following the tutorial so you know your way around your new blog. Otherwise [you can clone this repo](https://github.com/adamwatters/jekyll-tutorial-with-netlify-cms/tree/without-cms) and checkout the `without-cms` branch. - -![Jekyll tutorial blog screenshot](https://www.decapcms.org/img/screenshot-jekyll-tutorial-blog.png?raw=true) - -## Add Decap CMS - -### Add admin/index.html - -Create a file `admin/index.html` in the root of your repo - it should look like this: - -```html - - - - - - - Content Manager - - - - - - - - -``` - -### Add admin/config.yml - -Create a file `admin/config.yml` in the root of your repo - it should look like this: - -```yml -# config.yml - -backend: - name: git-gateway - branch: main # Branch to update (optional; defaults to master) -media_folder: 'assets/uploads' -collections: - - name: 'blog' - label: 'Blog' - folder: '_posts/' - fields: - - { name: Title } -``` - -### Enable authentication for CMS users - -Decap CMS stores content in your online Git repository. Therefore, to make content changes, users need to authenticate with the corresponding Git provider to prove that they have read and write access to that content. - -Follow the directions in the Introduction section to [enable Netlify Identity and Git Gateway services](https://www.decapcms.org/docs/add-to-your-site/#enable-identity-and-git-gateway) for the backend, then [add the Identity widget](https://www.decapcms.org/docs/add-to-your-site/#add-the-netlify-identity-widget) to render a login portal on the frontend. - -## CMS Configuration - -### Blog Collection - -We'll start by updating the `blog` collection. Blogging is baked into Jekyll, and the `_posts/` directory uses [some special conventions](https://jekyllrb.com/docs/posts/) we'll need to keep in mind as we configure Decap CMS. Copy and paste the following into your `config.yml`. - -```yaml -collections: - - name: 'blog' - label: 'Blog' - folder: '_posts/' - create: true - slug: '{{year}}-{{month}}-{{day}}-{{slug}}' - editor: - preview: false - fields: - - { label: 'Layout', name: 'layout', widget: 'hidden', default: 'post' } - - { label: 'Title', name: 'title', widget: 'string' } - - { label: 'Publish Date', name: 'date', widget: 'datetime' } - - { label: 'Body', name: 'body', widget: 'markdown' } -``` - -A few things to note. - -* We set the `slug` to `'{{year}}-{{month}}-{{day}}-{{slug}}'` because [Jekyll requires this format for blog posts](https://jekyllrb.com/docs/posts/#creating-posts). `year`, `month`, and `day` will be extracted from the `date` field, and `slug` will be generated from the `title` field. -* We added `editor` configuration with a field `preview: false`. This will eliminate the preview pane. Because Jekyll uses Liquid templates, there currently isn't a good way to provide a preview of pages as you update the content. -* The `layout` field default is set to `post` so Jekyll knows to use `_layouts/post.html` when it renders a post. This field is hidden because we want all posts to use the same layout. -* The `date` and `title` field will be used by the `slug` - as noted above, Jekyll relies on the filename to determine a post's publish date, but Decap CMS does not pull date information from the filename and requires a frontmatter `date` field. **Note** Changing the `date` or `title` fields in Decap CMS will not update the filename. This has a few implications: - - * If you change the `date` or `title` fields in Decap CMS, Jekyll won't notice - * You don't necessarily need to change the `date` and `title` fields for existing posts, but if you don't the filenames and frontmatter will disagree in a way that might be confusing - * If you want to avoid these issues, use a regular Jekyll collection instead of the special `_posts` directory - -### Author Collection - -In addition to `_posts`, the Jekyll tutorial blog includes a collection of authors in the `_authors` directory. Before we can configure Decap CMS to work with the `authors` collection, we'll need to make a couple tweaks to our Jekyll blog. Here's the front matter for one of the authors. - -```yaml -short_name: jill -name: Jill Smith -position: Chief Editor -``` - -`name` has special meaning as a unique identifier in Decap CMS, but as set up now our Jekyll blog is using `short_name` as the unique identifier for authors. For each author, update the frontmatter like so. - -```yaml -name: jill -display_name: Jill Smith -position: Chief Editor -``` - -then update `_layouts/author.html`, `_layouts/post.html` and `staff.html` accordingly. - -```html - ---- layout: default --- - -

{{ page.display_name }}

-

{{ page.position }}

- -{{ content }} - -

Posts

-
    - {% assign filtered_posts = site.posts | where: 'author', page.name %} {% for post in - filtered_posts %} -
  • - {{ post.title }} -
  • - {% endfor %} -
-``` - -```html - ---- layout: default --- - -

{{ page.title }}

- -

- {{ page.date | date_to_string }} {% assign author = site.authors | where: 'name', page.author | - first %} {% if author %} - {{ author.display_name }} - {% endif %} -

- -{{ content }} -``` - -```html - ---- layout: default --- - -

Staff

- -
    - {% for author in site.authors %} -
  • -

    - {{ author.display_name }} -

    -

    {{ author.position }}

    -

    {{ author.content | markdownify }}

    -
  • - {% endfor %} -
-``` - -Next, copy and paste the following into the collections array in `config.yml` below the `blog` collection. - -```yaml -- name: 'authors' - label: 'Authors' - folder: '_authors/' - create: true - editor: - preview: false - fields: - - { label: 'Layout', name: 'layout', widget: 'hidden', default: 'author' } - - { label: 'Short Name', name: 'name', widget: 'string' } - - { label: 'Display Name', name: 'display_name', widget: 'string' } - - { label: 'Position', name: 'position', widget: 'string' } - - { label: 'Body', name: 'body', widget: 'markdown' } -``` - -Now that we have the `authors` collection configured, we can add an `author` field to the `blog` collection. We'll use the [relation widget](https://www.decapcms.org/docs/widgets/#relation) to define the relationship between blog posts and authors. - -```yaml -# updated fields in blog collection configuration -fields: - - { label: 'Layout', name: 'layout', widget: 'hidden', default: 'post' } - - { label: 'Title', name: 'title', widget: 'string' } - - { label: 'Publish Date', name: 'date', widget: 'datetime' } - - { - label: 'Author', - name: 'author', - widget: 'relation', - collection: 'authors', - display_fields: [display_name], - search_fields: [display_name], - value_field: 'name', - } - - { label: 'Body', name: 'body', widget: 'markdown' } -``` - -With that configuration added, you should be able to select the author for a post from a dropdown. - -### About Page - -Our Jekyll blog includes an About page. It would nice to be able to edit that page just like we can edit our blog and author pages. Decap CMS provides [file collections](https://www.decapcms.org/docs/collection-types/#file-collections) to solve this problem. - -Copy and paste the following into the collections array in `config.yml` - -```yaml -- name: 'pages' - label: 'Pages' - editor: - preview: false - files: - - label: 'About Page' - name: 'about' - file: 'about.md' - fields: - - { label: 'Title', name: 'title', widget: 'hidden', default: 'about' } - - { label: 'Layout', name: 'layout', widget: 'hidden', default: 'about' } - - { label: 'Body', name: 'body', widget: 'markdown' } -``` - -### Navigation - -The last aspect of our Jekyll blog we might want to bring under the control of Decap CMS is our Navigation menu. Our Jekyll tutorial blog has a file `_data/navigation.yml` that defines the links rendered by `_includes/navigation.html`. It looks like this. - -```yaml -# _data/navigation.yml -- name: Home - link: / -- name: About - link: /about.html -- name: Blog - link: /blog.html -- name: Staff - link: /staff.html -``` - -To make this file editable with Decap CMS, we'll need to make one minor tweak. The issue is this file contains a yaml array at the top level, but Decap CMS is designed to work with yaml objects. Update `_data/navigation.yml` so it looks like so. - -```yaml -# _data/navigation.yml -items: - - name: Home - link: / - - name: About - link: /about.html - - name: Blog - link: /blog.html - - name: Staff - link: /staff.html -``` - -You'll need to update `_includes/navigation.html` accordingly. `{% for item in site.data.navigation %}` should be changed to `{% for item in site.data.navigation.items %}`. When you're done, the nav html should look like this. - -```html - -``` - -Finally, add the following to the collections array in `config.yml` - -```yaml -- name: 'config' - label: 'Config' - editor: - preview: false - files: - - label: 'Navigation' - name: 'navigation' - file: '_data/navigation.yml' - fields: - - label: 'Navigation Items' - name: 'items' - widget: 'list' - fields: - - { label: Name, name: name, widget: string } - - { label: Link, name: link, widget: string } -``` - -Now you can add, rename, and rearrange the navigation items on your blog. diff --git a/website/content/docs/manual-initialization.md b/website/content/docs/manual-initialization.md deleted file mode 100644 index 7d5c7973034e..000000000000 --- a/website/content/docs/manual-initialization.md +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: Manual Initialization -weight: 70 -group: Customization ---- - -Decap CMS can now be manually initialized, rather than automatically loading up the moment you import it. The whole point of this at the moment is to inject configuration into Decap CMS before it loads, bypassing need for an actual Decap CMS `config.yml`. This is important, for example, when creating tight integrations with static site generators. - -Assuming you have the decap-cms package installed to your project, manual initialization works by setting `window.CMS_MANUAL_INIT = true` **before importing the CMS**: - -```js -// This global flag enables manual initialization. -window.CMS_MANUAL_INIT = true -// Usage with import from npm package -import CMS, { init } from 'decap-cms-app' -// Usage with script tag -const { CMS, initCMS: init } = window -/** - * Initialize without passing in config - equivalent to just importing - * Decap CMS the old way. - */ -init() -/** - * Optionally pass in a config object. This object will be merged into - * `config.yml` if it exists, and any portion that conflicts with - * `config.yml` will be overwritten. Arrays will be replaced during merge, - * not concatenated. - * - * For example, the code below contains an incomplete config, but using it, - * your `config.yml` can be missing its backend property, allowing you - * to set this property at runtime. - */ -init({ - config: { - backend: { - name: 'git-gateway', - }, - }, -}) -/** - * Optionally pass in a complete config object and set a flag - * (`load_config_file: false`) to ignore the `config.yml`. - * - * For example, the code below contains a complete config. The - * `config.yml` will be ignored when setting `load_config_file` to false. - * It is not required if the `config.yml` file is missing to set - * `load_config_file`, but will improve performance and avoid a load error. - */ -init({ - config: { - backend: { - name: 'git-gateway', - }, - load_config_file: false, - media_folder: "static/images/uploads", - public_folder: "/images/uploads", - collections: [ - { label: "Blog", name: "blog", folder: "_posts/blog", create: true, fields: [ - { label: "Title", name: "title", widget: "string" }, - { label: "Publish Date", name: "date", widget: "datetime" }, - { label: "Featured Image", name: "thumbnail", widget: "image" }, - { label: "Body", name: "body", widget: "markdown" }, - ]}, - ], - }, -}) -// The registry works as expected, and can be used before or after init. -CMS.registerPreviewTemplate(...); -``` diff --git a/website/content/docs/middleman.md b/website/content/docs/middleman.md deleted file mode 100644 index 82eb152ef949..000000000000 --- a/website/content/docs/middleman.md +++ /dev/null @@ -1,180 +0,0 @@ ---- -title: Middleman -group: Guides -weight: 60 ---- -This guide will help you get started using Decap CMS and Middleman. - -## Installation -To get up and running with Middleman, you need both the Ruby language runtime and RubyGems installed on your computer. Check out the [Middleman installation docs](https://middlemanapp.com/basics/install/) for more details. If you already have your environment set up, use the following command to install Middleman: - -```bash -gem install middleman -``` - -## Create a new Middleman site -Let's create a new site from scratch. Run the following commands in the terminal, in the folder where you'd like to create the blog: - -```bash -middleman init blog -cd blog -``` - -### Add the Middleman blog extension -Middleman has an official extension to support blogging, articles and tagging. `middleman-blog` ships as an extension and must be installed to use. Simply specify the gem in your Gemfile: - -```bash -gem "middleman-blog" -``` -Install the dependencies and run Middleman with the following commands: - -```bash -bundle install -middleman server -``` - -## Get started with Middleman - -Now we have our site up and running let's open up a code editor and create a new folder `source/posts` and add your first article named `2019-01-01-example-article.html.md` with the following content: - - -```yml ---- -title: Example Article -date: 2019-01-01 ---- - -This is an example article. You probably want to delete it and write your own articles once you finished this guide! -``` - -### Activate the blog extension -We can then activate the blog in `config.rb`. Be sure to check out the [Middleman blogging docs](https://middlemanapp.com/basics/blogging/) for all the configuration options. - -```bash -activate :blog do | blog | - blog.permalink = "blog/{title}.html" - blog.sources = "posts/{year}-{month}-{day}-{title}.html" - blog.layout = "blog-layout" -end -``` - -### Load the articles -Time to load our articles in `index.html.erb`. - -```ruby -

Recent articles

- -<% blog.articles.each do | article | %> -
-

- <%= article.title %> -

- - <%= link_to 'Read more', article %> -
- -<% end %> -``` - -### Add an article layout -In the last step before we add Decap CMS, we add a layout for the article page. Create a new layout `source/layouts/blog-layout.html.erb`. For now we will get the title and the content: -```ruby -

- <%= current_page.data.title %> -

- -<%= yield %> -``` - -Now that we have a functioning blog, let's get started with Decap CMS! - -## Add Decap CMS to your site - -Create two files in a new folder called `admin`, `index.html` and `config.yml`. Also add an `upload` folder in the images directory that will function as our `media_folder`. -```bash -├── source -│ ├── admin -│ │ ├── index.html -│ │ ├── config.yml -│ │ -│ ├── images -│ │ ├── uploads -``` - - -In the newly created `index.html` we add scripts for Decap CMS and the Netlify Identity Widget: - -```html - - - - - - - Decap CMS - - - - - - - -``` - -### Configuration - -For the purpose of this guide we will deploy to Netlify from a GitHub repository which requires the minimum configuration. In `config.yml` file paste the following code: - -```yml -backend: - name: git-gateway - branch: main # Branch to update (optional; defaults to master) - -media_folder: source/images/uploads -public_folder: /images/uploads - -collections: - - name: blog - label: Blog - folder: source/posts/ - extension: .html.md - format: frontmatter - create: true - slug: '{{year}}-{{month}}-{{day}}-{{title}}' - fields: - - {label: Title, name: title, widget: string} - - {label: Publish Date, name: date, widget: datetime} - - {label: Body, name: body, widget: markdown} -``` - -### Push to GitHub -It's now time to commit your changes and push to GitHub. - -```bash -git init -git add . -git commit -m "Initial Commit" -git remote add origin https://github.com/YOUR_USERNAME/NEW_REPO_NAME.git -git push -u origin main -``` - -### Add your repo to Netlify - -Go to Netlify and select 'New Site from Git'. Select GitHub and the repository you just pushed to. Click Configure Netlify on GitHub and give access to your repository. Finish the setup by clicking Deploy Site. Netlify will begin reading your repository and starting building your project. - -### Enable Identity and Git Gateway - -Netlify's Identity and Git Gateway services allow you to manage CMS admin users for your site without requiring them to have an account with your Git host or commit access on your repo. From your site dashboard on Netlify: - -1. Go to **Settings > Identity**, and select **Enable Identity service**. -2. Under **Registration preferences**, select **Open** or **Invite only**. In most cases, you want only invited users to access your CMS, but if you're just experimenting, you can leave it open for convenience. -3. If you'd like to allow one-click login with services like Google and GitHub, check the boxes next to the services you'd like to use, under **External providers**. -4. Scroll down to **Services > Git Gateway**, and click **Enable Git Gateway**. This authenticates with your Git host and generates an API access token. In this case, we're leaving the **Roles** field blank, which means any logged in user may access the CMS. For information on changing this, check the [Netlify Identity documentation](https://www.netlify.com/docs/identity/). - -## Start publishing - -It's time to create your first blog post. Login to your site's `/admin/` page and create a new post by clicking New Blog. Add a title, a date and some text. When you click Publish, a new commit will be created in your GitHub repo with this format `Create Blog “year-month-date-title”`. - -Then Netlify will detect that there was a commit in your repo, and will start rebuilding your project. When your project is deployed you'll be able to see the post you created. - -Be sure to checkout the official [Middleman Starter](https://github.com/tomrutgers/middleman-starter-netlify-cms) for more examples. diff --git a/website/content/docs/netlify-large-media.md b/website/content/docs/netlify-large-media.md deleted file mode 100644 index 8c627c384c50..000000000000 --- a/website/content/docs/netlify-large-media.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -group: Media -weight: 20 -title: Netlify Large Media ---- -**Note:** Netlify Large Media is deprecated as of September 1, 2023. Please refer to the deprecation notice in [Netlify's Support Forums](https://docs.netlify.com/large-media/overview/) (see deprecation notice). - -[Netlify Large Media](https://www.netlify.com/features/large-media/) is a [Git LFS](https://git-lfs.github.com/) implementation for repositories connected to Netlify sites. This means that you can use Git to work with large asset files like images, audio, and video, without bloating your repository. It does this by replacing the asset files in your repository with text pointer files, then uploading the assets to the Netlify Large Media storage service. - -If you have a Netlify site with Large Media enabled, Decap CMS (version 2.6.0 and above) will handle Large Media asset files seamlessly, in the same way as files stored directly in the repository. - -## Requirements - -To use Netlify Large Media with Decap CMS, you will need to do the following: - -* [Upgrade Decap CMS](/docs/update-the-cms-version/) to version 2.6.0 or above. -* Configure Decap CMS to use the [Git Gateway backend with Netlify Identity](/docs/git-gateway-backend/#git-gateway-with-netlify-identity). -* Configure the Netlify site and connected repository to use Large Media, following the [Large Media docs on Netlify](https://www.netlify.com/docs/large-media/). - -When these are complete, you can use Decap CMS as normal, and the configured asset files will automatically be handled by Netlify Large Media. - -## Image transformations - -All JPEG, PNG, and GIF files that are handled with Netlify Large Media also have access to Netlify's on-demand image transformation service. This service allows you to request an image to match the dimensions you specify in a query parameter added to the image URL. - -You can learn more about this feature in [Netlify's image transformation docs](https://www.netlify.com/docs/image-transformation/). - -### Transformation control for media gallery thumbnails - -In repositories enabled with Netlify Large Media, Decap CMS will use the image transformation query parameters to load thumbnail-sized images for the media gallery view. This makes images in the media gallery load significantly faster. - -**Note:** When using this option all tracked file types have to be imported into Large Media. For example if you track `*.jpg` but still have jpg-files that are not imported into Large Media the backend will throw an error. Check the [netlify docs](https://docs.netlify.com/large-media/setup/#migrate-files-from-git-history) on how to add previously committed files to Large Media. - -You can disable the automatic image transformations with the `use_large_media_transforms_in_media_library` configuration setting, nested under `backend` in the CMS `config.yml` file: - -```yaml -backend: - name: git-gateway - ## Set to false to prevent transforming images in media gallery view - use_large_media_transforms_in_media_library: false -``` \ No newline at end of file diff --git a/website/content/docs/nextjs.md b/website/content/docs/nextjs.md deleted file mode 100644 index fda584122bb9..000000000000 --- a/website/content/docs/nextjs.md +++ /dev/null @@ -1,234 +0,0 @@ ---- -group: Guides -weight: 40 -title: NextJS ---- -This guide will help you get started using Decap CMS with NextJS. - -## Creating a new project - -Let's repeat some of the basics of setting up a simple NextJS project (check out [nextjs.org/learn](http://nextjs.org/learn) for a more detailed version). - -```bash -# Create new directory and navigate into it -mkdir awesome-kitties -cd awesome-kitties - -# Initialize a new project -npm init -y - -# Install required dependencies -npm install --save react react-dom next - -# Install webpack loader for Markdown (Use version 3+) -npm install --save-dev frontmatter-markdown-loader - -# If using NextJS v11.0.0 or above, @babel/core and @babel/preset-react has to be installed as dependencies of frontmatter-markdown-loader -npm install --save-dev @babel/core @babel/preset-react - -# Create folder for pages (default for NextJS), and add a index file -mkdir pages -touch pages/index.js - -# Create a folder for content, and a markdown file: -mkdir content -touch content/home.md - -# Create a folder for static assets -mkdir public -``` - -Next, we need to add some modifications to our `package.json` file to make it easier to run and deploy our new site: - -```json -{ - "scripts": { - "dev": "next", - "build": "next build", - "start": "next start", - "export": "npm run build && next export" - } -} -``` - -There is a lot of different ways to create and display Markdown content, but to make this as easy as possible we'll be using a webpack-loader that enables us to load markdown files directly in our React components ([frontmatter-markdown-loader](https://www.npmjs.com/package/frontmatter-markdown-loader)). - -Add the following content to your `content/home.md` file: - -```md ---- -title: Awesome kitties -date: 2019-03-17T19:31:20.591Z -cats: - - description: 'Maru is a Scottish Fold from Japan, and he loves boxes.' - name: Maru (まる) - - description: Lil Bub is an American celebrity cat known for her unique appearance. - name: Lil Bub - - description: 'Grumpy cat is an American celebrity cat known for her grumpy appearance.' - name: Grumpy cat (Tardar Sauce) ---- -Welcome to my awesome page about cats of the internet. - -This page is built with NextJS, and content is managed in Decap CMS -``` - -Next, we need to tell webpack how to load Markdown files. Create a new `next.config.js` file at the root of your project with the following content: - -```js -module.exports = { - webpack: (cfg) => { - cfg.module.rules.push( - { - test: /\.md$/, - loader: 'frontmatter-markdown-loader', - options: { mode: ['react-component'] } - } - ) - return cfg - } -} -``` - -Almost there! The last thing we need to do is to add some content to our `pages/index.js` file. With a little help of our webpack loader, we can now easily import Markdown files: - -```js -import Head from "next/head" -import { Component } from 'react' -import { attributes, react as HomeContent } from '../content/home.md' - -export default class Home extends Component { - render() { - let { title, cats } = attributes - return ( - <> - - - -
-

{title}

- -
    - {cats.map((cat, k) => ( -
  • -

    {cat.name}

    -

    {cat.description}

    -
  • - ))} -
-
- - ) - } -} -``` - -Great! We now have a page that displays content from our Markdown file. Go ahead and start your development server to test if everything is working: - -```bash -npm run dev -``` - -## Adding Decap CMS - -There are many different ways to add Decap CMS to your project. The easiest is probably just to embed it from a CDN, and that's exactly what we're gonna do. To avoid making this guide too complicated, we're just going to add Decap into a subfolder inside the `/public` directory (which is just served as static files by Next): - -```bash -# Create and navigate into public/admin folder -mkdir -p public/admin -cd public/admin - -# Create index.html and config.yml file -touch index.html -touch config.yml -``` - -Paste HTML for Decap CMS into your `public/admin/index.html` file (check out the [Add Decap To Your Site](https://www.decapcms.org/docs/add-to-your-site/) section for more information) - -```html - - - - - - Content Manager - - - - - - - -``` - -Notice that we also added the identity widget. This allows sign up when the project is hosted at Netlify. - -Paste the following configuration into your `public/admin/config.yml` file: - -```yaml -backend: - name: git-gateway - branch: main # Branch to update (optional; defaults to master) -media_folder: public/img -public_folder: img -collections: - - name: "pages" - label: "Pages" - files: - - label: "Home" - name: "home" - file: "content/home.md" - fields: - - { label: "Title", name: "title", widget: "string"} - - { label: "Publish Date", name: "date", widget: "datetime" } - - { label: "Body", name: "body", widget: "markdown"} - - label: 'Cats' - name: "cats" - widget: list - fields: - - { label: "Name", name: "name", widget: "string"} - - { label: "Description", name: "description", widget: "text"} -``` - -Awesome! Decap CMS should now be available at `localhost:3000/admin/index.html`. Unfortunately we can't edit our content just yet. First we need to move our code into a git repository, and create a new Netlify site. - -**Tip:** If you want to test changes made to your config.yml file locally, swap out "git-gateway" with "test-repo" and navigate to `localhost:3000/admin/index.html` to view Decap CMS locally (you can't make changes or read actual content from Git this way, but it's great to verify how things will look). - -## Publishing to GitHub and Netlify - -Create a new repository at GitHub (or one of the other supported git services) and follow the instructions on how to push existing files into your new repository. - -Now is probably also a good time to add a `.gitignore` file: - -```bash -.next/ -node_modules/ -/npm-debug.log -.DS_Store -out/ -``` - -When your project is under version control, go to Netlify and select "New Site from Git". Select GitHub (or whatever service you used in the previous step), and the repository you just pushed to. - -Under the final step (Build options, and deploy!), make sure you enter the following: - -| Field | Value | -| ----------------- | ------------------ | -| Build command | **npm run export** | -| Publish directory | **out** | - -### Enable Identity and Git Gateway - -Netlify's Identity and Git Gateway services allow you to manage CMS admin users for your site without requiring them to have an account with your Git host or commit access on your repo. From your site dashboard on Netlify: - -1. Go to **Settings > Identity**, and select **Enable Identity service**. -2. Under **Registration preferences**, select **Open** or **Invite only**. In most cases, you want only invited users to access your CMS, but if you're just experimenting, you can leave it open for convenience. -3. If you'd like to allow one-click login with services like Google and GitHub, check the boxes next to the services you'd like to use, under **External providers**. -4. Scroll down to **Services > Git Gateway**, and click **Enable Git Gateway**. This authenticates with your Git host and generates an API access token. In this case, we're leaving the **Roles** field blank, which means any logged in user may access the CMS. For information on changing this, check the [Netlify Identity documentation](https://www.netlify.com/docs/identity/). - -### Celebrate! - -Great job - you did it! Open your new page via the new Netlify URL, and navigate to `/admin`. If you did everything correct in the previous step, you should now be able to sign up for an account, and log in. - -**Tip:** Signing up with an external provider is the easiest. If you want to sign up by email, you'll have to set up a redirect in your index.js page (which we won't be covering in this guide). For more information, have a look at the [Add To Your Site](https://www.decapcms.org/docs/add-to-your-site) section. - -Congratulations - you can finally manage your new list of cats! diff --git a/website/content/docs/nuxt.md b/website/content/docs/nuxt.md deleted file mode 100644 index 3a011985ae7f..000000000000 --- a/website/content/docs/nuxt.md +++ /dev/null @@ -1,287 +0,0 @@ ---- -group: Guides -weight: 50 -title: Nuxt ---- -This guide will walk you through how to integrate Decap CMS with Nuxt. - -## Starting With `create-nuxt-app` - -Follow the instructions on the [Nuxt documentation](https://nuxtjs.org/guide/installation#using-code-create-nuxt-app-code-) for creating a new project, or run: - -```bash -npx create-nuxt-app -cd -npm run dev -``` - -## Setting Up Decap CMS - -### Add the Decap CMS files to Nuxt - -For nuxt 3 apps and above use the \`public/\` folder instead of \`/static\` which is for nuxt 2. - -In the `static/` directory, create a new directory `admin/`. Inside that directory you'll create two files, your `index.html` and a `config.yml`. Per the [Decap CMS documentation](/docs/add-to-your-site/), we'll set the content of `static/admin/index.html` to the following: - -```html - - - - - - Content Manager - - - - - - - - -``` - -For your `static/admin/config.yml` file, you can put in a basic starter config: - -```yaml -backend: - name: git-gateway - branch: main # Branch to update (optional; defaults to master) - -media_folder: static/img -public_folder: /img - -collections: - - name: 'blog' - label: 'Blog' - folder: 'content/blog' - format: 'frontmatter' - create: true - slug: '{{year}}-{{month}}-{{day}}-{{slug}}' - editor: - preview: false - fields: - - { label: 'Title', name: 'title', widget: 'string' } - - { label: 'Publish Date', name: 'date', widget: 'datetime' } - - { label: 'Description', name: 'description', widget: 'string' } - - { label: 'Body', name: 'body', widget: 'markdown' } -``` - -You can build whatever collections and content modeling you want. The important thing to note is the `format: 'frontmatter'` value on each collection. This is important for consuming content in Nuxt with the [nuxt/content](https://content.nuxtjs.org) module. - -### Add the `content/` directory to Nuxt - -In your root directory, you can create a new directory `content/`. As you might guess, this is where our content will live. Your filesystem should look about like this, so far: - -```bash -root/ -├ content/ -├ components/ -├ layouts/ -├ middleware/ -├ pages/ -├ plugins/ -├ static/ -│ └ admin/ -│ ├ index.html -│ └ config.yml -├ store/ -└ // .editorconfig, .gitignore, nuxt.config.js, etc... -``` - -### Pushing to GitHub - -It's now time to commit your changes and push to GitHub. `create-nuxt-app` initializes Git automatically for you, so you only need to do: - -```bash -git add . -git commit -m "Initial Commit" -git remote add origin https://github.com/YOUR_USERNAME/NEW_REPO_NAME.git -git push -u origin main -``` - -### Deploying With Netlify - -Now you can go ahead and deploy to Netlify. Go to your Netlify dashboard and click **[New site from Git](https://app.netlify.com/start)**. Select the repo you just created. Under **Basic build settings**, you can set the build command to `npm run generate` . Set the publish directory to `dist`. Click **Deploy site** to get the process going. - -### Authenticating with Netlify Identity - -**Add the Netlify Identity Widget** - -You've already added the Netlify Identity widget to our `admin/index.html`. The next thing to do is add the Netlify Identity widget to our site's index page. In `pages/index.vue`, we can add the following to the page ` -``` - -Once you've added this, make sure to push your changes to GitHub! - -*More on adding ` -``` - -### Example Blog Post - -To generate blog posts create a `_slug.vue` file in the pages folder. By using `$content` you would get a json which you can use to display. But if you are using `markdown` to write and store your posts you can use `` module which gives you option to edit content on page in dev mode and many more [features](https://content.nuxtjs.org/). - -```javascript - - - -``` - -### Generating pages with the `generate` property - -Since Nuxt 2.13+, nuxt export has a crawler feature integrated which will crawl all your links and generate your routes based on those links. Therefore you do not need to do anything in order for your dynamic routes to be crawled. i.e, if you are on version of nuxt above 2.14 add target as static in nuxt.config.js and use `nuxt generate` to build your static site. - -```javascript -// nuxt.config.js -target: 'static' -``` - -If you are using **nuxt version below 2.14** you have to use generate option in nuxt/content module to generate pages - -```javascript -//nuxt.config.js -export default { - modules: [, - '@nuxt/content' - ], - generate: { - async routes () { - const { $content } = require('@nuxt/content') - const files = await $content().only(['path']).fetch() - - return files.map(file => file.path === '/index' ? '/' : file.path) - } - } -} -``` - -To render your site as a static site, you'll need to create or update the `generate` property in `nuxt.config.js` to create dynamic routes and provide their content as a `payload`. In `generate`, make your `routes` entry a function: - -```javascript -export default { - generate: { - routes: function() { - const fs = require('fs'); - const path = require('path'); - return fs.readdirSync('./content/blog').map(file => { - return { - route: `/blog/${path.parse(file).name}`, // Return the slug - payload: require(`./content/blog/${file}`), - }; - }); - }, - }, -}; -``` - -To see the generated site, navigate to name-of-your-website.netlify.app/blog diff --git a/website/content/docs/open-authoring.md b/website/content/docs/open-authoring.md deleted file mode 100644 index 284a6f996634..000000000000 --- a/website/content/docs/open-authoring.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -group: Workflow -weight: 20 -title: Open Authoring ---- - -When using the [GitHub backend](/docs/github-backend), you can use Decap CMS to accept contributions from GitHub users without giving them access to your repository. When they make changes in the CMS, the CMS forks your repository for them behind the scenes, and all the changes are made to the fork. When the contributor is ready to submit their changes, they can set their draft as ready for review in the CMS. This triggers a pull request to your repository, which you can merge using the GitHub UI. - -At the same time, any contributors who *do* have write access to the repository can continue to use Decap CMS normally. - -## Requirements - -* You must use [the GitHub backend](/docs/github-backend). - - **Note that the [Git Gateway backend](/docs/git-gateway-backend/#git-gateway-with-netlify-identity) does *not* support Open Authoring, even when the underlying repo is on GitHub.** -* For private GitHub repos the user must have `read` access on the repo, and you must explicitly set the auth_scope to `repo`, for example: - -```yaml -backend: - name: github - repo: owner-name/private-repo-name # path to private repo - auth_scope: repo # this is needed to fork the private repo - open_authoring: true -``` - -## Enabling Open Authoring - -1. [Enable the editorial workflow](/docs/configuration-options/#publish-mode) by setting `publish_mode` to `editorial_workflow` in your `config.yml`. -2. Set `open_authoring` to `true` in the `backend` section of your `config.yml`, as follows: - - ```yaml - backend: - name: github - repo: owner-name/repo-name # Path to your GitHub repository - open_authoring: true - ``` - -## Usage - -When a user logs into Decap CMS who doesn't have write access to your repo, the CMS asks for permission to create a fork of your repo (or uses their existing fork, if they already have one). They are then presented with the normal CMS interface. The published content shown is from the original repo, so it stays up-to-date as changes are made. - -On the editorial workflow screen, the normal three columns are replaced by two columns instead — "Draft" and "Ready to Review". - -When they make changes to content in the CMS, the changes are made to a branch on their fork. In the editorial workflow screen, they see only their own pending changes. Once they're ready to submit their changes, they can move the card into the "Ready To Review" column to create a pull request. When the pull request is merged (by a repository maintainer via the GitHub UI), Decap CMS deletes the branch and removes the card from the user's editorial workflow screen. Open Authoring users cannot publish entries through the CMS. - -Users who *do* have write access to the original repository continue to use the CMS normally. Unpublished changes made by users via Open Authoring are not visible on the editorial workflow screen, and their unpublished changes must be merged through the GitHub UI. - -## Alternative for external contributors with Git Gateway - -[As noted above](#requirements), Open Authoring does not work with the Git Gateway backend. However, you can use Git Gateway on a site with Netlify Identity that has [open registration](https://www.netlify.com/docs/identity/#adding-identity-users). This lets users create accounts on your site and log into the CMS. There are a few differences, including the following: - -* Users don't need to know about GitHub or create a GitHub account. Instead, they use Netlify Identity accounts that are created on your site and managed by you. -* The CMS applies users' changes directly to your repo, not to a fork. (If you use the editorial workflow, you can use features like [GitHub's protected branches](https://help.github.com/en/articles/about-protected-branches) or [Netlify's locked deploys](https://www.netlify.com/docs/locked-deploys/) to prevent users from publishing directly to your site from the CMS.) -* There is no distinction between users with write access to the repo and users without — all editorial workflow entries are visible from within the CMS and can be published with the CMS. (Unpublished Open Authoring entries, on the other hand, are visible only to the author in the CMS UI or publicly as GitHub PRs.) - -## Linking to specific entries in the CMS - -Open authoring often includes some sort of "Edit this page" link on the live site. Decap CMS supports this via the **edit** path: - -```js -/#/edit/{collectionName}/{entryName} -``` - -For the entry named "general" in the "settings" file collection - -```html -https://www.example.com/path-to-cms/#/edit/settings/general -``` - -For blog post "test.md" in the "posts" folder collection - -```html -https://www.example.com/path-to-cms/#/edit/posts/test -``` - -* **`collectionName`**: the name of the collection as entered in the CMS config. -* **`entryName`** *(for [file collections](/docs/collection-types/#file-collections)*: the `name` of the entry from the CMS config. -* **`entryName`** *(for [folder collections](/docs/collection-types/#folder-collections)*: the filename, sans extension (the slug). diff --git a/website/content/docs/registering-events.md b/website/content/docs/registering-events.md deleted file mode 100644 index 34556b49be7c..000000000000 --- a/website/content/docs/registering-events.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: Registering to CMS Events -weight: 80 -group: Customization ---- - -You can execute a function when a specific CMS event occurs. - -Example usage: - -```javascript -CMS.registerEventListener({ - name: 'prePublish', - handler: ({ author, entry }) => console.log(JSON.stringify({ author, data: entry.get('data') })), -}); -``` - -Supported events are `prePublish`, `postPublish`, `preUnpublish`, `postUnpublish`, `preSave` and `postSave`. The `preSave` hook can be used to modify the entry data like so: - -```javascript -CMS.registerEventListener({ - name: 'preSave', - handler: ({ entry }) => { - return entry.get('data').set('title', 'new title'); - }, -}); -``` diff --git a/website/content/docs/releases.md b/website/content/docs/releases.md deleted file mode 100644 index 9a59cce4289c..000000000000 --- a/website/content/docs/releases.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -group: Intro -weight: 4 -title: Releases ---- -## Update the CMS Version - -The update procedure for your CMS depends upon the method you used to install Decap CMS. - -### Package Manager - -If you are using a package manager like Yarn or NPM, use their standard procedure to update. This is how both the Hugo and Gatsby starters are set up. - -### CDN - -If you are using the CMS through a CDN like Unpkg, then that depends on the version tag you are using. You can find the version tag in the `/admin/index.html` file of your site. - -* (Recommended) If you use `^3.0.0`, the CMS does all updates except major versions automatically. - - * It upgrades to 3`.0.1`, 3`.1.0`, 3`.1.2`. - * It does not upgrade to 4`.0.0` or higher. - * It does not upgrade to beta versions. -* If you use `~3.0.0`, the CMS will do only patch updates automatically. - - * It upgrades 3`.0.1`, 3`.0.2`. - * It does not upgrade to 3`.1.0` or higher. - * It does not upgrade beta versions. \ No newline at end of file diff --git a/website/content/docs/start-with-a-template.md b/website/content/docs/start-with-a-template.md deleted file mode 100644 index f02c30eebd55..000000000000 --- a/website/content/docs/start-with-a-template.md +++ /dev/null @@ -1,92 +0,0 @@ ---- -group: Intro -weight: 2 -title: Start with a Template ---- -You can add Decap CMS [to an existing site](/docs/add-to-your-site/), but the quickest way to get started is with a template. Found below, our featured templates deploy a bare-bones site and Decap CMS to Netlify ([what's the difference, you ask?](../intro/#decap-cms-vs-netlify)), giving you a fully working CMS-enabled site with just a few clicks. - -
-
-
- -
-

Hugo Site Starter

-

Deploy to Netlify

-
-
-
- -
-

Gatsby Site Starter

-

Deploy to Netlify

-
-
-
- -
-

Middleman Site Starter

-

Deploy to Netlify

-
-
-
- -
-

Preact CLI

-

Deploy to Netlify

-
-
-
- -
-

Next.js Blog Template

-

Deploy to Netlify

-
-
-
- -
-

Eleventy Starter

-

Deploy to Netlify

-
-
-
- -
-

Nuxt.js Boilerplate

-

Deploy to Netlify

-
-
-
- -
-

Metalsmith Starter

-

Deploy to Netlify

-
-
-
- -
-

VuePress Template

-

Deploy to Netlify

-
-
- -After clicking one of those buttons, authenticate with GitHub or GitLab and choose a repository name. Netlify then automatically creates a clone of the repository in your GitHub or GitLab account. Next, it builds and deploys the new site on Netlify, bringing you to the site dashboard after completing the build. - -**Note for Bitbucket users:** Decap CMS supports Bitbucket repositories, but Bitbucket's permissions won't work with the Deploy to Netlify buttons above. You can still set up a repository manually, or follow the [tutorial](/docs/add-to-your-site) for adding Decap CMS to an existing site. - -## Access Decap CMS on your new site - -1. The template deploy process sends you an invitation to your new site, sent from `no-reply@netlify.com`. - ![Sample email subject line: You've been invited to join radiologist-amanda-53841.netlify.com](https://www.decapcms.org/img/email-subject.png?raw=true) -2. Wait for the deployment to complete, then click the link to accept the invite. Your site will open with a prompt to create a password. - !["Complete your signup" modal on the Kaldi coffee site](https://www.decapcms.org/img/create-password.png?raw=true) -3. Enter a password, sign in, and you’ll go to the CMS. (For future visits, you can go straight to `/admin/`.) - -Try adding and editing posts, or changing the content of the Products page. When you save, the changes are pushed immediately to your Git repository, triggering a build on Netlify, and updating the content on your site. Check out the configuration code by visiting your site repo. - -## More paths to explore - -* To see how to integrate Decap CMS into an existing project, go to [Add to your site](/docs/add-to-your-site/). -* Check out other sites using Decap CMS (or share your own!) on the [Examples](/docs/examples/) page. -* If you’d like to add more CMS editors or change how they log in to your site, read up on [Netlify Identity service](https://www.netlify.com/docs/identity). diff --git a/website/content/docs/summary-strings.md b/website/content/docs/summary-strings.md deleted file mode 100644 index 87c99f345ed7..000000000000 --- a/website/content/docs/summary-strings.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -group: Collections -weight: 40 -title: Summary String Transformations ---- - -You can apply transformations on fields in a summary string template using filter notation syntax. - -Example config: - -```yaml -collections: - - name: 'posts' - label: 'Posts' - folder: '_posts' - summary: "{{title | upper}} - {{date | date('YYYY-MM-DD')}} – {{body | truncate(20, '***')}}" - fields: - - { label: 'Title', name: 'title', widget: 'string' } - - { label: 'Publish Date', name: 'date', widget: 'datetime' } - - { label: 'Body', name: 'body', widget: 'markdown' } -``` - -The above config will transform the title field to uppercase and format the date field using `YYYY-MM-DD` format. -Available transformations are `upper`, `lower`, `date('')`, `default('defaultValue')`, `ternary('valueForTrue','valueForFalse')` and `truncate()`/`truncate(, '')` diff --git a/website/content/docs/test-backend.md b/website/content/docs/test-backend.md deleted file mode 100644 index e26cfefb65a8..000000000000 --- a/website/content/docs/test-backend.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: Test -group: Accounts -weight: 50 ---- - -You can use the `test-repo` backend to try out Decap CMS without connecting to a Git repo. With this backend, you can write and publish content normally, but any changes will disappear when you reload the page. This backend powers the Decap CMS [demo site](https://demo.decapcms.org/). - -**Note:** The `test-repo` backend can't access your local file system, nor does it connect to a Git repo, thus you won't see any existing files while using it. - -To enable this backend, add the following lines to your Decap CMS `config.yml` file: - -```yaml -backend: - name: test-repo -``` diff --git a/website/content/docs/uploadcare.md b/website/content/docs/uploadcare.md deleted file mode 100644 index 0277fab8effd..000000000000 --- a/website/content/docs/uploadcare.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: Uploadcare -group: Media -weight: 30 ---- -Uploadcare is a sleek service that allows you to upload files without worrying about maintaining a growing collection — more of an asset store than a library. Just upload when you need to, and the files are hosted on their CDN. They provide image processing controls from simple cropping and rotation to filters and face detection, and a lot more. You can check out Uploadcare's full feature set on their [website](https://uploadcare.com/). - -The Uploadcare media library integration for Decap CMS allows you to use Uploadcare as your media handler within the CMS itself. It's available by default as of our 2.1.0 release, and works in tandem with the existing file and image widgets, so using it only requires creating an Uploadcare account and updating your Decap CMS configuration. - -**Please make sure that Decap CMS is updated to 2.1.0 or greater before proceeding.** - -## Creating an Uploadcare Account - -You can [sign up](https://uploadcare.com/accounts/signup/) for a free Uploadcare account to get started. Once you've signed up, go to your dashboard, select a project, and then select "API keys" from the menu on the left. The public key on the API keys page will be needed in your Decap CMS configuration. For more info on getting your API key, visit their [walkthrough](https://uploadcare.com/docs/keys/). - -## Updating Decap CMS Configuration - -The next and final step is updating your Decap CMS configuration file: - -1. Add a `media_library` property at the same level as `media_folder`, with an object as it's value. -2. In the `media_library` object, add the name of the media player under `name`. -3. Add a `config` object under name with a `publicKey` property with your Uploadcare public key as it's value. - -Your `config.yml` should now include something like this (except with a real API key): - -```yaml -media_library: - name: uploadcare - config: - publicKey: YOUR_UPLOADCARE_PUBLIC_KEY -``` - -Once you've finished updating your Decap CMS configuration, the Uploadcare widget will appear when using the image or file widgets. - -**Note:** The Decap CMS media library extensions for Uploadcare are not included in `decap-cms-app`. If you're using `decap-cms-app`, you'll need to register the media libraries yourself. - -## Configuring the Uploadcare Widget - -The Uploadcare widget can be configured with settings that are outlined [in their docs](https://uploadcare.com/docs/file_uploads/widget/options/). The widget itself accepts configuration through global variables and data properties on HTML elements, but with Decap CMS you can pass configuration options directly through your `config.yml`. - -**Note:** all default values described in Uploadcare's documentation also apply in the Decap CMS integration, except for `previewStep`, which is set to `true`. This was done because the preview step provides helpful information like upload status, and provides access to image editing controls. This option can be disabled through the configuration options below. - -### Global configuration - -Global configuration, which is meant to affect the Uploadcare widget at all times, can be provided as seen above, under the primary `media_library` property. Settings applied here will affect every instance of the Uploadcare widget. - -## Field configuration - -Configuration can also be provided for individual fields that use the media library. The structure is very similar to the global configuration, except the settings are added to an individual `field`. For example: - -```yaml - ... - fields: - name: cover - label: Cover Image - widget: image - media_library: - config: - multiple: true - previewStep: false -``` - -## Integration settings - -There are several settings that control the behavior of integration with the widget. - -* `autoFilename` (`boolean`) - specify whether to add a filename to the end of the url. Example: `http://ucarecdn.com/:uuid/filename.png` -* `defaultOperations` (`string`) - specify a string added at the end of the url. This could be useful to apply a set of CDN operations to each image, for example resizing or compression. All the possible operations are listed [here](https://uploadcare.com/docs/api_reference/cdn/). - -```yaml -media_library: - name: uploadcare - config: - publicKey: YOUR_UPLOADCARE_PUBLIC_KEY - settings: - autoFilename: true - defaultOperations: '/resize/800x600/' -``` diff --git a/website/content/docs/variable-type-widgets.md b/website/content/docs/variable-type-widgets.md deleted file mode 100644 index 7415467dfa04..000000000000 --- a/website/content/docs/variable-type-widgets.md +++ /dev/null @@ -1,83 +0,0 @@ ---- -label: "Variable Type Widgets" -group: Fields -weight: 30 ---- - -Before this feature, the [list widget](/docs/widgets/#list) allowed a set of fields to be repeated, but every list item had the same set of fields available. With variable types, multiple named sets of fields can be defined, which opens the door to highly flexible content authoring (even page building) in Decap CMS. - -**Note: this feature does not yet support default previews and requires [registering a preview template](/docs/customization#registerpreviewtemplate) in order to show up in the preview pane.** - -To use variable types in the list widget, update your field configuration as follows: - -1. Instead of defining your list fields under `fields` or `field`, define them under `types`. Similar to `fields`, `types` must be an array of field definition objects. -2. Each field definition under `types` must use the `object` widget (this is the default value for - `widget`). - -### Additional list widget options - -* `types`: a nested list of object widgets. All widgets must be of type `object`. Every object widget may define different set of fields. -* `typeKey`: the name of the field that will be added to every item in list representing the name of the object widget that item belongs to. Ignored if `types` is not defined. Default is `type`. -* `summary`: allows customization of a collapsed list item object in a similar way to a [collection summary](/docs/configuration-options/?#summary) - -### Example Configuration - -The example configuration below imagines a scenario where the editor can add two "types" of content, -either a "carousel" or a "spotlight". Each type has a unique name and set of fields. - -```yaml -- label: 'Home Section' - name: 'sections' - widget: 'list' - types: - - label: 'Carousel' - name: 'carousel' - widget: object - summary: '{{fields.header}}' - fields: - - { label: Header, name: header, widget: string, default: 'Image Gallery' } - - { label: Template, name: template, widget: string, default: 'carousel.html' } - - label: Images - name: images - widget: list - field: { label: Image, name: image, widget: image } - - label: 'Spotlight' - name: 'spotlight' - widget: object - fields: - - { label: Header, name: header, widget: string, default: 'Spotlight' } - - { label: Template, name: template, widget: string, default: 'spotlight.html' } - - { label: Text, name: text, widget: text, default: 'Hello World' } -``` - -### Example Output - -The output for the list widget will be an array of objects, and each object will have a `type` key -with the name of the type used for the list item. The `type` key name can be customized via the -`typeKey` property in the list configuration. - -If the above example configuration were used to create a carousel, a spotlight, and another -carousel, the output could look like this: - -```yaml -title: Home -sections: - - type: carousel - header: Image Gallery - template: carousel.html - images: - - images/image01.png - - images/image02.png - - images/image03.png - - type: spotlight - header: Spotlight - template: spotlight.html - text: Hello World - - type: carousel - header: Image Gallery - template: carousel.html - images: - - images/image04.png - - images/image05.png - - images/image06.png -``` diff --git a/website/content/docs/widgets.md b/website/content/docs/widgets.md deleted file mode 100644 index ab6a8ebb248c..000000000000 --- a/website/content/docs/widgets.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: Widgets -group: Fields -weight: 10 ---- - -Widgets define the data type and interface for entry fields. Decap CMS comes with several built-in widgets. Click the widget names in the sidebar to jump to specific widget details. We’re always adding new widgets, and you can also [create your own](../custom-widgets)! - -Widgets are specified as collection fields in the Decap CMS `config.yml` file. Note that [YAML syntax](https://en.wikipedia.org/wiki/YAML#Basic_components) allows lists and objects to be written in block or inline style, and the code samples below include a mix of both. - -To see working examples of all of the built-in widgets, try making a 'Kitchen Sink' collection item on the [CMS demo site](https://demo.decapcms.org). (No login required: click the login button and the CMS will open.) You can refer to the demo [configuration code](https://github.com/decaporg/decap-cms/blob/master/dev-test/config.yml) to see how each field was configured. - -## Common widget options - -The following options are available on all fields: - -- `required`: specify as `false` to make a field optional; defaults to `true` -- `hint`: optionally add helper text directly below a widget. Useful for including instructions. Accepts markdown for bold, italic, strikethrough, and links. -- `pattern`: add field validation by specifying a list with a [regex pattern](https://regexr.com/) and an error message; more extensive validation can be achieved with [custom widgets](../custom-widgets/#advanced-field-validation) -- **Example:** - ```yaml - label: "Title" - name: "title" - widget: "string" - pattern: ['.{12,}', "Must have at least 12 characters"] - ``` - -## Default widgets diff --git a/website/content/docs/widgets/boolean.md b/website/content/docs/widgets/boolean.md deleted file mode 100644 index 30b71349faac..000000000000 --- a/website/content/docs/widgets/boolean.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: boolean -label: "Boolean" ---- - -The boolean widget translates a toggle switch input to a true/false value. - -- **Name:** `boolean` -- **UI:** toggle switch -- **Data type:** boolean -- **Options:** - - `default`: accepts `true` or `false`; defaults to `false` when `required` is set to `false` -- **Example:** - ```yaml - - {label: "Draft", name: "draft", widget: "boolean", default: true} - ``` diff --git a/website/content/docs/widgets/code.md b/website/content/docs/widgets/code.md deleted file mode 100644 index 01ee267ea815..000000000000 --- a/website/content/docs/widgets/code.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: code -label: 'Code' ---- - -The code widget provides a code editor (powered by [Codemirror](https://codemirror.net)) with optional syntax awareness. Can output the raw code value or an object with the selected language and the raw code value. - -- **Name:** `code` -- **UI:** code editor -- **Data type:** string -- **Options:** - - `default_language`: optional; default language to use - - `allow_language_selection`: optional; defaults to `false`: allows syntax to be changed - - `keys`: optional; sets key names for code and lang if outputting an object; defaults to `{ code: 'code', lang: 'lang' }` - - `output_code_only`: set to `true` to output the string value only, defaults to `false` - -- **Example:** - ```yaml - - label: 'Code' - name: 'code' - widget: 'code' - ``` diff --git a/website/content/docs/widgets/color.md b/website/content/docs/widgets/color.md deleted file mode 100644 index 97495c7939bd..000000000000 --- a/website/content/docs/widgets/color.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -label: 'Color' -title: color ---- - -The color widget translates a color picker to a color string. - -- **Name:** `color` -- **UI:** color picker -- **Data type:** string -- **Options:** - - `default`: accepts a string; defaults to an empty string. Sets the default value - - `allowInput`: accepts a boolean, defaults to `false`. Allows manual editing of the color input value - - `enableAlpha`: accepts a boolean, defaults to `false`. Enables Alpha editing -- **Example:** - ```yaml - - { label: 'Color', name: 'color', widget: 'color' } - ``` -- **Example:** - ```yaml - - { label: 'Color', name: 'color', widget: 'color', enableAlpha: true, allowInput: true } - ``` diff --git a/website/content/docs/widgets/datetime.md b/website/content/docs/widgets/datetime.md deleted file mode 100644 index 1b0386a5f7b7..000000000000 --- a/website/content/docs/widgets/datetime.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: datetime -label: "DateTime" ---- - -The datetime widget translates a datetime picker to a datetime string. - -- **Name:** `datetime` -- **UI:** datetime picker -- **Data type:** [Day.js](https://day.js.org/)-formatted datetime string -- **Options:** - - `default`: accepts a datetime string, or an empty string to accept blank input; otherwise defaults to current datetime - - `format`: sets storage format; accepts [Day.js formats](https://day.js.org/docs/en/display/format); defaults to ISO8601 (if supported by output format) - - `date_format`: sets date display format in UI; boolean or [Day.js formats](https://day.js.org/docs/en/display/format). If `true` use default locale format. - - `time_format`: sets time display format in UI; boolean or [Day.js formats](https://day.js.org/docs/en/display/format). If `true` use default locale format, `false` hides time-picker. - - `picker_utc`: _(default: `false`)_ when set to `true`, the datetime picker will display times in UTC. When `false`, the datetime picker will display times in the user's local timezone. When using date-only formats, it can be helpful to set this to `true` so users in all timezones will see the same date in the datetime picker. -- **Example:** - ```yaml - - label: "Start time" - name: "start" - widget: "datetime" - default: "" - date_format: "DD.MM.YYYY" # e.g. 24.12.2021 - time_format: "HH:mm" # e.g. 21:07 - format: "LLL" - picker_utc: false - ``` diff --git a/website/content/docs/widgets/file.md b/website/content/docs/widgets/file.md deleted file mode 100644 index 4987407064b5..000000000000 --- a/website/content/docs/widgets/file.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: file -label: File ---- -The file widget allows editors to upload a file or select an existing one from the media library. The path to the file will be saved to the field as a string. - -* **Name:** `file` -* **UI:** file picker button opens media gallery -* **Data type:** file path string -* **Options:** - - * `default`: accepts a file path string; defaults to null - * `media_library`: media library settings to apply when a media library is opened by the - current widget - - * `allow_multiple`: *(default: `true`)* when set to `false`, prevents multiple selection for any media library extension, but must be supported by the extension in use - * `config`: a configuration object that will be passed directly to the media library being - used - available options are determined by the library - * `media_folder` (Beta): file path where uploaded files will be saved specific to this control. Paths can be relative to a collection folder (e.g. `files` will add the file to a sub-folder in the collection folder) or absolute with reference to the base of the repo which needs to begin with `/` (e.g `/static/files` will save uploaded files to the `static` folder in a sub folder named `files`) - * `choose_url`: *(default: `true`)* when set to `false`, the "Insert from URL" button will be hidden -* **Example:** - - ```yaml - - label: "Manual PDF" - name: "manual_pdf" - widget: "file" - default: "/uploads/general-manual.pdf" - media_library: - config: - multiple: true - ``` - -### File Size Limit - -You can set a limit to as what the maximum file size of a file is that users can upload directly into a file field. - -**Example** - -```yaml - media_library: - config: - max_file_size: 1024000 # in bytes, only for default media library -``` diff --git a/website/content/docs/widgets/hidden.md b/website/content/docs/widgets/hidden.md deleted file mode 100644 index 3fe738b15bea..000000000000 --- a/website/content/docs/widgets/hidden.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -label: "Hidden" -title: hidden ---- - -Hidden widgets do not display in the UI. In folder collections that allow users to create new items, you will often want to set a default for hidden fields, so they will be set without requiring an input. - -- **Name:** `hidden` -- **UI:** none -- **Data type:** any valid data type -- **Options:** - - `default`: accepts any valid data type; recommended for collections that allow adding new items -- **Example:** - ```yaml - - {label: "Layout", name: "layout", widget: "hidden", default: "blog"} - ``` diff --git a/website/content/docs/widgets/image.md b/website/content/docs/widgets/image.md deleted file mode 100644 index 5151412061e5..000000000000 --- a/website/content/docs/widgets/image.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: image -label: Image ---- -The image widget allows editors to upload an image or select an existing one from the media library. The path to the image file will be saved to the field as a string. - -* **Name:** `image` -* **UI:** file picker button opens media gallery allowing image files (jpg, jpeg, webp, gif, png, bmp, tiff, svg) only; displays selected image thumbnail -* **Data type:** file path string -* **Options:** - - * `default`: accepts a file path string; defaults to null - * `media_library`: settings to apply when a media library is opened by the - current widget - * `allow_multiple`: *(default: `true`)* when set to `false`, multiple selection will be disabled even if the media library extension supports it - * `config`: a configuration object passed directly to the media library; check the documentation of your media library extension for available `config` options - * `media_folder` (Beta): file path where uploaded images will be saved specific to this control. Paths can be relative to a collection folder (e.g. `images` will add the image to a sub-folder in the collection folder) or absolute with reference to the base of the repo which needs to begin with `/` (e.g `/static/images` will save uploaded images to the `static` folder in a sub folder named `images`) - * `public_folder` *(defaults to the value of `media_folder`, with an opening `/` if one is not already included.)*: specifies the folder path where the files uploaded by the media library will be accessed, relative to the base of the built site. The value of the field is generated by prepending this path to the filename of the selected file. - * `choose_url`: *(default: `true`)* when set to `false`, the "Insert from URL" button will be hidden -* **Example:** - -```yaml - - label: "Featured Image" - name: "thumbnail" - widget: "image" - choose_url: true - default: "/uploads/chocolate-dogecoin.jpg" - media_library: - config: - multiple: true -``` - -### Image Size Limit - -You can set a limit to as what the maximum file size of a file is that users can upload directly into a image field. - -**Example** - -```yaml - media_library: - config: - max_file_size: 512000 # in bytes, only for default media library -``` diff --git a/website/content/docs/widgets/list.md b/website/content/docs/widgets/list.md deleted file mode 100644 index 153131f806d0..000000000000 --- a/website/content/docs/widgets/list.md +++ /dev/null @@ -1,128 +0,0 @@ ---- -title: list -label: List ---- -The list widget allows you to create a repeatable item in the UI which saves as a list of widget values. map a user-provided string with a comma delimiter into a list. You can choose any widget as a child of a list widget—even other lists. - -* **Name:** `list` -* **UI:** without any `fields` specified, the list widget defaults to a text input for entering comma-separated values; with `fields` specified, the list widget contains a repeatable child widget, with controls for adding, deleting, and re-ordering the repeated widgets. -* **Data type:** list of widget values -* **Options:** - - * `default`: you may specify a list of strings to populate the basic text - field, or an array of list items for lists using the `fields` option. If no - default is declared when using `field` or `fields`, will default to a single - list item using the defaults on the child widgets - * `allow_add`: `false` hides the button to add additional items - * `collapsed`: when `true`, the entries collapse by default - * `summary`: specify the label displayed on collapsed entries - * `minimize_collapsed`: when `true`, collapsing the list widget will hide all of its entries instead of showing summaries - * `label_singular`: the text to show on the add button - * `field`: a single widget field to be repeated - * `fields`: a nested list of multiple widget fields to be included in each repeatable iteration - * `max`: maximum number of items in the list - * `min`: minimum number of items in the list - * `add_to_top`: when `true`, new entries will be added to the top of the list -* **Example** (`field`/`fields` not specified): - -```yaml -- label: "Tags" - name: "tags" - widget: "list" - default: ["news"] -``` - -* **Example** (`allow_add` marked `false`): - -```yaml -- label: "Tags" - name: "tags" - widget: "list" - allow_add: false - default: ["news"] -``` - -* **Example** (with `field`): - -```yaml -- label: "Gallery" - name: "galleryImages" - widget: "list" - summary: '{{fields.image}}' - field: {label: Image, name: image, widget: image} -``` - -* **Example** (with `fields`): - -```yaml -- label: "Testimonials" - name: "testimonials" - widget: "list" - summary: '{{fields.quote}} - {{fields.author.name}}' - fields: - - {label: Quote, name: quote, widget: string, default: "Everything is awesome!"} - - label: Author - name: author - widget: object - fields: - - {label: Name, name: name, widget: string, default: "Emmet"} - - {label: Avatar, name: avatar, widget: image, default: "/img/emmet.jpg"} -``` - -* **Example** (with `default`): - -```yaml -- label: "Gallery" - name: "galleryImages" - widget: "list" - fields: - - { label: "Source", name: "src", widget: "string" } - - { label: "Alt Text", name: "alt", widget: "string" } - default: - - { src: "/img/tennis.jpg", alt: "Tennis" } - - { src: "/img/footbar.jpg", alt: "Football" } -``` - -* **Example** (`collapsed` marked `false`): - -```yaml -- label: "Testimonials" - name: "testimonials" - collapsed: false - widget: "list" - fields: - - {label: Quote, name: quote, widget: string, default: "Everything is awesome!"} - - {label: Author, name: author, widget: string } -``` - -* **Example** (`minimize_collapsed` marked `true`): - -```yaml -- label: "Testimonials" - name: "testimonials" - minimize_collapsed: true - widget: "list" - fields: - - {label: Quote, name: quote, widget: string, default: "Everything is awesome!"} - - {label: Author, name: author, widget: string } -``` - -* **Example** (with `max` & `min`): - -```yaml -- label: "Tags" - name: "tags" - widget: "list" - max: 3 - min: 1 - default: ["news"] -``` - -* **Example** (`add_to_top` marked `true`): - -```yaml -- label: "Tags" - name: "tags" - widget: "list" - add_to_top: true -``` \ No newline at end of file diff --git a/website/content/docs/widgets/map.md b/website/content/docs/widgets/map.md deleted file mode 100644 index eb4b2bf6a581..000000000000 --- a/website/content/docs/widgets/map.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: map -label: Map ---- -The map widget allows you to edit spatial data using an interactive map. Spatial data for a single piece of geometry saves as a GeoJSON string in WGS84 projection. - -* **Name:** `map` -* **UI:** interactive map -* **Data type:** GeoJSON string -* **Options:** - - * `decimals`: accepts a number to specify precision of saved coordinates; defaults to 7 decimals - * `default`: accepts a GeoJSON string containing a single geometry; defaults to an empty string - * `type`: accepts one string value of `Point`, `LineString` or `Polygon`; defaults to `Point` -* **Example:** - - ```yaml - - {label: "Location", name: "location", widget: "map" } - ``` \ No newline at end of file diff --git a/website/content/docs/widgets/markdown.md b/website/content/docs/widgets/markdown.md deleted file mode 100644 index 70043a1c4efc..000000000000 --- a/website/content/docs/widgets/markdown.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: markdown -label: Markdown ---- -The markdown widget provides a full fledged text editor allowing users to format text with features such as headings and blockquotes. Users can change their editing view with a handy toggle button. - -*Please note:* If you want to use your markdown editor to fill a markdown file contents after its frontmatter, you'll have to name the field `body` so the CMS recognizes it and saves the file accordingly. - -* **Name:** `markdown` -* **UI:** full text editor -* **Data type:** markdown -* **Options:** - - * `default`: accepts markdown content - * `minimal`: accepts a boolean value, `false` by default. Sets the widget height to minimum possible. - * `buttons`: an array of strings representing the formatting buttons to display (all shown by default). Buttons include: `bold`, `italic`, `code`, `link`, `heading-one`, `heading-two`, `heading-three`, `heading-four`, `heading-five`, `heading-six`, `quote`, `bulleted-list`, and `numbered-list`. - * `editor_components`: an array of strings representing the names of editor components to display (all shown by default). Decap CMS includes `image` and `code-block` editor components by default, and custom components may be [created and registered](/docs/custom-widgets/#registereditorcomponent). - * `modes`: an array of strings representing the names of allowed editor modes. Possible modes are `raw` and `rich_text`. A toggle button appears in the toolbar when more than one mode is available. - * `sanitize_preview`: accepts a boolean value, `false` by default. Sanitizes markdown preview to prevent XSS attacks - might alter the preview content. -* **Example:** - - ```yaml - - { label: 'Blog post content', name: 'body', widget: 'markdown' } - ``` - -This would render as: - -![Markdown widget example](/img/widgets-markdown.png) - -*Please note:* The markdown widget outputs a raw markdown string. Your static site generator may or may not render the markdown to HTML automatically. Consult with your static site generator's documentation for more information about rendering markdown. - -### Remark plugins - -You can register plugins to customize [`remark`](https://github.com/remarkjs/remark), the library used by the richtext editor for serializing and deserializing markdown. - -```js -// register a plugin -CMS.registerRemarkPlugin(plugin); - -// provide global settings to all plugins, e.g. for customizing `remark-stringify` -CMS.registerRemarkPlugin({ settings: { bullet: '-' } }); -``` - -Note that `netlify-widget-markdown` currently uses `remark@10`, so you should check a plugin's compatibility first. diff --git a/website/content/docs/widgets/number.md b/website/content/docs/widgets/number.md deleted file mode 100644 index e0ea666e4678..000000000000 --- a/website/content/docs/widgets/number.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -label: "Number" -title: number ---- - -The number widget uses an HTML number input, saving the value as a string, integer, or floating point number. - -- **Name:** `number` -- **UI:** HTML [number input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number) -- **Data type:** string by default; configured by `value_type` option -- **Options:** - - `default`: accepts string or number value; defaults to empty string - - `value_type`: accepts `int` or `float`; any other value results in saving as a string - - `min`: accepts a number for minimum value accepted; unset by default - - `max`: accepts a number for maximum value accepted; unset by default - - `step`: accepts a number for stepping up/down values in the input; 1 by default -- **Example:** - ```yaml - - label: "Puppy Count" - name: "puppies" - widget: "number" - default: 2 - value_type: "int" - min: 1 - max: 101 - step: 2 - ``` diff --git a/website/content/docs/widgets/object.md b/website/content/docs/widgets/object.md deleted file mode 100644 index a45b3315f0f4..000000000000 --- a/website/content/docs/widgets/object.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: object -label: Object ---- -The object widget allows you to group multiple widgets together, nested under a single field. You can choose any widget as a child of an object widget—even other objects. - -* **Name:** `object` -* **UI:** a field containing one or more child widgets -* **Data type:** list of child widget values -* **Options:** - - * `default`: you can set defaults within each sub-field's configuration - * `collapsed`: if added and labeled `true`, collapse the widget's content by default - * `summary`: specify the label displayed when the object is collapsed - * `fields`: (**required**) a nested list of widget fields to include in your widget -* **Example:** - - ```yaml - - label: "Profile" - name: "profile" - widget: "object" - summary: '{{fields.name}}: {{fields.birthdate}}' - fields: - - {label: "Public", name: "public", widget: "boolean", default: true} - - {label: "Name", name: "name", widget: "string"} - - label: "Birthdate" - name: "birthdate" - widget: "date" - default: "" - format: "MM/DD/YYYY" - - label: "Address" - name: "address" - widget: "object" - collapsed: true - fields: - - {label: "Street Address", name: "street", widget: "string"} - - {label: "City", name: "city", widget: "string"} - - {label: "Postal Code", name: "post-code", widget: "string"} - ``` diff --git a/website/content/docs/widgets/relation.md b/website/content/docs/widgets/relation.md deleted file mode 100644 index 0bc656b73cca..000000000000 --- a/website/content/docs/widgets/relation.md +++ /dev/null @@ -1,63 +0,0 @@ ---- -title: relation -label: Relation ---- -The relation widget allows you to reference items from another collection. It provides a search input with a list of entries from the collection you're referencing, and the list automatically updates with matched entries based on what you've typed. - -* **Name:** `relation` -* **UI:** text input with search result dropdown -* **Data type:** data type of the value pulled from the related collection item -* **Options:** - - * `collection`: (**required**) name of the referenced collection (string) - * `value_field`: (**required**) name of the field from the referenced collection whose value will be stored for the relation. For nested fields, separate each subfield with a `.` (e.g. `name.first`). For list fields use a wildcard `*` to target all list items (e.g. `categories.*`). - * `search_fields`: (**required**) list of one or more names of fields in the referenced collection to search for the typed value. Syntax to reference nested fields is similar to that of *value_field*. - * `file`: allows referencing a specific file when the referenced collection is a files collection (string) - * `display_fields`: list of one or more names of fields in the referenced collection that will render in the autocomplete menu of the control. Defaults to `value_field`. Syntax to reference nested fields is similar to that of *value_field*. - * `default`: accepts any widget data type; defaults to an empty string - * `multiple` : accepts a boolean, defaults to `false` - * `min`: minimum number of items; ignored if **multiple** is `false` - * `max`: maximum number of items; ignored if **multiple** is `false` - * `options_length`: accepts integer to override number of options presented to user. Defaults to `20`. -* **Referencing a folder collection example** (assuming a separate "authors" collection with "name" and "twitterHandle" fields with subfields "first" and "last" for the "name" field): - -```yaml -- label: "Post Author" - name: "author" - widget: "relation" - collection: "authors" - search_fields: ["name.first", "twitterHandle"] - value_field: "name.first" - display_fields: ["twitterHandle", "followerCount"] -``` - -The generated UI input will search the authors collection by name and twitterHandle, and display each author's handle and follower count. On selection, the author's name is saved for the field. - -* **String templates example** (assuming a separate "authors" collection with "name" and "twitterHandle" fields with subfields "first" and "last" for the "name" field): - -```yaml -- label: "Post Author" - name: "author" - widget: "relation" - collection: "authors" - search_fields: ['name.first'] - value_field: "{{slug}}" - display_fields: ["{{twitterHandle}} - {{followerCount}}"] -``` - -The generated UI input will search the authors collection by name, and display each author's handle and follower count. On selection, the author entry slug is saved for the field. - -* **Referencing a file collection list field example** (assuming a separate "relation_files" collection with a file named "cities" with a list field "cities" with subfields "name" and "id"): - -```yaml -- label: "City" - name: "city" - widget: "relation" - collection: "relation_files" - file: "cities" - search_fields: ["cities.*.name"] - display_fields: ["cities.*.name"] - value_field: "cities.*.id" -``` - -The generated UI input will search the cities file by city name, and display each city's name. On selection, the city id is saved for the field. \ No newline at end of file diff --git a/website/content/docs/widgets/select.md b/website/content/docs/widgets/select.md deleted file mode 100644 index 5377cc513bc9..000000000000 --- a/website/content/docs/widgets/select.md +++ /dev/null @@ -1,79 +0,0 @@ ---- -title: select -label: Select ---- -The select widget allows you to pick a string value from a dropdown menu. - -* **Name:** `select` -* **UI:** select input -* **Data type:** string or array -* **Options:** - - * `default`: `options` must contain any default values - - * string values: accepts a string; defaults to an empty string. Accepts an array of strings and defaults to an empty array with `multiple: true` enabled. - * object with `label` and `value` fields: accepts an object with `label` and `value` field or an array of such objects when `multiple: true` is enable. Defaults to no value - * `options`: (**required**) there are two ways to list of options for the dropdown menu: - - * string values: the dropdown displays the value directly - * object with `label` and `value` fields: the label displays in the dropdown; the value saves in the file - * `multiple`: accepts a boolean; defaults to `false` - * `min`: minimum number of items; ignored if **multiple** is `false` - * `max`: maximum number of items; ignored if **multiple** is `false` - -* **Example** (options as strings): - -```yaml -- label: "Align Content" - name: "align" - widget: "select" - options: ["left", "center", "right"] -``` - -Selecting the `center` option, will save the value as: - -```yaml -align: "center" -``` - -* **Example** (options as objects): - -```yaml -- label: "City" - name: "airport-code" - widget: "select" - options: - - { label: "Chicago", value: "ORD" } - - { label: "Paris", value: "CDG" } - - { label: "Tokyo", value: "HND" } -``` - -Selecting the `Chicago` option, will save the value as: - -```yaml -airport-code: "ORD" -``` - -* **Example** (multiple): - -```yaml -- label: "Tags" - name: "tags" - widget: "select" - multiple: true - options: ["Design", "UX", "Dev"] - default: ["Design"] -``` - -* **Example** (min/max): - -```yaml -- label: "Tags" - name: "tags" - widget: "select" - multiple: true - min: 1 - max: 3 - options: ["Design", "UX", "Dev"] - default: ["Design"] -``` diff --git a/website/content/docs/widgets/string.md b/website/content/docs/widgets/string.md deleted file mode 100644 index fdffbfd4a33b..000000000000 --- a/website/content/docs/widgets/string.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -label: "String" -title: string ---- - -The string widget translates a basic text input to a string value. For larger textarea inputs, use the text widget. - -- **Name:** `string` -- **UI:** text input -- **Data type:** string -- **Options:** - - `default`: accepts a string; defaults to an empty string -- **Example:** - ```yaml - - {label: "Title", name: "title", widget: "string"} - ``` diff --git a/website/content/docs/widgets/text.md b/website/content/docs/widgets/text.md deleted file mode 100644 index 46f287e54ca8..000000000000 --- a/website/content/docs/widgets/text.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -label: "Text" -title: text ---- - -The text widget takes a multiline text field and saves it as a string. For shorter text inputs, use the string widget. - -- **Name:** `text` -- **UI:** HTML textarea -- **Data type:** string -- **Options:** - - `default`: accepts a string; defaults to an empty string -- **Example:** - ```yaml - - {label: "Description", name: "description", widget: "text"} - ``` diff --git a/website/content/docs/working-with-a-local-git-repository.md b/website/content/docs/working-with-a-local-git-repository.md deleted file mode 100644 index 6d2e800b43f2..000000000000 --- a/website/content/docs/working-with-a-local-git-repository.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -group: Accounts -weight: 70 -title: Working with a Local Git Repository ---- -You can connect Decap CMS to a local Git repository, instead of working with a live repo. - -1. Navigate to a local Git repository configured with the CMS. -2. Add the top-level property `local_backend` configuration to your `config.yml`: - -```yaml -# when using the default proxy server port -local_backend: true - -backend: - name: git-gateway -``` - -3. Run `npx decap-server` from the root directory of the above repository. - - * If the default port (8081) is in use, the proxy server won't start and you will see an error message. In this case, follow [these steps](#configure-the-decap-server-port-number) before proceeding. -4. Start your local development server (e.g. run `gatsby develop`). -5. Open `http://localhost:/admin` to verify that your can administer your content locally. Replace `` with the port of your local development server. For example Gatsby's default port is `8000` - -**Note:** `decap-server` runs an unauthenticated express server. As any client can send requests to the server, it should only be used for local development. Also note that `editorial_workflow` is not supported in this environment. - -### Configure the Decap CMS proxy server port number - -1. Create a `.env` file in the project's root folder and define the PORT you'd like the proxy server to use - -```ini -PORT=8082 -``` - -2. Update the `local_backend` object in `config.yml` and specify a `url` property to use your custom port number - -```yaml -backend: - name: git-gateway - -local_backend: - # when using a custom proxy server port - url: http://localhost:8082/api/v1 - # when accessing the local site from a host other than 'localhost' or '127.0.0.1' - allowed_hosts: ['192.168.0.1'] -``` \ No newline at end of file diff --git a/website/content/docs/writing-style-guide.md b/website/content/docs/writing-style-guide.md deleted file mode 100644 index 52fb579f1958..000000000000 --- a/website/content/docs/writing-style-guide.md +++ /dev/null @@ -1,293 +0,0 @@ ---- -group: Contributing -weight: 30 -title: Writing Style Guide ---- -# Decap CMS Style Guide - -*Adapted from the [Kubernetes Style Guide](https://kubernetes.io/docs/contribute/style/style-guide)* - - -## Documentation Formatting Standards - -### Use angle brackets for placeholders - -Use angle brackets for placeholders. Tell the reader what a placeholder represents. - -1. Display information about a CLI command: - -```bash -npm install -``` - -where `` is the name of a package. - -### Use bold for user interface elements - -Do: Click **Save**. - -Don't: Click "Save". - -- - - - -Do: Select **Log Out**. - -Don't: Select 'Log Out'. - -- - - - -### Use italics to define or introduce new terms - -Do: A *collection* is a set of entries … - -Don't: A "collection" is a set of entries … - -- - - - -Do: These components form the *control pane*. - -Don't: These components form the **control pane**. - -- - - - -### Use code style for filenames, directories, and paths - -Do: Open the `config.yaml` file. - -Don't: Open the config.yaml file. - -- - - - -Do: Go to the `/docs/guides` directory. - -Don't: Go to the /docs/guides directory. - -- - - - -Do: Open the `/admin/index.html` file. - -Don't: Open the /admin/index.html file. - -- - - - -### Use the international standard for punctuation inside quotes - -Do: Branch names begin with "cms". - -Don't: Branch names begin with "stage." - -- - - - -Do: The copy is called a "fork". - -Don't: The copy is called a "fork." - -- - - - -## Inline code formatting - -### Use code style for inline code and commands - -For inline code in an HTML document, use the `` tag. In a Markdown document, use the backtick (`). - -Do: The `yarn start` command starts the development server. - -Don't: The "yarn start" command starts the development server. - -- - - - -Do: For a production build, use `yarn build`. - -Don't: For a production build, use "yarn build". - -- - - - -Do: Enclose code samples with triple backticks. ````(```)```` - -Don't: Enclose code samples with any other syntax. - -- - - - -### Use code style for object field names - -Do: Set the value of the `media_folder` field in the configuration file. - -Don't: Set the value of the "media_folder" field in the configuration file. - -- - - - -Do: The value of the `name` field is a string. - -Don't: The value of the "name" field is a string. - -- - - - -### Use normal style for string and integer field values - -For field values of type string or integer, use normal style without quotation marks. - -Do: Set the value of `publish_mode` to editorial_workflow. - -Don't: Set the value of `imagePullPolicy` to "Always". - -- - - - -Do: Set the value of `image` to nginx:1.8. - -Don't: Set the value of `image` to `nginx:1.8`. - -- - - - -Do: Set the value of the `replicas` field to 2. - -Don't: Set the value of the `replicas` field to 2. - -- - - - -## Code snippet formatting - -### Don’t include the command prompt - -Do: yarn start - -Don't: $ yarn start - -## Content best practices - -This section contains suggested best practices for clear, concise, and consistent content. - -### Use present tense - -Do: This command starts a proxy. - -Don't: This command will start a proxy. - -Exception: Use future or past tense if it is required to convey the correct meaning. - -### Use active voice - -Do: You can explore the API using a browser. - -Don't: The API can be explored using a browser. - -- - - - -Do: The YAML file specifies the collection name. - -Don't: The collection name is specified in the YAML file. - -- - - - -Exception: Use passive voice if active voice leads to an awkward construction. - -### Use simple and direct language - -Use simple and direct language. Avoid using unnecessary phrases, such as saying “please.” - -Do: To create an entry, … - -Don't: In order to create an entry, … - -- - - - -Do: See the configuration file. - -Don't: Please see the configuration file. - -- - - - -Do: View the fields. - -Don't: With this next command, we'll view the fields. - -- - - - -### Address the reader as “you” - -Do: You can create a Deployment by … - -Don't: We'll create a Deployment by … - -- - - - -Do: In the preceding output, you can see… - -Don't: In the preceding output, we can see … - -### Avoid Latin phrases - -Prefer English terms over Latin abbreviations. - -Do: For example, … - -Don't: e.g., … - -- - - - -Do: That is, … - -Don't: i.e., … - -- - - - -Exception: Use “etc.” for et cetera. - -## Patterns to avoid - -### Avoid using “we” - -Using “we” in a sentence can be confusing, because the reader might not know whether they’re part of the “we” you’re describing. - -Do: Version 1.4 includes … - -Don't: In version 1.4, we have added … - -- - - - -Do: Decap CMS provides a new feature for … - -Don't: We provide a new feature … - -- - - - -Do: This page teaches you how to use Widgets. - -Don't: In this page, we are going to learn about Widgets. - -- - - - -### Avoid jargon and idioms - -Some readers speak English as a second language. Avoid jargon and idioms to help them understand better. - -Do: Internally - -Don't: Under the hood, … - -- - - - -Do: Create a new cluster. - -Don't: Turn up a new cluster. - -- - - - -### Avoid statements about the future - -Avoid making promises or giving hints about the future. If you need to talk about an alpha feature, put the text under a heading that identifies it as alpha information. - -### Avoid statements that will soon be out of date - -Avoid words like “currently” and “new.” A feature that is new today will not be new in a few months. - -Do: In version 1.4, … - -Don't: In the current version, … - -- - - - -Do: The Federation feature provides … - -Don't: The new Federation feature provides … - -- - - \ No newline at end of file diff --git a/website/content/pages/community.md b/website/content/pages/community.md deleted file mode 100644 index 015f5e37fd61..000000000000 --- a/website/content/pages/community.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: Community -headline: Help us build the CMS of the future. -subhead: Get help, help others, and find out what's new through the channels below. -sections: - - title: contribitung - channels: - - title: Contrubutor guide - description: Instructions for contribitung to the project - url: /docs/contributor-guide - - title: communication - channels: - - title: Decap CMS Discord - description: Live community chat for all things Decap CMS. - url: /chat - - title: GitHub Issues - description: Report bugs, request features, and comment on existing issues. - url: https://github.com/decaporg/decap-cms/issues - - title: GitHub Discussions - description: Ask questions and discuss ideas. - url: https://github.com/decaporg/decap-cms/discussions - - title: help - channels: - - title: Professional help - description: Our partners offer a range of services that can help you get the most out of Decap CMS. Find onboarding, priority support, and development of custom features. - url: /services - - title: Community help - description: Get help from the community on our Dicsord server's help channel. - url: /chat ---- diff --git a/website/content/pages/services.md b/website/content/pages/services.md deleted file mode 100644 index 0cc9dc83d0f6..000000000000 --- a/website/content/pages/services.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: Professional help -description: Our partners offer a range of services that can help you get the most out of Decap CMS. Find onboarding, priority support, and development of custom features. -image: /img/pro-help.png ---- -## Onboarding - -Get started with Decap CMS with onboarding sessions provided by experts. - -This service is provided by PM TechHub, the maintainers of Decap CMS. - -Learn more about Onboarding - -## Monthly Priority Support - -Get continuous support for Decap CMS with priority response times. - -This service is provided by PM TechHub, the maintainers of Decap CMS. - -Learn more about Priority Support - -## Development of Custom Features - -Sponsor the development of a custom feature tailored to your needs. The expert team of maintainers is ready to bring your vision to life. - -This service is provided by PM TechHub, the maintainers of Decap CMS. - -Learn more about Custom Features - -## Building Websites with Decap CMS - -Work with experts and agencies that build websites with Decap CMS. - -- PM TechHub - -
- ------- - -## Become a Partner - -If you offer support for Decap CMS, you can become a partner. Partners are listed on this page and can use the Decap Partner logo on their website. - -Contact us to find out more how to become a partner and how the partnership works. diff --git a/website/data/.keep b/website/data/.keep deleted file mode 100755 index e69de29bb2d1..000000000000 diff --git a/website/data/docs.yml b/website/data/docs.yml deleted file mode 100644 index 168f6f026558..000000000000 --- a/website/data/docs.yml +++ /dev/null @@ -1,11 +0,0 @@ -styleoverrides: '/docs.css' -headline: Netlify builds, deploys, and hosts your front end. -bottomcta: - hook: Want to get started quick? - btns: - - type: primary - btntext: View our Templates - linksto: https://app.netlify.com/signup/templates - - type: secondary - btntext: Read our Tutorials - linksto: /tags/tutorial/ diff --git a/website/data/global.yaml b/website/data/global.yaml deleted file mode 100644 index feac28e4f064..000000000000 --- a/website/data/global.yaml +++ /dev/null @@ -1,4 +0,0 @@ -footer: - buttons: - - name: "GitHub" - url: "https://github.com/decaporg/decap-cms" diff --git a/website/data/landing.yaml b/website/data/landing.yaml deleted file mode 100644 index 035e72fc058f..000000000000 --- a/website/data/landing.yaml +++ /dev/null @@ -1,72 +0,0 @@ -hero: - headline: "Open source content management for your Git workflow" - subhead: "Use Decap CMS with any static site generator for a faster and more flexible web project" - devfeatures: - - feature: "Static + content management = ♥" - description: "Get the speed, security, and scalability of a static site, while still providing a convenient editing interface for content." - - feature: "An integrated part of your Git workflow" - description: "Content is stored in your Git repository alongside your code for easier versioning, multi-channel publishing, and the option to handle content updates directly in Git." - - feature: "An extensible CMS built on React" - description: "Decap CMS is built as a single-page React app. Create custom-styled previews, UI widgets, and editor plugins or add backends to support different Git platform APIs." -awards: - title: "Awards" - description: "Decap was recognized with these awards" - items: - - title: "Software Reviews Gold Medal 2023" - href: "https://www.softwarereviews.com/categories/content-marketing?entitlement=gold_medal_Decap_CMS_%28formerly_Netlify%29_data_quadrant_awards_2023_content_marketing&utm_medium=badge&utm_source=netlify" - image: "/img/sr-gold_medal-2023.png" -cta: - primaryhook: "Getting started is simple and free." - primary: "Choose a template that’s pre-configured with a static site generator and deploys to a global CDN in one click." - button: "[Get started](/docs/start-with-a-template/)" - -editors: - hook: "A CMS that developers and content editors can agree on" - intro: "You get to implement modern front end tools to deliver a faster, safer, and more scalable site. Editors get a friendly UI and intuitive workflow that meets their content management requirements." - features: - - feature: "Editor-friendly user interface" - description: "The web-based app includes rich-text editing, real-time preview, and drag-and-drop media uploads." - imgpath: "feature-editor.svg" - - feature: "Intuitive workflow for content teams" - description: "Writers and editors can easily manage content from draft to review to publish across any number of custom content types." - imgpath: "feature-workflow.svg" - - feature: "Instant access without GitHub account" - description: "With [Git Gateway](/docs/git-gateway-backend/#git-gateway-with-netlify-identity), you can add CMS access for any team member — even if they don’t have a GitHub account. " - imgpath: "feature-access.svg" - -services: - hook: "Do you need professional help?" - intro: "The team of maintainers offers a range of professional services to help you get the most out of Decap CMS." - features: - - feature: "Onboarding" - description: "Get up to speed quickly with a customized onboarding program tailored to your team and project." - cta: - href: "/services/" - label: "Find out more" - - feature: "Priority Support" - description: "Benefit from a dedicated support line and priority ticket handling." - cta: - href: "/services/" - label: "Find out more" - - feature: "Custom Features Development" - description: "Sponsor the development of custom features or integrations to meet your specific needs." - cta: - href: "/services/" - label: "Find out more" - - feature: "Building Websites with Decap CMS" - description: "See the list of trusted partners that build websites with Decap CMS." - cta: - href: "/services/" - label: "Find out more" - -community: - hook: "Supported by a growing community" - features: - - feature: "Built on the Jamstack" - description: "Decap CMS is based on client-side JavaScript, reusable APIs and prebuilt Markup. Compared to server-side CMS like WordPress, this means better performance, higher security, lower cost of scaling, and a better developer experience. You can learn more about the Jamstack on [jamstack.org](https://jamstack.org)." - - feature: "Support when you need it" - description: "Get up and running with comprehensive [documentation](/docs) and templates or work through difficult problems in our [community chat](https://decapcms.org/chat)." - - feature: "A community-driven project you can help evolve" - description: "Decap CMS is built by a community of more than 100 contributors — and you can help. Read the [contributing guide](/docs/contributor-guide) to join in." - contributors: "Made possible by awesome contributors" - diff --git a/website/data/notifications.yml b/website/data/notifications.yml deleted file mode 100644 index eb56d14b2a1b..000000000000 --- a/website/data/notifications.yml +++ /dev/null @@ -1,40 +0,0 @@ -notifications: - - loud: true - message: Register to join us online for our next community dev meeting, every - other Wednesday at 9am-10am PT! - published: false - title: Netlify CMS Development Planning Sessions Promo - url: https://www.eventbrite.com/e/netlify-cms-planning-session-bi-weekly-tickets-35794058994 - - loud: true - message: We have a community chat - join now to ask questions and discuss the - project with other devs! - published: false - title: Chat shoutout - url: https://decapcms.org/chat - - loud: true - message: Netlify CMS now supports GitLab! - published: false - title: GitLab announcement - url: /blog/2018/06/netlify-cms-now-supports-gitlab-as-a-backend/ - - loud: true - message: Announcing 2.0 - Bitbucket support and monorepo architecture! - published: false - title: 2.0 announcement - url: /blog/2018/07/netlify-cms-2-0-launches-with-bitbucket-support-and-a-new-monorepo-architecture - - loud: true - message: 2.1.0 release is out with external media library support! - published: false - title: 2.1.0 - external media libraries - url: /blog/2018/09/netlify-cms-2-1-0-adds-external-media-support-with-uploadcare - - loud: true - message: Learn more about the Jamstack at JAMstack Conf, San Francisco — 29-30 - October, 2018 - published: false - title: JAMStack_conf 2018 - url: https://jamstackconf.com/ - - loud: false - message: "Netlify stands in solidarity with the Black community. Make a - donation. Netlify will match it. #BlackLivesMatter" - published: false - title: Donate now - url: http://www.netlify.com/donation-matching/ diff --git a/website/data/updates.yml b/website/data/updates.yml deleted file mode 100644 index 7f51e3244af4..000000000000 --- a/website/data/updates.yml +++ /dev/null @@ -1,296 +0,0 @@ -updates: - - date: 2020-05-19T22:30:55.101Z - version: 2.10.49 - description: Improved search, relation widget for file collections, improvements - and bugfixes - - date: 2020-05-04T22:31:09.983Z - version: 2.10.48 - description: String template support in relation widget, more data access for - widget controls, bugfixes - - date: 2020-04-21T22:31:10.664Z - version: 2.10.47 - description: Improve caching, bugfix - - date: 2020-03-19T18:39:47.538Z - version: 2.10.33 - description: Bugfixes - - date: 2020-03-13T18:39:27.187Z - version: 2.10.32 - description: Add Catalan UI translation - - date: 2020-03-12T20:58:33.994Z - version: 2.10.31 - description: Lazy loading for large directories in GitHub, bugfixes - - date: 2020-03-03T21:00:34.318Z - version: 2.10.30 - description: Field defaults via query string, proxy backend as middleware, bugfixes - - date: 2020-02-27T21:00:33.890Z - version: 2.10.29 - description: Preserve non-configured fields, open authoring bugfixes - - date: 2020-02-25T22:11:47.613Z - description: Fix workflow PR label migrations - version: 2.10.28 - - date: 2020-02-25T22:12:09.753Z - description: GitHub backend improvements, reintroduce workflow PR labels, bugfixes - version: 2.10.27 - - date: 2020-02-22T05:00:00.000Z - description: Revert editorial workflow labels for GitHub - version: 2.10.26 - - date: 2020-02-05 - description: Local development support (beta), unpublish hook, bugfixes - version: 2.10.17 - - date: 2020-01-31 - description: prepublish/postpublish hooks, min/max select widget validation - version: 2.10.16 - - date: 2020-01-30 - description: bugfixes - version: 2.10.15 - - date: 2020-01-28 - description: bugfixes - version: 2.10.14 - - date: 2020-01-26 - description: fix multiple image field issue - version: 2.10.13 - - date: 2020-01-23 - description: fix Git Gateway/GitHub issues - version: 2.10.12 - - date: 2020-01-22 - description: fix image widget overflow - version: 2.10.11 - - date: 2020-01-22 - description: support dynamic (templated) media_folder/path_folder config - version: 2.10.10 - - date: 2020-01-21 - description: Git LFS support fixes, other backend fixes - version: 2.10.9 - - date: 2020-01-16 - description: Bugfixes - version: 2.10.8 - - date: 2020-01-15 - description: Bugfixes - version: 2.10.7 - - date: 2020-01-14 - description: Editorial workflow for GitLab and Bitbucket 🎉🎉 - version: 2.10.6 - - date: 2020-01-14 - description: Collection level media_folder, multiline shortcodes, max file size - validation - version: 2.10.5 - - date: 2020-01-09 - description: Bugfixes - version: 2.10.4 - - date: 2020-01-07 - description: Bundle assets with content, bugfixes - version: 2.10.3 - - date: 2019-12-20 - description: Fix incomplete previous release - version: 2.10.2 - - date: 2019-12-19 - description: Fix select and relation widgets not showing dropdown - version: 2.10.1 - - date: 2019-12-18 - description: Open Authoring, content bundles, code editor, and lots of bugfixes - version: 2.10.0 - - date: 2019-07-24 - description: Fix collection view search - version: 2.9.7 - - date: 2019-07-11 - description: Fix default values in list widgets - version: 2.9.6 - - date: 2019-06-28 - description: Fix entry loading for GitLab - version: 2.9.5 - - date: 2019-06-26 - description: Reference nested fields in relation widget, validate simple lists, bugfixes - version: 2.9.4 - - date: 2019-06-18 - description: Fix new entries error for non-GitHub backends - version: 2.9.3 - - date: 2019-06-14 - description: Match any char with shortcode/editor component patterns, bugfixes - version: 2.9.2 - - date: 2019-04-10 - description: Entry card customization, Bitbucket implicit auth, fix image - previews, other bugfixes - version: 2.9.1 - - date: 2019-03-29 - description: Add netlify-cms-app package with external deps, fix breaking - preview templates - version: 2.9.0 - - date: 2019-03-22 - description: Add es module builds, fix large media binary output - version: 2.8.0 - - date: 2019-03-21 - description: Standalone UMD builds with externalized dependencies for all - extension packages - version: 2.7.0 - - date: 2019-03-11 - description: Fix Cloudinary multiselect, preview pane and config fixes, other - improvements - version: 2.6.1 - - date: 2019-03-07 - description: Add entry recovery after error, fix large media GitHub URL output, - other fixes - version: 2.6.0 - - date: 2019-02-28 - description: Fix previews of GitHub images - version: 2.5.1 - - date: 2019-02-26 - description: Netlify Large Media support, multi-select relation widget, and more - version: 2.5.0 - - date: 2019-02-12 - description: Fix empty number widget values, accept explicit fields in slug template - version: 2.4.2 - - date: 2019-02-09T00:08:11.159Z - description: Bugfixes - version: 2.4.1 - - date: 2019-02-08T22:27:39.913Z - description: Deploy preview links, map widget, and nested field validation - version: 2.4.0 - url: https://www.decapcms.org/blog/2019/02/netlify-cms-2-4-0 - - date: 2019-01-10 - description: Fix missing entry labels for file collections - version: 2.3.3 - - date: 2018-12-26 - description: Bugfixes, list widget variable types in beta - version: 2.3.2 - - date: 2018-12-11 - description: Bugfixes - version: 2.3.1 - - date: 2018-12-04 - description: Cloudinary support, multi-select in select widget - version: 2.3.0 - - date: 2018-11-29 - description: Date display formatting, lots of bugfixes - version: 2.2.1 - - date: 2018-11-12 - description: Custom identifier fields, custom logo on auth page, bugfixes - version: 2.2.0 - - date: 2018-10-09T13:57:04.203Z - description: Bugfixes - version: 2.1.3 - - date: 2018-09-17T16:49:32.506Z - description: Fix editorial workflow for Git Gateway - version: 2.1.2 - - date: 2018-09-06T16:48:08.594Z - description: Provide empty cms.css file to ease 2.x migration - version: 2.1.1 - - date: 2018-09-06T18:48:13.703Z - description: External media library support 🎉🎉 - version: 2.1.0 - - date: 2018-08-27 - description: Fix sortable list bugs in the editor - version: 2.0.11 - - date: 2018-08-24 - description: Editor hints, GitLab images and Markdown editor fixes, plus other bugs - version: 2.0.10 - - date: 2018-08-07 - description: Backend, workflow, and relation widget fixes/improvements - version: 2.0.9 - - date: 2018-08-01 - description: Fix workflow publishing - version: 2.0.8 - - date: 2018-08-01 - description: Fix uploads in backends, fix workflow, other bugfixes - version: 2.0.7 - - date: 2018-07-28 - description: Fix backends - version: 2.0.6 - - date: 2018-07-27 - description: Fix Git Gateway, other bugfixes - version: 2.0.5 - - date: 2018-07-26 - description: Bitbucket support! - version: 2.0.0 - - date: 2018-07-21 - description: Fix multipart extension support for GitLab - version: 1.9.4 - - date: 2018-07-03 - description: Fix numbers in TOML output. - version: 1.9.3 - - date: 2018-06-15 - description: Fix test-repo crash. - version: 1.9.2 - - date: 2018-06-14 - description: Fix GitLab Implicit OAuth - version: 1.9.1 - - date: 2018-06-12 - description: GitLab support is here!!! 🎉🎉🎉 - version: 1.9.0 - - date: 2018-05-25 - description: Fix markdown widget styling. - version: 1.8.4 - - date: 2018-05-25 - description: Dependency updates. - version: 1.8.3 - - date: 2018-05-24 - description: Fix failure to save/publish. - version: 1.8.2 - - date: 2018-05-23 - description: Allow upload of files larger than 1MB to GitHub, prevent - unintentional file overwrites. - version: 1.8.1 - - date: 2018-05-16 - description: Customizable relation widget display fields, squash merges for - editorial workflow, perf improvements. - version: 1.8.0 - - date: 2018-04-24 - description: Allow custom auth endpoint, bug fixes. - version: 1.7.0 - - date: 2018-04-19 - description: " Markdown toolbar customization, manual date widget entry, bug fixes." - version: 1.6.0 - - date: 2018-04-11 - description: New time based slug placeholders, set config.yml URL with <link>. - version: 1.5.0 - - date: 2018-03-29 - description: More control over filenames, lots of bugfixes, and new beta features! - version: 1.4.0 - - date: 2018-03-06 - description: Fixes styling issues - version: 1.3.5 - - date: 2018-03-06 - description: Fixes editorial workflow entry failure. - version: 1.3.4 - - date: 2018-03-06 - description: Fixes load failure - version: 1.3.3 - - date: 2018-03-06 - description: Fixes date widget default format, collection load failure when entry fails. - version: 1.3.2 - - date: 2018-03-03 - description: Fixes editorial workflow failure for unknown collections. - version: 1.3.1 - - date: 2018-02-27 - description: Multi-part extensions, e.g. "en.md", a11y improvements in the - editor, and bugfixes. - version: 1.3.0 - - date: 2018-02-21 - description: Fixes ES5 transpiling. - version: 1.2.2 - - date: 2018-02-21 - description: Allows label_singular config for collections and lists and distinct - frontmatter delimiters. - version: 1.2.1 - - date: 2018-02-13 - description: Adds support for multiple frontmatter formats and custom - delimiters, UI improvements. - version: "1.2" - - date: 2018-01-25 - description: You can now register external backends and we improved metadata handling. - version: "1.1" - - date: 2018-01-23 - description: Fixes various UI bugs and adds expand / collapse functionality to - the object widget. - version: 1.0.4 - - date: 2018-12-19 - description: Small bug fix release. - version: 1.0.3 - - date: 2018-12-07 - description: Small bug fix release. - version: 1.0.2 - - date: 2018-12-07 - description: Small bug fix release. - version: 1.0.1 - - date: 2018-12-07 - description: The first major release of Netlify CMS with an all-new UI, revamped - documentation and much more. - version: 1.0.0 diff --git a/website/gatsby-browser.js b/website/gatsby-browser.js deleted file mode 100644 index 54c19635aa8b..000000000000 --- a/website/gatsby-browser.js +++ /dev/null @@ -1,9 +0,0 @@ -// Make scroll behavior of internal links smooth -exports.onClientEntry = () => { - const SmoothScroll = require('smooth-scroll'); - new SmoothScroll('a[href*="#"]', { - offset() { - return document.querySelector('#header').offsetHeight; - }, - }); -}; diff --git a/website/gatsby-config.js b/website/gatsby-config.js deleted file mode 100644 index c4a9603a17d4..000000000000 --- a/website/gatsby-config.js +++ /dev/null @@ -1,82 +0,0 @@ -const fs = require('fs'); -const yaml = require('js-yaml'); - -const pkg = require('./package.json'); - -const staticConfig = yaml.load(fs.readFileSync('./site.yml', 'utf8')); - -module.exports = { - siteMetadata: { - title: 'Decap CMS | Open-Source Content Management System', - description: 'Open source content management for your Git workflow', - siteUrl: pkg.homepage, - menu: staticConfig.menu, - }, - plugins: [ - { - resolve: 'gatsby-plugin-google-tagmanager', - options: { - id: 'GTM-WQFP7W4H', - }, - }, - { - resolve: 'gatsby-plugin-manifest', - options: { - name: 'Decap CMS', - short_name: 'Decap CMS', - start_url: '/', - background_color: '#ffffff', - theme_color: '#ffffff', - display: 'standalone', - icon: 'static/img/favicon/icon-512x512.png', - }, - }, - { - resolve: 'gatsby-source-filesystem', - options: { - path: `${__dirname}/content`, - name: 'content', - }, - }, - { - resolve: 'gatsby-source-filesystem', - options: { - path: `${__dirname}/data`, - name: 'data', - }, - }, - { - resolve: 'gatsby-transformer-remark', - options: { - // prettier-ignore - plugins: [ - 'gatsby-remark-autolink-headers', - { - resolve: "gatsby-remark-external-links", - options: { - target: "_blank", - rel: "noopener noreferrer" - } - }, - { - resolve: 'gatsby-remark-prismjs', - options: { - noInlineHighlight: true, - }, - }, - ], - }, - }, - { - resolve: 'gatsby-plugin-decap-cms', - options: { - modulePath: `${__dirname}/src/cms/cms.js`, - }, - }, - 'gatsby-transformer-yaml', - 'gatsby-transformer-json', - 'gatsby-plugin-emotion', - 'gatsby-plugin-react-helmet', - 'gatsby-plugin-catch-links', - ], -}; diff --git a/website/gatsby-node.js b/website/gatsby-node.js deleted file mode 100644 index 02e199773d24..000000000000 --- a/website/gatsby-node.js +++ /dev/null @@ -1,113 +0,0 @@ -const path = require('path'); -const { createFilePath } = require('gatsby-source-filesystem'); - -exports.createPages = async ({ graphql, actions }) => { - const { createPage } = actions; - - const docPage = path.resolve('./src/templates/doc-page.js'); - const blogPost = path.resolve('./src/templates/blog-post.js'); - - // get all markdown with a frontmatter path field and title - const allMarkdown = await graphql(` - { - allMarkdownRemark(filter: { frontmatter: { title: { ne: null } } }) { - edges { - node { - fields { - slug - } - frontmatter { - title - } - } - } - } - } - `); - - if (allMarkdown.errors) { - console.error(allMarkdown.errors); // eslint-disable-line no-console - throw Error(allMarkdown.errors); - } - - allMarkdown.data.allMarkdownRemark.edges.forEach(({ node }) => { - const { slug } = node.fields; - - let template = docPage; - - if (slug.includes('blog/')) { - template = blogPost; - } - - createPage({ - path: slug, - component: template, - context: { - slug, - }, - }); - }); - - // redirects from older URLs - const { createRedirect } = actions - - createRedirect({ - fromPath: `/docs/add-to-your-site/`, - toPath: `/docs/basic-steps/`, - }) - -}; - -function pad(n) { - return n >= 10 ? n : `0${n}`; -} - -exports.onCreateNode = ({ node, actions, getNode }) => { - const { createNodeField } = actions; - - if (node.internal.type === 'MarkdownRemark') { - const value = createFilePath({ node, getNode }); - const { relativePath } = getNode(node.parent); - - let slug = value; - - if (relativePath.includes('blog/')) { - const date = new Date(node.frontmatter.date); - const year = date.getFullYear(); - const month = date.getMonth() + 1; - const filename = path.basename(relativePath, '.md'); - slug = `/blog/${year}/${pad(month)}/${filename}`; - - createNodeField({ - node, - name: 'date', - value: date.toJSON(), - }); - } - - // used for doc posts - createNodeField({ - node, - name: 'slug', - value: slug, - }); - - // used to create GitHub edit link - createNodeField({ - node, - name: 'path', - value: relativePath, - }); - } -}; - -exports.onCreateWebpackConfig = ({ actions }) => { - actions.setWebpackConfig({ - resolve: { - extensions: ['.ts', '.tsx', '.js', '.json'], - alias: { - moment$: 'moment/moment.js', - }, - }, - }); -}; diff --git a/website/netlify.toml b/website/netlify.toml deleted file mode 100644 index 7c0c6ebad78c..000000000000 --- a/website/netlify.toml +++ /dev/null @@ -1,8 +0,0 @@ -[build] - base = "website/" - command = "yarn install && yarn lint && yarn build" - publish = "dist/" - - [build.environment] - YARN_FLAGS = "--frozen-lockfile" - YARN_VERSION = "1.22.4" diff --git a/website/package.json b/website/package.json deleted file mode 100644 index f70d62f2a9b4..000000000000 --- a/website/package.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "name": "decap-cms-site", - "version": "1.0.0", - "description": "Decap CMS documentation website built with Gatsby", - "scripts": { - "start": "gatsby develop", - "build": "gatsby build && rm -rf dist && mv public dist", - "lint": "markdownlint 'content/docs/**/*.md'", - "copy:contribs": "cp ../.all-contributorsrc data/contributors.json", - "prepare": "npm run copy:contribs", - "reset": "rm -rf .cache" - }, - "author": "", - "homepage": "https://www.decapcms.org/", - "license": "MIT", - "dependencies": { - "@emotion/cache": "^11.11.0", - "@emotion/core": "^11.0.0", - "@emotion/styled": "^11.11.0", - "dayjs": "^1.11.10", - "decap-cms-app": "^3.0.0", - "emotion-theming": "^11.0.0", - "gatsby": "5.13.0", - "gatsby-plugin-catch-links": "5.13.0", - "gatsby-plugin-decap-cms": "^4.0.3", - "gatsby-plugin-emotion": "^8.13.0", - "gatsby-plugin-google-tagmanager": "^5.13.0", - "gatsby-plugin-manifest": "5.13.0", - "gatsby-plugin-react-helmet": "6.13.0", - "gatsby-remark-autolink-headers": "6.13.0", - "gatsby-remark-external-links": "^0.0.4", - "gatsby-remark-prismjs": "7.13.0", - "gatsby-source-filesystem": "^5.13.0", - "gatsby-transformer-json": "5.13.0", - "gatsby-transformer-remark": "6.13.0", - "gatsby-transformer-yaml": "5.13.0", - "js-yaml": "^4.1.0", - "lodash": "^4.17.21", - "moment": "^2.29.4", - "prismjs": "^1.29.0", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "react-github-btn": "^1.4.0", - "react-helmet": "^6.1.0", - "react-markdown": "^8.0.7", - "smooth-scroll": "^16.1.3" - }, - "devDependencies": { - "@emotion/eslint-plugin": "^11.11.0", - "babel-plugin-prismjs": "^2.1.0", - "babel-preset-gatsby": "^3.13.0", - "eslint": "^8.56.0", - "eslint-plugin-import": "^2.29.1", - "markdownlint-cli": "^0.38.0" - }, - "private": true -} diff --git a/website/site.yml b/website/site.yml deleted file mode 100644 index f2be79eead7b..000000000000 --- a/website/site.yml +++ /dev/null @@ -1,24 +0,0 @@ -menu: - docs: - - name: Intro - title: Intro to Decap CMS - - name: Add - title: Add To Your Site - - name: Accounts - title: Account Settings - - name: Configuration - title: Configuring your Site - - name: Media - title: Media - - name: Workflow - title: Workflow - - name: Collections - title: Collections - - name: Fields - title: Fields - - name: Guides - title: Platform Guides - - name: Customization - title: Customizing Decap CMS - - name: Contributing - title: Community diff --git a/website/src/cms/cms.js b/website/src/cms/cms.js deleted file mode 100644 index 2e7de54836cc..000000000000 --- a/website/src/cms/cms.js +++ /dev/null @@ -1,140 +0,0 @@ -import React from 'react'; -import CMS from 'decap-cms-app'; -import dayjs from 'dayjs'; -import Prism from 'prismjs'; -import { CacheProvider } from '@emotion/react'; -import createCache from '@emotion/cache'; - -import BlogPostTemplate from '../components/blog-post-template'; -import { LayoutTemplate as Layout } from '../components/layout'; -import DocsTemplate from '../components/docs-template'; -import WidgetDoc from '../components/widget-doc'; -import WhatsNew from '../components/whats-new'; -import Notification from '../components/notification'; -import Community from '../components/community'; -import siteConfig from '../../site.yml'; - -let emotionCache; -function getEmotionCache() { - const previewPaneIframe = document.querySelector('iframe[class*="PreviewPaneFrame"]'); - const previewPaneHeadEl = previewPaneIframe.contentWindow.document.querySelector('head'); - if (!emotionCache || emotionCache.sheet.container !== previewPaneHeadEl) { - emotionCache = createCache({ container: previewPaneHeadEl }); - } - return emotionCache; -} - -function PreviewContainer({ children, highlight }) { - return ( - - {highlight ? {children} : children} - - ); -} - -class Highlight extends React.Component { - constructor(props) { - super(props); - this.ref = React.createRef(); - } - - highlight() { - setTimeout(() => { - if (this.ref.current) { - Prism.highlightAllUnder(this.ref.current); - } - }); - } - - componentDidMount() { - this.highlight(); - } - - componentDidUpdate() { - this.highlight(); - } - - render() { - return
{this.props.children}
; - } -} - -function BlogPostPreview({ entry, widgetFor }) { - const data = entry.get('data'); - return ( - - - - ); -} - -function CommunityPreview({ entry }) { - const { title, headline, subhead, sections } = entry.get('data').toJS(); - return ( - - - - ); -} - -function DocsPreview({ entry, widgetFor }) { - return ( - - - - ); -} - -function WidgetDocPreview({ entry, widgetFor }) { - return ( - - - - ); -} - -function ReleasePreview({ entry }) { - return ( - - ({ - version: release.get('version'), - date: dayjs(release.get('date')).format('MMMM D, YYYY'), - description: release.get('description'), - })) - .toJS()} - /> - - ); -} - -function NotificationPreview({ entry }) { - return ( - - {entry - .getIn(['data', 'notifications']) - .filter(notif => notif.get('published')) - .map((notif, idx) => ( - - {notif.get('message')} - - ))} - - ); -} - -CMS.registerPreviewTemplate('blog', BlogPostPreview); -siteConfig.menu.docs.forEach(group => { - CMS.registerPreviewTemplate(`docs_${group.name}`, DocsPreview); -}); -CMS.registerPreviewTemplate('widget_docs', WidgetDocPreview); -CMS.registerPreviewTemplate('releases', ReleasePreview); -CMS.registerPreviewTemplate('notifications', NotificationPreview); -CMS.registerPreviewTemplate('community', CommunityPreview); diff --git a/website/src/components/awards.js b/website/src/components/awards.js deleted file mode 100644 index 3b07c51f4b9d..000000000000 --- a/website/src/components/awards.js +++ /dev/null @@ -1,22 +0,0 @@ -import React from 'react'; -import styled from '@emotion/styled'; - -const AwardLink = styled.a` - display: block; - text-align: center; - - img { - width: 60vw; - max-width: 280px; - } -`; - -function Awards({ items }) { - return items.map((item, key) => ( - - {item.title} - - )); -} - -export default Awards; diff --git a/website/src/components/blog-post-template.js b/website/src/components/blog-post-template.js deleted file mode 100644 index 6d55ee0946e3..000000000000 --- a/website/src/components/blog-post-template.js +++ /dev/null @@ -1,27 +0,0 @@ -/** @jsx jsx */ -import { jsx, css } from '@emotion/react'; - -import Container from './container'; -import Markdown from './markdown'; -import MetaInfo from './meta-info'; -import Page from './page'; - -export default function BlogPostTemplate({ title, author, date, body, html }) { - return ( - - -

- {title} -

- - by {author} on {date} - - -
-
- ); -} diff --git a/website/src/components/button.js b/website/src/components/button.js deleted file mode 100644 index c4c78be09a25..000000000000 --- a/website/src/components/button.js +++ /dev/null @@ -1,44 +0,0 @@ -import { css } from '@emotion/react'; -import styled from '@emotion/styled'; - -import theme from '../theme'; - -// prettier-ignore -const Button = styled.button` - display: inline-block; - background: ${theme.colors.primaryDark}; - color: white; - border-radius: ${theme.radii[1]}; - font-size: ${theme.fontsize[3]}; - font-weight: 700; - padding: ${theme.space[2]} ${theme.space[3]}; - border: 2px solid ${theme.colors.primaryDark}; - cursor: pointer; - transition: all 0.2s ease-out; - box-shadow: 0; - - &:hover { - box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.5); - } - - &:active { - box-shadow: inset 0 0 4px 0 rgba(0, 0, 0, 0.5); - } - - ${p => p.block && css` - display: block; - width: 100%; - `}; - - ${p => p.outline && css` - background: none; - color: ${theme.colors.primaryDark}; - font-weight: 500; - `}; - - ${p => p.active && css` - box-shadow: inset 0 0 4px 0 rgba(0, 0, 0, 0.5); - `}; -`; - -export default Button; diff --git a/website/src/components/chat-button.js b/website/src/components/chat-button.js deleted file mode 100644 index 43bd07bdb463..000000000000 --- a/website/src/components/chat-button.js +++ /dev/null @@ -1,41 +0,0 @@ -import React from 'react'; -import styled from '@emotion/styled'; - -import { mq } from '../utils'; -import theme from '../theme'; - -const ChatLink = styled.a` - z-index: 100; - position: fixed; - bottom: 10px; - right: 10px; - cursor: pointer; - padding: 10px 15px; - border-radius: 10px; - border: 1px solid ${theme.colors.darkerGray}; - color: ${theme.colors.darkerGray}; - background-color: ${theme.colors.white}; - font-size: 14px; - text-align: right; - display: none; - transition: all 0.2s ease-out; - box-shadow: 0; - - &:hover { - box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.5); - } - ${mq[1]} { - display: block; - } -`; - -function ChatButton() { - return ( - -

Join us on

- Discord -
- ); -} - -export default ChatButton; diff --git a/website/src/components/community-channels-list.js b/website/src/components/community-channels-list.js deleted file mode 100644 index 286f7b6d48ca..000000000000 --- a/website/src/components/community-channels-list.js +++ /dev/null @@ -1,59 +0,0 @@ -import React from 'react'; -import styled from '@emotion/styled'; - -import theme from '../theme'; - -const StyledCommunityChannelsList = styled.ul` - margin-left: 0; - - li { - list-style-type: none; - margin-bottom: 24px; - } - - a { - display: block; - font-weight: inherit; - position: relative; - - &:focus, - &:active, - &:hover { - &:before { - display: block; - } - } - - &:before { - display: none; - content: ''; - position: absolute; - width: 3px; - height: 100%; - background-color: ${theme.colors.primaryDark}; - left: -16px; - } - } - - p { - color: ${theme.colors.gray}; - margin-bottom: 0; - } -`; - -function CommunityChannelsList({ channels }) { - return ( - - {channels.map(({ title, description, url }, idx) => ( -
  • - - {title} -

    {description}

    -
    -
  • - ))} -
    - ); -} - -export default CommunityChannelsList; diff --git a/website/src/components/community.js b/website/src/components/community.js deleted file mode 100644 index 4b6917da2863..000000000000 --- a/website/src/components/community.js +++ /dev/null @@ -1,47 +0,0 @@ -/** @jsx jsx */ -import { jsx, css } from '@emotion/react'; -import React from 'react'; - -import Markdownify from './markdownify'; -import PageHero from './page-hero'; -import HeroTitle from './hero-title'; -import Lead from './lead'; -import Container from './container'; -import SectionLabel from './section-label'; -import Grid from './grid'; -import CommunityChannelsList from './community-channels-list'; -import theme from '../theme'; - -function Community({ headline, subhead, sections }) { - return ( - <> - - - - - - - - - - - -
    - {sections.map(({ title: sectionTitle, channels }, channelIdx) => ( - - {sectionTitle} - - - ))} -
    -
    -
    - - ); -} - -export default Community; diff --git a/website/src/components/container.js b/website/src/components/container.js deleted file mode 100644 index bd9c5f9f7266..000000000000 --- a/website/src/components/container.js +++ /dev/null @@ -1,32 +0,0 @@ -import styled from '@emotion/styled'; -import { css } from '@emotion/react'; - -import { mq } from '../utils'; -import theme from '../theme'; - -const Container = styled.div` - margin-left: auto; - margin-right: auto; - max-width: 1280px; - padding-left: ${theme.space[4]}; - padding-right: ${theme.space[4]}; - - ${p => - p.size === 'sm' && - css` - max-width: 800px; - `}; - - ${p => - p.size === 'md' && - css` - max-width: 1024px; - `}; - - ${mq[3]} { - padding-left: ${theme.space[5]}; - padding-right: ${theme.space[5]}; - } -`; - -export default Container; diff --git a/website/src/components/docs-nav.js b/website/src/components/docs-nav.js deleted file mode 100644 index ec5d6d267f82..000000000000 --- a/website/src/components/docs-nav.js +++ /dev/null @@ -1,101 +0,0 @@ -import React, { useState } from 'react'; -import { Link } from 'gatsby'; -import styled from '@emotion/styled'; - -import Button from './button'; -import TableOfContents from './table-of-contents'; -import { mq } from '../utils'; -import theme from '../theme'; - -const Menu = styled.nav` - margin-bottom: ${theme.space[5]}; -`; - -const MenuBtn = styled(Button)` - ${mq[1]} { - display: none; - } -`; - -const MenuContent = styled.div` - display: ${p => (p.isOpen ? 'block' : 'none')}; - background: white; - padding: ${theme.space[3]}; - - ${mq[1]} { - display: block; - background: transparent; - padding: 0; - } -`; - -const MenuSection = styled.div` - margin-bottom: ${theme.space[3]}; -`; - -const SectionTitle = styled.h3` - font-size: ${theme.fontsize[4]}; - margin-bottom: ${theme.space[2]}; -`; - -const SectionList = styled.ul``; - -const MenuItem = styled.li``; - -const NavLink = styled(Link)` - display: block; - /* font-weight: $regular; */ - font-size: ${theme.fontsize[3]}; - color: ${theme.colors.gray}; - line-height: ${theme.lineHeight[1]}; - text-transform: capitalize; - transition: color 0.2s ease; - padding: ${theme.space[2]} 0; - - &.active { - color: ${theme.colors.primaryDark}; - font-weight: bold; - } - - &:hover { - color: ${theme.colors.primaryDark}; - } -`; - -function DocsNav({ items, location }) { - const [isMenuOpen, setMenuOpen] = useState(false); - - function toggleMenu() { - setMenuOpen(isOpen => !isOpen); - } - - return ( - - - {isMenuOpen ? × : } {isMenuOpen ? 'Hide' : 'Show'}{' '} - Navigation - - - {items.map(item => ( - - {item.title} - - {item.group.edges.map(({ node }) => ( - - - {node.frontmatter.title} - - {location.pathname === node.fields.slug && } - - ))} - - - ))} - - - ); -} - -export default DocsNav; - -export { NavLink }; diff --git a/website/src/components/docs-template.js b/website/src/components/docs-template.js deleted file mode 100644 index c8d972e455da..000000000000 --- a/website/src/components/docs-template.js +++ /dev/null @@ -1,42 +0,0 @@ -import React from 'react'; - -import Container from './container'; -import SidebarLayout from './sidebar-layout'; -import EditLink from './edit-link'; -import Widgets from './widgets'; -import Markdown from './markdown'; -import DocsNav from './docs-nav'; - -function DocsSidebar({ docsNav, location }) { - return ( - - ); -} - -export default function DocsTemplate({ - title, - filename, - body, - html, - showWidgets, - widgets, - showSidebar, - docsNav, - location, - group, -}) { - return ( - - }> -
    - {filename && } -

    {title}

    - - {showWidgets && } -
    -
    -
    - ); -} diff --git a/website/src/components/docsearch.js b/website/src/components/docsearch.js deleted file mode 100644 index cbdb5e2f1523..000000000000 --- a/website/src/components/docsearch.js +++ /dev/null @@ -1,57 +0,0 @@ -import React, { useState, useEffect, memo } from 'react'; -import styled from '@emotion/styled'; - -import theme from '../theme'; -import searchIcon from '../img/search.svg'; - -const SearchForm = styled.form` - > span { - width: 100%; - } -`; - -const SearchField = styled.input` - color: white; - font-size: ${theme.fontsize[3]}; - border-radius: ${theme.radii[1]}; - background-color: ${theme.colors.lightGray}; - color: ${theme.colors.darkerGray}; - background-image: url(${searchIcon}); - background-repeat: no-repeat; - background-position: ${theme.space[2]} 50%; - border: 0; - appearance: none; - width: 100%; - padding: ${theme.space[2]}; - padding-left: 30px; - outline: 0; -`; - -function DocSearch() { - const [enabled, setEnabled] = useState(true); - - useEffect(() => { - if (window.docsearch) { - window.docsearch({ - apiKey: '08d03dc80862e84c70c5a1e769b13019', - indexName: 'netlifycms', - inputSelector: '#algolia-search', - debug: false, // Set debug to true if you want to inspect the dropdown - }); - } else { - setEnabled(false); - } - }, []); - - if (!enabled) { - return null; - } - - return ( - - - - ); -} - -export default memo(DocSearch); diff --git a/website/src/components/edit-link.js b/website/src/components/edit-link.js deleted file mode 100644 index e084a361c0ec..000000000000 --- a/website/src/components/edit-link.js +++ /dev/null @@ -1,46 +0,0 @@ -/** @jsx jsx */ -import { jsx, css } from '@emotion/react'; - -function EditLink({ collection, filename }) { - return ( - - ); -} - -export default EditLink; diff --git a/website/src/components/event-box.js b/website/src/components/event-box.js deleted file mode 100644 index f5d5e4efc28a..000000000000 --- a/website/src/components/event-box.js +++ /dev/null @@ -1,125 +0,0 @@ -import React, { useState, useEffect } from 'react'; -import moment from 'moment'; -import styled from '@emotion/styled'; - -import Markdownify from './markdownify'; -import theme from '../theme'; - -const Root = styled.div` - text-align: center; - background: ${theme.colors.darkerGray}; - background-image: linear-gradient( - -17deg, - ${theme.colors.darkerGray} 17%, - ${theme.colors.darkGray} 94% - ); - border-radius: 8px; - box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); - padding: 24px; - padding-top: 40px; - max-width: 446px; -`; - -const Title = styled.h2` - font-size: 36px; - color: white; -`; - -const Cal = styled.div` - border-radius: 8px; - overflow: hidden; - box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5); - margin: 24px auto; - max-width: 250px; -`; - -const Month = styled.div` - background: ${theme.colors.primaryDark}; - color: ${theme.colors.gray}; - font-weight: bold; - text-transform: uppercase; - letter-spacing: 4px; - font-size: 14px; - padding: 8px; -`; - -const Day = styled.div` - font-size: 104px; - line-height: 1.3; - font-weight: bold; - color: white; - border: 1px solid ${theme.colors.gray}; - border-top: none; - border-bottom-left-radius: 8px; - border-bottom-right-radius: 8px; -`; - -const CalDates = styled.p` - color: white; - font-weight: bold; - font-size: ${theme.fontsize[4]}; - margin-bottom: ${theme.space[3]}; -`; - -const CalCta = styled.div``; - -function EventBox({ title, cta }) { - const [loading, setLoading] = useState(true); - const [eventDate, setEventDate] = useState(''); - - useEffect(() => { - const eventbriteToken = 'C5PX65CJBVIXWWLNFKLO'; - const eventbriteOrganiser = '14281996019'; - - const url = `https://www.eventbriteapi.com/v3/events/search/?token=${eventbriteToken}&organizer.id=${eventbriteOrganiser}&expand=venue%27`; - - fetch(url) - .then(res => res.json()) - .then(data => { - const eventDate = data.events[0].start.utc; - - setEventDate(eventDate); - setLoading(false); - }) - .catch(err => { - console.log(err); // eslint-disable-line no-console - // TODO: set state to show error message - - setLoading(false); - }); - }, []); - - const eventDateMoment = moment(eventDate); - - const offset = eventDateMoment.isDST() ? -7 : -8; - const month = eventDateMoment.format('MMMM'); - const day = eventDateMoment.format('DD'); - const datePrefix = eventDateMoment.format('dddd, MMMM Do'); - const dateSuffix = eventDateMoment.utcOffset(offset).format('h a'); - - const ellip = ; - - return ( - - {title} - - {loading ? 'loading' : month} - {loading ? ellip : day} - - - {loading ? ( - ellip - ) : ( - - {datePrefix} at {dateSuffix} PT - - )} - - - - - - ); -} - -export default EventBox; diff --git a/website/src/components/features.js b/website/src/components/features.js deleted file mode 100644 index 8a6191bf759c..000000000000 --- a/website/src/components/features.js +++ /dev/null @@ -1,53 +0,0 @@ -import React from 'react'; -import styled from '@emotion/styled'; -import { Link } from 'gatsby'; - -import Markdownify from './markdownify'; -import theme from '../theme'; - -const Box = styled.div` - margin-bottom: ${theme.space[5]}; - - img { - margin-bottom: ${theme.space[3]}; - margin-left: -${theme.space[2]}; - } -`; - -const Title = styled.h3` - color: ${p => (p.kind === 'light' ? theme.colors.primaryLight : theme.colors.primaryLight)}; - font-size: ${theme.fontsize[4]}; -`; - -const Text = styled.p` - font-size: 18px; - a { - font-weight: 700; - } -`; - -function FeatureItem({ feature, description, imgpath, kind, cta }) { - return ( - - {imgpath && } - - <Markdownify source={feature} /> - - - -
    - {cta && ( - - {cta.label} - - )} -
    -
    - ); -} - -function Features({ items, kind }) { - return items.map(item => ); -} - -export default Features; diff --git a/website/src/components/footer.js b/website/src/components/footer.js deleted file mode 100644 index af2546e15dd5..000000000000 --- a/website/src/components/footer.js +++ /dev/null @@ -1,101 +0,0 @@ -import React from 'react'; -import styled from '@emotion/styled'; - -import Container from './container'; -import theme from '../theme'; -import { mq } from '../utils'; - -const Root = styled.footer` - background: white; - padding-top: ${theme.space[4]}; - padding-bottom: ${theme.space[5]}; -`; - -const FooterGrid = styled.div` - text-align: center; - - ${mq[2]} { - display: flex; - align-items: center; - text-align: left; - } -`; - -const FooterButtons = styled.div` - margin-bottom: ${theme.space[3]}; - ${mq[2]} { - margin-bottom: 0; - } -`; - -const SocialButton = styled.a` - display: inline-block; - padding: ${theme.space[1]} ${theme.space[3]}; - background-color: ${theme.colors.lightishGray}; - color: white; - font-weight: 700; - font-size: ${theme.fontsize[2]}; - border-radius: ${theme.radii[1]}; - margin-right: ${theme.space[2]}; - - &:active, - &:hover { - background-color: ${theme.colors.primaryDark}; - } -`; - -const Info = styled.div` - font-size: ${theme.fontsize[1]}; - color: ${theme.colors.gray}; - opacity: 0.5; - - ${mq[2]} { - padding-left: ${theme.space[4]}; - } - - a { - font-weight: 700; - color: ${theme.colors.gray}; - } -`; - -function Footer({ buttons }) { - return ( - - - - - {buttons.map(btn => ( - - {btn.name} - - ))} - - -

    - - Distributed under MIT License - {' '} - ·{' '} - - Maintained by PM - {' '} - ·{' '} - - Code of Conduct - -

    -
    -
    -
    -
    - ); -} - -export default Footer; diff --git a/website/src/components/github-button.js b/website/src/components/github-button.js deleted file mode 100644 index f8863f610caf..000000000000 --- a/website/src/components/github-button.js +++ /dev/null @@ -1,32 +0,0 @@ -import React, { PureComponent } from 'react'; - -class GitHubStarButton extends PureComponent { - async componentDidMount() { - const gitHubButtonModule = await import('github-buttons/dist/react'); - - this.GitHubButton = gitHubButtonModule.default; - - this.forceUpdate(); - } - - render() { - const GitHubButton = this.GitHubButton; - - if (!GitHubButton) { - return null; - } - - return ( - - Star - - ); - } -} - -export default GitHubStarButton; diff --git a/website/src/components/grid.js b/website/src/components/grid.js deleted file mode 100644 index 6ae93e0e03b8..000000000000 --- a/website/src/components/grid.js +++ /dev/null @@ -1,14 +0,0 @@ -import styled from '@emotion/styled'; - -import { mq } from '../utils'; -import theme from '../theme'; - -const Grid = styled.div` - ${mq[2]} { - display: grid; - grid-template-columns: repeat(${p => p.cols}, 1fr); - grid-gap: ${theme.space[7]}; - } -`; - -export default Grid; diff --git a/website/src/components/header.js b/website/src/components/header.js deleted file mode 100644 index 116de9c6ae9a..000000000000 --- a/website/src/components/header.js +++ /dev/null @@ -1,270 +0,0 @@ -/** @jsx jsx */ -import { jsx, css } from '@emotion/react'; -import { useState, useEffect } from 'react'; -import { Link, graphql, StaticQuery } from 'gatsby'; -import styled from '@emotion/styled'; -import GitHubButton from 'react-github-btn'; - -import Container from './container'; -import Notifications from './notifications'; -import DocSearch from './docsearch'; -import searchIcon from '../img/search.svg'; -import theme from '../theme'; -import { mq } from '../utils'; - -const StyledHeader = styled.header` - background: ${theme.colors.white}; - padding-top: ${theme.space[3]}; - padding-bottom: ${theme.space[3]}; - transition: background 0.2s ease, padding 0.2s ease, box-shadow 0.2s ease; - - ${mq[2]} { - position: sticky; - top: 0; - width: 100%; - z-index: ${theme.zIndexes.header}; - - ${p => - !p.collapsed && - css` - padding-top: ${theme.space[5]}; - padding-bottom: ${theme.space[5]}; - `}; - - ${p => - p.hasNotifications && - css` - padding-top: 0; - `}; - } -`; - -const HeaderContainer = styled(Container)` - display: flex; - align-items: center; - flex-wrap: wrap; -`; - -const Logo = styled.div` - ${mq[1]} { - margin-right: ${theme.space[5]}; - } - - img { - height: clamp(32px, 3vw, 60px); - width: auto; - } -`; - -const MenuActions = styled.div` - flex: 1 0 60px; - display: flex; - justify-content: flex-end; - ${mq[1]} { - display: none; - } -`; - -const MenuBtn = styled.button` - background: none; - border: 0; - padding: ${theme.space[2]}; - font-size: ${theme.fontsize[6]}; - line-height: 1; -`; - -const SearchBtn = styled(MenuBtn)``; - -const ToggleArea = styled.div` - display: ${p => (p.open ? 'block' : 'none')}; - flex: 1 0 100px; - width: 100%; - margin-top: ${theme.space[3]}; - - ${mq[1]} { - display: block; - width: auto; - margin-top: 0; - } -`; - -const SearchBox = styled(ToggleArea)` - ${mq[1]} { - flex: 1; - max-width: 200px; - margin-right: ${theme.space[3]}; - } -`; - -const Menu = styled(ToggleArea)` - ${mq[1]} { - flex: 0 0 auto; - margin-left: auto; - } -`; - -const MenuList = styled.ul` - ${mq[1]} { - display: flex; - justify-content: space-between; - align-items: center; - flex-wrap: wrap; - } -`; - -const MenuItem = styled.li` - margin-bottom: ${theme.space[3]}; - ${mq[1]} { - margin-bottom: 0; - - &:not(:last-child) { - margin-right: ${theme.space[3]}; - } - } - ${mq[2]} { - &:not(:last-child) { - margin-right: ${theme.space[4]}; - } - } - ${mq[4]} { - &:not(:last-child) { - margin-right: ${theme.space[5]}; - } - } -`; - -const NavLink = styled(Link)` - text-decoration: none; - font-weight: 600; - - ${mq[2]} { - font-size: ${theme.fontsize[4]}; - } -`; - -const NOTIFS_QUERY = graphql` - query notifs { - file(relativePath: { regex: "/notifications/" }) { - childDataYaml { - notifications { - published - loud - message - url - } - } - } - } -`; - -function Header({ hasHeroBelow }) { - const [scrolled, setScrolled] = useState(false); - const [isNavOpen, setNavOpen] = useState(false); - const [isSearchOpen, setSearchOpen] = useState(false); - - useEffect(() => { - // TODO: use raf to throttle events - window.addEventListener('scroll', handleScroll); - - return () => { - window.removeEventListener('scroll', handleScroll); - }; - }, []); - - function handleScroll() { - const currentWindowPos = document.documentElement.scrollTop || document.body.scrollTop; - - const scrolled = currentWindowPos > 0; - - setScrolled(scrolled); - } - - function handleMenuBtnClick() { - setNavOpen(s => !s); - setSearchOpen(false); - } - - function handleSearchBtnClick() { - setSearchOpen(s => !s); - setNavOpen(false); - } - - return ( - - {data => { - const notifications = data.file.childDataYaml.notifications.filter( - notif => notif.published, - ); - const collapsed = !hasHeroBelow || scrolled; - const hasNotifications = notifications.length > 0; - return ( - - - - - - Decap CMS logo - - - - - {isSearchOpen ? × : search} - - - {isNavOpen ? × : } - - - - - - - - - - Star - - - - Docs - - - - Pro Help - - New - - - - - Community - - - Blog - - - - - - ); - }} - - ); -} - -export default Header; diff --git a/website/src/components/hero-title.js b/website/src/components/hero-title.js deleted file mode 100644 index ab4485262177..000000000000 --- a/website/src/components/hero-title.js +++ /dev/null @@ -1,16 +0,0 @@ -import styled from '@emotion/styled'; - -import theme from '../theme'; -import { mq } from '../utils'; - -const HeroTitle = styled.h1` - font-size: ${theme.fontsize[6]}; - margin-bottom: ${theme.space[1]}; - - ${mq[2]} { - font-size: ${theme.fontsize[7]}; - margin-bottom: ${theme.space[2]}; - } -`; - -export default HeroTitle; diff --git a/website/src/components/home-section.js b/website/src/components/home-section.js deleted file mode 100644 index 3c8a433e61bd..000000000000 --- a/website/src/components/home-section.js +++ /dev/null @@ -1,37 +0,0 @@ -import React from 'react'; -import styled from '@emotion/styled'; - -import Container from './container'; -import Page from './page'; -import theme from '../theme'; - -const Header = styled.header` - text-align: center; - padding-top: ${theme.space[6]}; - padding-bottom: ${theme.space[6]}; -`; - -const Title = styled.h2` - font-size: ${theme.fontsize[6]}; -`; - -const Text = styled.div` - max-width: 710px; - margin: 0 auto; -`; - -function HomeSection({ title, text, children, ...props }) { - return ( - - -
    - {title} - {text && {text}} -
    - {children} -
    -
    - ); -} - -export default HomeSection; diff --git a/website/src/components/layout.js b/website/src/components/layout.js deleted file mode 100644 index ad13e9da412b..000000000000 --- a/website/src/components/layout.js +++ /dev/null @@ -1,76 +0,0 @@ -import React from 'react'; -import { Helmet } from 'react-helmet'; -import { graphql, StaticQuery } from 'gatsby'; -import { ThemeProvider } from '@emotion/react'; - -import Header from './header'; -import Footer from './footer'; -import GlobalStyles from '../global-styles'; -import theme from '../theme'; - -const LAYOUT_QUERY = graphql` - query layoutQuery { - site { - siteMetadata { - title - description - } - } - footer: file(relativePath: { regex: "/global/" }) { - childDataYaml { - footer { - buttons { - url - name - } - } - } - } - } -`; - -export function LayoutTemplate({ children }) { - return ( - - - {children} - - ); -} - -function Layout({ hasPageHero, children }) { - return ( - - {data => { - const { title, description } = data.site.siteMetadata; - - return ( - - - - - - -
    - {children} -