From da013361ac83c738d6f54aef3906e1f0be47f409 Mon Sep 17 00:00:00 2001 From: shannonbux Date: Tue, 28 Jul 2020 16:46:06 -0700 Subject: [PATCH] feat(gatsby-recipes) --- .../recipes/animated-page-transitions.mdx | 8 +++++--- packages/gatsby-recipes/recipes/ava.mdx | 8 +++++--- packages/gatsby-recipes/recipes/cypress.mdx | 17 +++++++--------- packages/gatsby-recipes/recipes/emotion.mdx | 10 +++++----- packages/gatsby-recipes/recipes/eslint.mdx | 16 +++++++-------- .../recipes/gatsby-plugin-layout.mdx | 13 ++++++------ .../recipes/gatsby-plugin-react-helmet.mdx | 16 +++++++-------- .../recipes/gatsby-theme-blog-core.mdx | 13 +++++++----- .../recipes/gatsby-theme-blog.mdx | 13 ++++++------ .../recipes/gatsby-theme-notes.mdx | 13 +++++++----- .../gatsby-recipes/recipes/gitlab-ci-cd.mdx | 10 ++++++---- packages/gatsby-recipes/recipes/jest.mdx | 20 ++++++++++--------- .../gatsby-recipes/recipes/mdx-images.mdx | 16 +++++++-------- packages/gatsby-recipes/recipes/mdx-pages.mdx | 18 ++++++++--------- packages/gatsby-recipes/recipes/preact.mdx | 10 ++++++---- .../recipes/prettier-git-hook.mdx | 20 ++++++++++--------- 16 files changed, 117 insertions(+), 104 deletions(-) diff --git a/packages/gatsby-recipes/recipes/animated-page-transitions.mdx b/packages/gatsby-recipes/recipes/animated-page-transitions.mdx index cbd028d64d5d6..fe655a5021729 100644 --- a/packages/gatsby-recipes/recipes/animated-page-transitions.mdx +++ b/packages/gatsby-recipes/recipes/animated-page-transitions.mdx @@ -2,22 +2,24 @@ This recipe helps you create transitions for animating between entering and exiting Gatsby pages. +This recipe: + --- -The recipe's first step is to install the NPM packages you need: +Installs these NPM packages: --- -Then, it adds the following plugin to your Gatsby config: +Adds the following plugin to your Gatsby config: --- -Finally, it creates a few example pages to animate between: +Creates a few example pages to animate between: diff --git a/packages/gatsby-recipes/recipes/ava.mdx b/packages/gatsby-recipes/recipes/ava.mdx index f354d4f94a5bc..71b86eca47cd0 100644 --- a/packages/gatsby-recipes/recipes/ava.mdx +++ b/packages/gatsby-recipes/recipes/ava.mdx @@ -2,15 +2,17 @@ This recipe helps you setup AVA in your Gatsby site to test components and utilities. +This recipe: + --- -First, the recipe installs the `ava` package: +Installs the `ava` package. --- -Then, it adds some AVA test files for you to play with. +Adds some AVA test files for you to play with. @@ -12,7 +14,7 @@ Add dependencies to your package.json, including a useful package `gatsby-cypres --- -Cool cool! So the recipe created a local `cypress` folder with two sub-folders, `support` and `plugins`. It also automatically included all the nice `gatsby-cypress` utilities, which you can now use in your first test. +Creates a local `cypress` folder with two sub-folders, `support` and `plugins`. It automatically includes all the `gatsby-cypress` utilities, which you can use in your first test. @@ -14,15 +16,13 @@ Install necessary NPM packages --- -Install the Emotion plugin in gatsby-config.js +Installs the Emotion plugin in gatsby-config.js --- -Sweet, now it's ready to go. - -Let's also write out an example page you can use to play +Writes out an example page you can use to play with Emotion. --- -Install `gatsby-plugin-eslint` +Installs `gatsby-plugin-eslint`. --- -Write out a basic .eslintrc.js file that you can extend with your own chosen -eslint plugins and presets +Writes out a basic .eslintrc.js file that you can extend with your own chosen +eslint plugins and presets. --- -Install the Layout plugin in gatsby-config.js +Installs the Layout plugin in gatsby-config.js --- -Sweet, now it's ready to go! - -Let's also write out a sample layout component to get started with. +Writes out a sample layout component to get started with. --- -Install the React Helmet plugin in gatsby-config.js +Installs the React Helmet plugin in `gatsby-config.js`. --- -Great, now it's ready to go! - -It's also common to have a `` component which helps ensure pages have the necessary title and meta tags. - -We'll write out one now. +Writes out an `` component which helps ensure pages have the necessary title and meta tags. --- -Install the gatsby-theme-blog-core plugin in gatsby-config.js. Make use of the `basePath` configuration so the blog listing appears at `/blog`. +Installs the `gatsby-theme-blog-core` plugin in `gatsby-config.js` and makes use of the `basePath` configuration so the blog listing appears at `/blog`. --- -Now let's add some posts! + +Adds some posts. --- -You're now set up to style your blog however you like! +After installing this recipe, you will be setup to style your blog however you like. -Run `gatsby develop` and check out `http://localhost:8000/blog` for the list of posts. +When you've finished installing the recipe, run `gatsby develop` and check out `http://localhost:8000/blog` for the list of posts. Example content is available at `http://localhost:8000/blog/hello-world` and `http://localhost:8000/blog/second-post`. diff --git a/packages/gatsby-recipes/recipes/gatsby-theme-blog.mdx b/packages/gatsby-recipes/recipes/gatsby-theme-blog.mdx index 367daa7b6227f..e8bd0233e5167 100644 --- a/packages/gatsby-recipes/recipes/gatsby-theme-blog.mdx +++ b/packages/gatsby-recipes/recipes/gatsby-theme-blog.mdx @@ -2,29 +2,30 @@ [Gatsby theme blog](https://www.gatsbyjs.org/packages/gatsby-theme-blog/) is a great theme for adding blog functionality to your site. +This recipe: + --- -Install necessary NPM packages +Installs necessary NPM packages. --- -Install the gatsby-theme-blog plugin in gatsby-config.js. Make use of the `basePath` configuration so the blog listing appears at `/blog`. +Installs the `gatsby-theme-blog` plugin in `gatsby-config.js` and makes use of the `basePath` configuration so the blog listing appears at `/blog`. --- -Now let's add a post! + +Adds a post. --- -And just like that, you're ready to start blogging! - -Run `gatsby develop` and check out `http://localhost:8000/blog` for the list of posts. +When you've finished installing the recipe, run `gatsby develop` and check out `http://localhost:8000/blog` for the list of posts. Example content is available at `http://localhost:8000/blog/first-blog`. diff --git a/packages/gatsby-recipes/recipes/gatsby-theme-notes.mdx b/packages/gatsby-recipes/recipes/gatsby-theme-notes.mdx index daf681ee74d2c..c1e77d942c250 100644 --- a/packages/gatsby-recipes/recipes/gatsby-theme-notes.mdx +++ b/packages/gatsby-recipes/recipes/gatsby-theme-notes.mdx @@ -2,28 +2,31 @@ [Gatsby theme notes](https://www.gatsbyjs.org/packages/gatsby-theme-notes) is a great theme for adding learning notes to your site. +This recipe: + --- -Install necessary NPM package +Installs necessary NPM package. --- -Install the gatsby-theme-notes plugin in gatsby-config.js +Installs the `gatsby-theme-notes` plugin in `gatsby-config.js`. --- -Now let's add a note! + +Adds a note. --- -Now you're ready to use your site for notetaking. +After installing this recipe, you can use your site for notetaking. -Run `gatsby develop` and check out `http://localhost:8000/notes` for the list of notes. +When you've finished installing the recipe, run `gatsby develop` and check out `http://localhost:8000/notes` for the list of notes. --- diff --git a/packages/gatsby-recipes/recipes/gitlab-ci-cd.mdx b/packages/gatsby-recipes/recipes/gitlab-ci-cd.mdx index 3144986ffe22e..b051195a5dff0 100644 --- a/packages/gatsby-recipes/recipes/gitlab-ci-cd.mdx +++ b/packages/gatsby-recipes/recipes/gitlab-ci-cd.mdx @@ -1,10 +1,12 @@ # Add GitLab CI/CD -This recipe helps you setup GitLab CI/CD in your Gatsby site to create a pipeline on gitlab.com +This recipe helps you setup GitLab CI/CD in your Gatsby site to create a pipeline on gitlab.com. + +This recipe: --- -Adding the `.gitlab-ci.yml` +Adds the `.gitlab-ci.yml`. ` you will have your gatsby project building! +After installing this recipe, every time you `git push ` you will have your gatsby project building. ---- +More resources: - See how you can develop this simple file into something more real world [GitLab CI/CD Docs](https://docs.gitlab.com/ee/ci/README.html) - Check this especially to learn how to make your newly build available for a next job - [GitLab Job Artifacts Docs](https://docs.gitlab.com/ee/ci/pipelines/job_artifacts.html) diff --git a/packages/gatsby-recipes/recipes/jest.mdx b/packages/gatsby-recipes/recipes/jest.mdx index 4618a6a79a2f3..c2ec3cedcf954 100644 --- a/packages/gatsby-recipes/recipes/jest.mdx +++ b/packages/gatsby-recipes/recipes/jest.mdx @@ -1,20 +1,22 @@ # Add Jest -This recipe helps you setup Jest in your Gatsby site to test components and utilities +This recipe helps you setup Jest in your Gatsby site to test components and utilities. +This recipe: + --- -Installing the `jest` package +Installs the `jest` package. --- -Adding some jest test files for you to play with +Adds some jest test files for you to play with. + +--- + +Once you've installed this recipe, try running `npm run test` and jest will run your test. And, while writing tests, you can run `npm run test:watch` and tests will re-run +as you edit them. diff --git a/packages/gatsby-recipes/recipes/mdx-images.mdx b/packages/gatsby-recipes/recipes/mdx-images.mdx index 0ae1cf9f32bd3..b631cc6ef69b5 100644 --- a/packages/gatsby-recipes/recipes/mdx-images.mdx +++ b/packages/gatsby-recipes/recipes/mdx-images.mdx @@ -1,14 +1,16 @@ # Setup images in MDX with Gatsby This recipe installs and configures all -the necessary NPM packages & Gatsby Plugins +the necessary NPM packages & Gatsby plugins to enable inline-images in MDX and MD files. Based on https://www.gatsbyjs.org/docs/working-with-images-in-markdown/ +This recipe: + --- -Install NPM Packages +Installs NPM Packages. --- -Then we'll add an example MDX page for you to play with. +Adds an example MDX page for you to play with. @@ -14,7 +16,7 @@ Install the necessary NPM packages: --- -Add the Preact plugin to your Gatsby config. It will setup the correct configuration, which will let gatsby use Preact instead of React. +Adds the Preact plugin to your Gatsby config. It will setup the correct configuration, which will let gatsby use Preact instead of React. @@ -14,7 +16,7 @@ Install packages. --- -Implement git hooks for prettier. +Implements git hooks for `prettier`.