From 432d705a829e28267e479c81d2ecdef31e11781a Mon Sep 17 00:00:00 2001 From: Michael Currin <18750745+MichaelCurrin@users.noreply.github.com> Date: Sat, 27 Nov 2021 19:03:51 +0200 Subject: [PATCH 01/14] update edit-on-github.md --- recipes/jekyll/snippets/edit-on-github.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/recipes/jekyll/snippets/edit-on-github.md b/recipes/jekyll/snippets/edit-on-github.md index 51fd5ca3..f5d79396 100644 --- a/recipes/jekyll/snippets/edit-on-github.md +++ b/recipes/jekyll/snippets/edit-on-github.md @@ -1,5 +1,7 @@ # Edit on GitHub +{% raw %} + ```liquid 📝Edit on GitHub @@ -11,3 +13,5 @@ ``` + +{% endraw %} From c2ca52771891dedbe05af9ad698d530bb2658f4b Mon Sep 17 00:00:00 2001 From: Michael Currin <18750745+MichaelCurrin@users.noreply.github.com> Date: Sat, 27 Nov 2021 19:03:55 +0200 Subject: [PATCH 02/14] update page-url.md --- recipes/jekyll/page-url.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/jekyll/page-url.md b/recipes/jekyll/page-url.md index 2be188a3..8e6eb453 100644 --- a/recipes/jekyll/page-url.md +++ b/recipes/jekyll/page-url.md @@ -1,4 +1,5 @@ # Page URL + {% raw %} Get the page URL. @@ -114,7 +115,7 @@ But in Jekyll 3 you must do this: This can be used for most flexibility: ```liquid -{{ '/' | relative_url } +{{ '/' | relative_url }} ``` Note that for the crumbs section that the `{{ site.baseurl }}` prefix should always be there. Note that `relative_url` is not practical since the URL is built through a `for` loop rather than a string. From 2f6cb8472ea55d9a260d47a54265341cd55626e6 Mon Sep 17 00:00:00 2001 From: Michael Currin <18750745+MichaelCurrin@users.noreply.github.com> Date: Sat, 27 Nov 2021 19:04:05 +0200 Subject: [PATCH 03/14] chore: update _config.yml --- _config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_config.yml b/_config.yml index 635c59db..2e732b45 100644 --- a/_config.yml +++ b/_config.yml @@ -35,7 +35,7 @@ strict_front_matter: true ### Theme boilerplate ### -remote_theme: MichaelCurrin/fractal +theme: fractal titles_from_headings: strip_title: true From 6aef632bbfdd776ffa0c85ac6726381f93748dd4 Mon Sep 17 00:00:00 2001 From: Michael Currin <18750745+MichaelCurrin@users.noreply.github.com> Date: Sat, 27 Nov 2021 19:04:10 +0200 Subject: [PATCH 04/14] build(deps): update Gemfile --- Gemfile | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Gemfile b/Gemfile index 266d6a54..5dba6687 100644 --- a/Gemfile +++ b/Gemfile @@ -1,11 +1,6 @@ source "https://rubygems.org" -gem "jekyll", "~> 3.9" -gem "kramdown-parser-gfm", "~> 1.1.0" +gem "jekyll", "~> 4.2" gem "webrick", "~> 1.7" gem "fractal", git: "https://github.com/MichaelCurrin/fractal" - -group :jekyll_plugins do - gem "jekyll-remote-theme", "~> 0.4.3" -end From 31d16e1abf537248527b6c21d2900a147d825066 Mon Sep 17 00:00:00 2001 From: Michael Currin <18750745+MichaelCurrin@users.noreply.github.com> Date: Sat, 27 Nov 2021 19:04:14 +0200 Subject: [PATCH 05/14] ci: create main.yml --- .github/workflows/main.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..6187646a --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,38 @@ +name: GH Pages Deploy + +on: + push: + branches: master + paths-ignore: + - README.md + + pull_request: + branches: master + paths-ignore: + - README.md + +jobs: + build-deploy: + name: Build and deploy + + runs-on: ubuntu-latest + + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v2 + + - name: Set up Ruby 💎 + uses: ruby/setup-ruby@v1 + with: + ruby-version: "3" + bundler-cache: true + + - name: Build 🏗 + run: make build + + - name: Deploy to GH Pages 🚀 + if: ${{ github.event_name != 'pull_request' }} + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: _site From 4ce384582c2f842657fd242dd85700fc298c9e68 Mon Sep 17 00:00:00 2001 From: Michael Currin <18750745+MichaelCurrin@users.noreply.github.com> Date: Sat, 27 Nov 2021 19:05:19 +0200 Subject: [PATCH 06/14] feat: remove site.baseurl --- .../github-actions/workflows/jekyll/build/container.md | 4 ++-- .../github-actions/workflows/jekyll/build/generic.md | 5 ++--- .../github-actions/workflows/jekyll/build/index.md | 6 +++--- recipes/jekyll/new.md | 10 +++++----- recipes/jekyll/project-files/makefile.md | 2 +- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/recipes/ci-cd/github-actions/workflows/jekyll/build/container.md b/recipes/ci-cd/github-actions/workflows/jekyll/build/container.md index 185a4d43..7e95d0db 100644 --- a/recipes/ci-cd/github-actions/workflows/jekyll/build/container.md +++ b/recipes/ci-cd/github-actions/workflows/jekyll/build/container.md @@ -4,8 +4,8 @@ Related recipe - [Jekyll][] in the Container section. This flow runs a **Docker container**. If you don't want to use Docker, see [Jekyll Ruby Action][], which is a light approach. -[Jekyll]: {{ site.baseurl }}{% link recipes/containers/docker/jekyll.md %} -[Jekyll Ruby Action]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/jekyll/build/ruby-action.md %} +[Jekyll]: {% link recipes/containers/docker/jekyll.md %} +[Jekyll Ruby Action]: {% link recipes/ci-cd/github-actions/workflows/jekyll/build/ruby-action.md %} {% raw %} diff --git a/recipes/ci-cd/github-actions/workflows/jekyll/build/generic.md b/recipes/ci-cd/github-actions/workflows/jekyll/build/generic.md index 6eb2e52f..2cff4af6 100644 --- a/recipes/ci-cd/github-actions/workflows/jekyll/build/generic.md +++ b/recipes/ci-cd/github-actions/workflows/jekyll/build/generic.md @@ -10,12 +10,12 @@ description: Use a Ruby action to set up Ruby and gems, then build and add a gen - [jekyll-gh-actions-quickstart][] template repo with a live demo and tutorial. [jekyll-gh-actions-quickstart]: https://github.com/MichaelCurrin/jekyll-gh-actions-quickstart -[GH Actions Ruby]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/ruby/index.md %} +[GH Actions Ruby]: {% link recipes/ci-cd/github-actions/workflows/ruby/index.md %} ## Why generic? -Why use this this approach? This is a great generic approach, rather than being tied to using an action which is built around Jekyll or Jekyll + GH Pages. +Why use this this approach? This is a great generic approach, rather than being tied to using an action which is built around Jekyll or Jekyll + GH Pages. The Ruby action does the job well, it reusable across non-Jekyll projects and it will probably be simpler and better maintained than some Jekyll-specific one. Seeing as the Ruby one has wider appeal to the community than a Jekyll-specifi solution. @@ -71,4 +71,3 @@ Here we set up a Ruby environment using the `setup-ruby` action. A param is pass Replace the Build command `make build` if you prefer. {% endraw %} - diff --git a/recipes/ci-cd/github-actions/workflows/jekyll/build/index.md b/recipes/ci-cd/github-actions/workflows/jekyll/build/index.md index ac69f1d1..8276212c 100644 --- a/recipes/ci-cd/github-actions/workflows/jekyll/build/index.md +++ b/recipes/ci-cd/github-actions/workflows/jekyll/build/index.md @@ -21,9 +21,9 @@ That approach without GitHub Actions is much simpler. The downside is that you a - [Deploy GH Pages][] as a more generic section which could still be used for Jekyll. - [Jekyll container][] page. -[GH Pages Actions]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/jekyll/gh-pages-actions.md %} -[Deploy GH Pages]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/deploy-gh-pages/index.md %} -[Jekyll container]: {{ site.baseurl }}{% link recipes/containers/docker/jekyll.md %} +[GH Pages Actions]: {% link recipes/ci-cd/github-actions/workflows/jekyll/gh-pages-actions.md %} +[Deploy GH Pages]: {% link recipes/ci-cd/github-actions/workflows/deploy-gh-pages/index.md %} +[Jekyll container]: {% link recipes/containers/docker/jekyll.md %} ### Demo site diff --git a/recipes/jekyll/new.md b/recipes/jekyll/new.md index 7d545757..fa4ad97b 100644 --- a/recipes/jekyll/new.md +++ b/recipes/jekyll/new.md @@ -21,7 +21,7 @@ Whatever approach you use, pay attention to whether you have Jekyll 3 or 4. ### Use global -If you have Jekyll installed globally. +If you have Jekyll installed globally. ```sh $ jekyll new my-site @@ -67,14 +67,14 @@ If you're interested in Jekyll 4 specifically. 1. Go to this repo: - [MichaelCurrin/jekyll-gh-actions-quickstart](https://github.com/MichaelCurrin/jekyll-gh-actions-quickstart) 1. Click the _Use this template_ button to get a repo. -1. Follow the repo's docs to set up Jekyll locally and on GitHub Pages. +1. Follow the repo's docs to set up Jekyll locally and on GitHub Pages. - You just need to enable your site under GitHub Pages under _Settings_. - - GitHub Actions will already be configured for you. You don't even have to set a token. + - GitHub Actions will already be configured for you. You don't even have to set a token. ### Jekyll 4 and Netlify -The above template also will work on Netlify. +The above template also will work on Netlify. Delete the GitHub Actions workflow and set up a Netlify config - see this [Jekyll Netlify][] recipe. -[Jekyll Netlify]: {{ site.baseurl }}{% link recipes/ci-cd/netlify/configure/jekyll.md %} +[Jekyll Netlify]: {% link recipes/ci-cd/netlify/configure/jekyll.md %} diff --git a/recipes/jekyll/project-files/makefile.md b/recipes/jekyll/project-files/makefile.md index 0263d5ab..0790c33a 100644 --- a/recipes/jekyll/project-files/makefile.md +++ b/recipes/jekyll/project-files/makefile.md @@ -7,7 +7,7 @@ - [Make](https://michaelcurrin.github.io/dev-cheatsheets/cheatsheets/make/) section of Dev Cheatsheets project - [Makefile](https://github.com/MichaelCurrin/jekyll-blog-demo/blob/master/Makefile) in my Jekyll template repo -[Make]: {{ site.baseurl }}{% link recipes/make/index.md %} +[Make]: {% link recipes/make/index.md %} ## Samples From ceb9587f50c7546cb30dfb5b25b3832898abcb20 Mon Sep 17 00:00:00 2001 From: Michael Currin <18750745+MichaelCurrin@users.noreply.github.com> Date: Sat, 27 Nov 2021 19:06:24 +0200 Subject: [PATCH 07/14] feat: remove site.baseurl --- index.md | 22 +++++++++---------- recipes/ansible/index.md | 4 ++-- recipes/ci-cd/github-actions/index.md | 6 ++--- recipes/ci-cd/github-actions/tokens/index.md | 6 ++--- .../ci-cd/github-actions/workflows/basic.md | 2 +- .../workflows/build-release-assets/go.md | 2 +- .../ci-cd/github-actions/workflows/cache.md | 6 ++--- .../check-links/html-proofer-generic.md | 4 ++-- .../workflows/check-links/index.md | 2 +- .../ci-cd/github-actions/workflows/commit.md | 12 +++++----- .../workflows/create-pull-request.md | 16 +++++++------- .../workflows/deploy-gh-pages/index.md | 6 ++--- .../github-actions/workflows/go/index.md | 8 +++---- .../ci-cd/github-actions/workflows/index.md | 6 ++--- .../github-actions/workflows/node/basic.md | 6 ++--- .../github-actions/workflows/node/npm.md | 8 +++---- .../workflows/node/upgrade-packages.md | 10 ++++----- .../github-actions/workflows/node/yarn.md | 4 ++-- .../github-actions/workflows/tweet/python.md | 2 +- recipes/ci-cd/netlify/index.md | 2 +- recipes/containers/docker/jekyll.md | 4 ++-- recipes/go/index.md | 2 +- .../javascript/packages/vue/app-structure.md | 2 +- recipes/make/index.md | 2 +- recipes/make/jekyll.md | 8 +++---- recipes/nosql/mongo.md | 2 +- recipes/other/editor-config.md | 2 +- recipes/ruby/rake/jekyll.md | 2 +- .../ssh/access/allow-login-by-ssh-key.md | 4 ++-- recipes/shell/ssh/github-ssh-access.md | 5 ++--- recipes/shell/ssh/index.md | 2 +- recipes/shell/upgrade-packages.md | 3 +-- recipes/version-control/github/ssh.md | 2 +- recipes/web/check-links/html-proofer.md | 4 ++-- recipes/web/check-links/index.md | 2 +- .../web/check-links/markdown-link-check.md | 2 +- recipes/web/html/accordion.md | 6 ++--- 37 files changed, 93 insertions(+), 95 deletions(-) diff --git a/index.md b/index.md index 97a073d8..acfbc530 100644 --- a/index.md +++ b/index.md @@ -7,12 +7,12 @@ layout: home Welcome to **Code Cookbook**. -This aims to have an entire recipe to solve a problem. Such as a script or config, or a few files which work together. +This aims to have an entire recipe to solve a problem. Such as a script or config, or a few files which work together. And the recipes are based on real-world code as much as possible, collecting from repos or docs I encounter or from my own projects.
- + Go to recipes @@ -47,12 +47,12 @@ Highlights of this site. - Commands and configs for using Docker and Kubernetes. -[Vue]: {{ site.baseurl }}{% link recipes/javascript/packages/vue/index.md %} -[EditorConfig]: {{ site.baseurl }}{% link recipes/other/editor-config.md %} -[Make]: {{ site.baseurl }}{% link recipes/make/index.md %} -[CI/CD]: {{ site.baseurl }}{% link recipes/ci-cd/index.md %} -[Workflows]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/index.md %} -[SEO]: {{ site.baseurl }}{% link recipes/web/seo/index.md %} -[Shell]: {{ site.baseurl }}{% link recipes/shell/index.md %} -[Jekyll]: {{ site.baseurl }}{% link recipes/jekyll/index.md %} -[Containers]: {{ site.baseurl }}{% link recipes/containers/index.md %} +[Vue]: {% link recipes/javascript/packages/vue/index.md %} +[EditorConfig]: {% link recipes/other/editor-config.md %} +[Make]: {% link recipes/make/index.md %} +[CI/CD]: {% link recipes/ci-cd/index.md %} +[Workflows]: {% link recipes/ci-cd/github-actions/workflows/index.md %} +[SEO]: {% link recipes/web/seo/index.md %} +[Shell]: {% link recipes/shell/index.md %} +[Jekyll]: {% link recipes/jekyll/index.md %} +[Containers]: {% link recipes/containers/index.md %} diff --git a/recipes/ansible/index.md b/recipes/ansible/index.md index 97dfff1f..6decc867 100644 --- a/recipes/ansible/index.md +++ b/recipes/ansible/index.md @@ -5,7 +5,7 @@ logo: ansible Default config files in the root `/etc/ansible/` directory: -- [Config]({{ site.baseurl }}{% link recipes/ansible/config.md %}) -- [Hosts]({{ site.baseurl }}{% link recipes/ansible/hosts.md %}) +- [Config]({% link recipes/ansible/config.md %}) +- [Hosts]({% link recipes/ansible/hosts.md %}) See [User guide](https://docs.ansible.com/ansible/latest/user_guide/index.html) in the docs. diff --git a/recipes/ci-cd/github-actions/index.md b/recipes/ci-cd/github-actions/index.md index 3de2a2b1..e721b32d 100644 --- a/recipes/ci-cd/github-actions/index.md +++ b/recipes/ci-cd/github-actions/index.md @@ -17,6 +17,6 @@ Here are some places to start to get into workflow file samples. - See sample workflows across programming languages. [GitHub Actions]: https://michaelcurrin.github.io/dev-cheatsheets/cheatsheets/ci-cd/github-actions/ -[Basic generic workflow]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/basic.md %} -[Basic Node workflow]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/node/basic.md %} -[Workflows]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/index.md %} +[Basic generic workflow]: {% link recipes/ci-cd/github-actions/workflows/basic.md %} +[Basic Node workflow]: {% link recipes/ci-cd/github-actions/workflows/node/basic.md %} +[Workflows]: {% link recipes/ci-cd/github-actions/workflows/index.md %} diff --git a/recipes/ci-cd/github-actions/tokens/index.md b/recipes/ci-cd/github-actions/tokens/index.md index cdb6133e..b6533fd2 100644 --- a/recipes/ci-cd/github-actions/tokens/index.md +++ b/recipes/ci-cd/github-actions/tokens/index.md @@ -7,17 +7,17 @@ A GitHub Action needs permissions to push to your `gh-pages` branch - so you mus Here are the approaches, from simplest to most complex to manage. A summary is provided. -- [GitHub token]({{ site.baseurl }}{% link recipes/ci-cd/github-actions/tokens/github-token.md %}) +- [GitHub token]({% link recipes/ci-cd/github-actions/tokens/github-token.md %}) - API key scoped to a single repo. - Auto-generated for a GH workflow - low effort. - Very secure - you never have to copy or even view the value. - The main limitation is that this only works for GitHub Actions, unlike the others. -- [Access token]({{ site.baseurl }}{% link recipes/ci-cd/github-actions/tokens/access-token.md %}) +- [Access token]({% link recipes/ci-cd/github-actions/tokens/access-token.md %}) - API key scoped to **all** repos in your GH account. - Easy to generate and add to a workflow. - **Warning** - this is the least secure. A token is for your entire profile, not per repo. With public repo access, a token gives read and write access to all your public repos - a compromised token can be used to do a lot of damage. - This key is useful for doing actions with the GH API such as reporting on stats. -- [Deploy key]({{ site.baseurl }}{% link recipes/ci-cd/github-actions/tokens/deploy-key.md %}) +- [Deploy key]({% link recipes/ci-cd/github-actions/tokens/deploy-key.md %}) - API key scoped to a repo. - Needs to be generated **locally** once using SSH tool and your email address then pasted in so it takes more effort. - Slightly less secure then GH Token as you deal with a value, but this is more flexible. diff --git a/recipes/ci-cd/github-actions/workflows/basic.md b/recipes/ci-cd/github-actions/workflows/basic.md index f78e207d..3687d98e 100644 --- a/recipes/ci-cd/github-actions/workflows/basic.md +++ b/recipes/ci-cd/github-actions/workflows/basic.md @@ -5,7 +5,7 @@ description: Minimal workflows for GH Actions to get you started If you are a JS developer, see the [Basic Node][] section. -[Basic Node]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/node/basic.md %} +[Basic Node]: {% link recipes/ci-cd/github-actions/workflows/node/basic.md %} ## Samples diff --git a/recipes/ci-cd/github-actions/workflows/build-release-assets/go.md b/recipes/ci-cd/github-actions/workflows/build-release-assets/go.md index 6aa9434b..7496f867 100644 --- a/recipes/ci-cd/github-actions/workflows/build-release-assets/go.md +++ b/recipes/ci-cd/github-actions/workflows/build-release-assets/go.md @@ -3,4 +3,4 @@ title: Release Go assets logo: go --- -See the [Go]({{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/go/index.md %}) workflows section. +See the [Go]({% link recipes/ci-cd/github-actions/workflows/go/index.md %}) workflows section. diff --git a/recipes/ci-cd/github-actions/workflows/cache.md b/recipes/ci-cd/github-actions/workflows/cache.md index 0cfe329e..456e7f7c 100644 --- a/recipes/ci-cd/github-actions/workflows/cache.md +++ b/recipes/ci-cd/github-actions/workflows/cache.md @@ -58,7 +58,7 @@ Use the cache option on `setup-node` action: - name: Install dependencies run: npm install ``` - + #### Use cache action The cache location will be `~/.npm` on Unix/Posix. See [NPM cache](https://docs.npmjs.com/cli/cache#cache) in the docs NPM docs. @@ -142,5 +142,5 @@ See [Ruby workflow][] recipes. {% endraw %} -[Ruby workflow]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/ruby/index.md %} -[NPM workflow]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/node/npm.md %} +[Ruby workflow]: {% link recipes/ci-cd/github-actions/workflows/ruby/index.md %} +[NPM workflow]: {% link recipes/ci-cd/github-actions/workflows/node/npm.md %} diff --git a/recipes/ci-cd/github-actions/workflows/check-links/html-proofer-generic.md b/recipes/ci-cd/github-actions/workflows/check-links/html-proofer-generic.md index b961be2d..4f73a553 100644 --- a/recipes/ci-cd/github-actions/workflows/check-links/html-proofer-generic.md +++ b/recipes/ci-cd/github-actions/workflows/check-links/html-proofer-generic.md @@ -12,8 +12,8 @@ How to use a Ruby gem as a CLI tool to validate links in your static HTML, for b - For use of `html-proofer` outside of GH Actions or how to add it to your `Gemfile`, see the - [HTML Proofer wrappers][] -[HTML Proofer gem]: {{ site.baseurl }}{% link recipes/web/check-links/html-proofer.md %} -[HTML Proofer wrappers]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/check-links/html-proofer-wrappers.md %} +[HTML Proofer gem]: {% link recipes/web/check-links/html-proofer.md %} +[HTML Proofer wrappers]: {% link recipes/ci-cd/github-actions/workflows/check-links/html-proofer-wrappers.md %} ## Samples diff --git a/recipes/ci-cd/github-actions/workflows/check-links/index.md b/recipes/ci-cd/github-actions/workflows/check-links/index.md index 63b52b1c..80d77f9c 100644 --- a/recipes/ci-cd/github-actions/workflows/check-links/index.md +++ b/recipes/ci-cd/github-actions/workflows/check-links/index.md @@ -12,4 +12,4 @@ Some action recipes here are intended for markdown files, while others will anal - [Check links][] recipes in the Web section. -[Check links]: {{ site.baseurl }}{% link recipes/web/check-links/index.md %} +[Check links]: {% link recipes/web/check-links/index.md %} diff --git a/recipes/ci-cd/github-actions/workflows/commit.md b/recipes/ci-cd/github-actions/workflows/commit.md index 52798115..f7e783aa 100644 --- a/recipes/ci-cd/github-actions/workflows/commit.md +++ b/recipes/ci-cd/github-actions/workflows/commit.md @@ -1,14 +1,14 @@ --- title: Commit -description: How to commit and push files during the CI flow +description: How to commit and push files during the CI flow --- -## Related +## Related - [Create Pull Request][] workflows - some recipes there will commit for you, so you do not need a separate commit step. -[Create Pull Request]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/create-pull-request.md %} +[Create Pull Request]: {% link recipes/ci-cd/github-actions/workflows/create-pull-request.md %} {% raw %} @@ -29,7 +29,7 @@ Some situations when you might want to add/edit and commit files all during a si - Update a list of contributors. (A GH bot can handle this for you) - Update a table of contents. - Code changes. - - Perform lint fixes. + - Perform lint fixes. - Perform package upgrades. @@ -48,7 +48,7 @@ This is slightly verbose but not too long. You know exactly what it is doing and steps: - name: Checkout # uses: ... - + - name: Build # run: ... @@ -90,7 +90,7 @@ See [push-new-files-back-to-master](https://github.com/marketplace/actions/push- steps: - name: Checkout # uses: ... - + - name: Build # run: ... diff --git a/recipes/ci-cd/github-actions/workflows/create-pull-request.md b/recipes/ci-cd/github-actions/workflows/create-pull-request.md index e1d5259e..1c250021 100644 --- a/recipes/ci-cd/github-actions/workflows/create-pull-request.md +++ b/recipes/ci-cd/github-actions/workflows/create-pull-request.md @@ -1,10 +1,10 @@ # Create Pull Request -## Related +## Related - [Commit][] workflows so you create a commit without a Pull Request, such as if you want to commit on the main branch. -[Commit]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/commit.md %} +[Commit]: {% link recipes/ci-cd/github-actions/workflows/commit.md %} {% raw %} @@ -29,8 +29,8 @@ steps: All inputs are optional but you probably want to set some of these: - `title` for PR title. -- `branch` for branch name to create. -- `delete-branch` - Delete the branch when closing pull requests, and when undeleted after merging. Recommended as `true`. I don't know how this compares to the settings of the repo. This optional might not be useful. +- `branch` for branch name to create. +- `delete-branch` - Delete the branch when closing pull requests, and when undeleted after merging. Recommended as `true`. I don't know how this compares to the settings of the repo. This optional might not be useful. The docs recommend using a fix branch name, rather than one that is unique, to avoid to many branches/PRs. @@ -40,7 +40,7 @@ With options: steps: - name: Create Pull Request uses: peter-evans/create-pull-request@v3 - with: + with: title: My PR title commit-message: My commit message branch: my-branch-name @@ -50,11 +50,11 @@ steps: ## No action -Here we hit the GitHub API to create a PR. +Here we hit the GitHub API to create a PR. We don't actually make the commit or branch here - just the PR itself. See [Commit][] recipe for making the commit. -[Commit]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/commit.md %} +[Commit]: {% link recipes/ci-cd/github-actions/workflows/commit.md %} ### Same repo @@ -108,7 +108,7 @@ jobs: } EOF ) - curl + curl https://api.github.com/repos/my-user/my-repo/pulls \ --header "Authorization: token ${TOKEN}" \ -H "Content-Type:application/json" \ diff --git a/recipes/ci-cd/github-actions/workflows/deploy-gh-pages/index.md b/recipes/ci-cd/github-actions/workflows/deploy-gh-pages/index.md index b2497c07..7c03d5b0 100644 --- a/recipes/ci-cd/github-actions/workflows/deploy-gh-pages/index.md +++ b/recipes/ci-cd/github-actions/workflows/deploy-gh-pages/index.md @@ -19,6 +19,6 @@ See [Tokens](/recipes/ci-cd/github-actions/tokens/) guide on use of tokens. - [GH Pages Deploy - Node][] page. - [MkDocs][] section. -[Build and deploy - Jekyll]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/jekyll/build/index.md %} -[GH Pages Deploy - Node]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/node/gh-pages.md %} -[MkDocs]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/mkdocs/index.md %} +[Build and deploy - Jekyll]: {% link recipes/ci-cd/github-actions/workflows/jekyll/build/index.md %} +[GH Pages Deploy - Node]: {% link recipes/ci-cd/github-actions/workflows/node/gh-pages.md %} +[MkDocs]: {% link recipes/ci-cd/github-actions/workflows/mkdocs/index.md %} diff --git a/recipes/ci-cd/github-actions/workflows/go/index.md b/recipes/ci-cd/github-actions/workflows/go/index.md index 91cae3d9..fc6515f9 100644 --- a/recipes/ci-cd/github-actions/workflows/go/index.md +++ b/recipes/ci-cd/github-actions/workflows/go/index.md @@ -18,7 +18,7 @@ You can skip GitHub Actions. See [Build and release assets][] workflows section. -1. Use shell commands in the workflow to build one or more output files, such as for each OS. +1. Use shell commands in the workflow to build one or more output files, such as for each OS. 2. Use the generic `create-release` action to make a release. 3. Use the generic `upload-actions` action to attach the files to the new release. @@ -27,10 +27,10 @@ See [Build and release assets][] workflows section. Use [Go Releaser][] action to handle the steps for you in a single action. This makes it easy to maintain and reuse the workflow across Go projecs. It includes support for compiling across platforms too. -[Build and release assets]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/build-release-assets/index.md %} -[Go Releaser]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/go/go-releaser.md %} +[Build and release assets]: {% link recipes/ci-cd/github-actions/workflows/build-release-assets/index.md %} +[Go Releaser]: {% link recipes/ci-cd/github-actions/workflows/go/go-releaser.md %} ### Related sections -- [Go]({{ site.baseurl }}{% link recipes/go/index.md %}) recipes section. +- [Go]({% link recipes/go/index.md %}) recipes section. diff --git a/recipes/ci-cd/github-actions/workflows/index.md b/recipes/ci-cd/github-actions/workflows/index.md index a04e1429..2018d37a 100644 --- a/recipes/ci-cd/github-actions/workflows/index.md +++ b/recipes/ci-cd/github-actions/workflows/index.md @@ -4,7 +4,7 @@ description: Samples, resources and instructions around run a GH Actions workflo --- -The pages in this section covers a variety of tools and flows including Python, NPM, Jekyll, GitHub Pages and mixing them together. +The pages in this section covers a variety of tools and flows including Python, NPM, Jekyll, GitHub Pages and mixing them together. Here are some highlights. @@ -42,8 +42,8 @@ Here are some popular things to do: - Continue to [Basic Node][] as that is still simple and will be useful for Node.js developers. - To learn more about specific fields like `jobs` and the `on` trigger, see my [GitHub Actions cheatsheets][]. -[Basic]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/basic.md %} -[Basic Node]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/node/basic.md %} +[Basic]: {% link recipes/ci-cd/github-actions/workflows/basic.md %} +[Basic Node]: {% link recipes/ci-cd/github-actions/workflows/node/basic.md %} [GitHub Actions cheatsheets]: https://michaelcurrin.github.io/dev-cheatsheets/cheatsheets/ci-cd/github-actions/ ### Building and serving a site diff --git a/recipes/ci-cd/github-actions/workflows/node/basic.md b/recipes/ci-cd/github-actions/workflows/node/basic.md index 8e301102..5ffd587c 100644 --- a/recipes/ci-cd/github-actions/workflows/node/basic.md +++ b/recipes/ci-cd/github-actions/workflows/node/basic.md @@ -98,10 +98,10 @@ jobs: steps: - name: Checkout 🛎️ uses: actions/checkout@master - + - name: Lint 🧐 run: npx eslint . - + - name: Check for updates 🧐 run: npx npm-check-updates ``` @@ -115,4 +115,4 @@ This workflow uses `actions/checkout`, a standard action for cloning the repo in Note that **no** Node or Yarn action was used here - the default environment will set up Node.js and Yarn for you. Using an extension is useful if you want to lock down a certain Node.js version or run multiple versions in parallel example. See the [NPM][] recipes for using a matrix. -[NPM]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/node/npm.md %} +[NPM]: {% link recipes/ci-cd/github-actions/workflows/node/npm.md %} diff --git a/recipes/ci-cd/github-actions/workflows/node/npm.md b/recipes/ci-cd/github-actions/workflows/node/npm.md index 06c76e5f..1c7fc093 100644 --- a/recipes/ci-cd/github-actions/workflows/node/npm.md +++ b/recipes/ci-cd/github-actions/workflows/node/npm.md @@ -7,7 +7,7 @@ description: Patterns for using Node.js and NPM in a GH Actions workflow See the GH docs page on [Using Node.js with GitHub Actions](https://docs.github.com/en/actions/language-and-framework-guides/using-nodejs-with-github-actions). Some of the samples come from here. -To build a Node app (such as React or Vue) and serve it with GH Pages, see the [Deploy GH Pages]({{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/deploy-gh-pages/index.md %}) section of this cookbook site. +To build a Node app (such as React or Vue) and serve it with GH Pages, see the [Deploy GH Pages]({% link recipes/ci-cd/github-actions/workflows/deploy-gh-pages/index.md %}) section of this cookbook site. ## Set up Node action @@ -90,7 +90,7 @@ There are two recommended approaches here. Both require `package-lock.json` to b Built-in to `setup-node`, based on [doc](https://github.com/actions/setup-node#caching-packages-dependencies): -- `main.yml` +- `main.yml` ```yaml steps: - name: Checkout @@ -101,11 +101,11 @@ Built-in to `setup-node`, based on [doc](https://github.com/actions/setup-node#c with: node-version: '14.x' cache: 'npm' - + - name: Install dependencies run: npm install ``` - + Use a separate `cache` action, based on GH docs: - `main.yml` diff --git a/recipes/ci-cd/github-actions/workflows/node/upgrade-packages.md b/recipes/ci-cd/github-actions/workflows/node/upgrade-packages.md index 319ce62a..35439e62 100644 --- a/recipes/ci-cd/github-actions/workflows/node/upgrade-packages.md +++ b/recipes/ci-cd/github-actions/workflows/node/upgrade-packages.md @@ -7,7 +7,7 @@ The workflow recipes on this page let you use GH Actions to upgrade your NPM dep Run the workflow a schedule or on a manual trigger and GH Actions will do the upgrade for you on a branch with a PR. -You'll get changes to your lock files (`package-lock.json` and `yarn.lock`) and also sometimes to `package.json` (when using `npm` but not when using `yarn`). +You'll get changes to your lock files (`package-lock.json` and `yarn.lock`) and also sometimes to `package.json` (when using `npm` but not when using `yarn`). ## Why? @@ -33,13 +33,13 @@ This also effectively patches eagerly to newer versions even _before_ any vulner That should trigger a GH notification. Then you can review the PR changes yourself. -[Create Pull Request]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/create-pull-request.md %} +[Create Pull Request]: {% link recipes/ci-cd/github-actions/workflows/create-pull-request.md %} ### What you need to do 1. Pick one of the samples below, depending on basic/advanced and Node/Yarn. -1. Run the workflow manually on GH or on a schedule (such as weekly). -1. Review the PR. +1. Run the workflow manually on GH or on a schedule (such as weekly). +1. Review the PR. 1. If your usual CI test and build checks are passing, merge the PR. Or the close PR, then consider making up manual changes or just accept the old versions. @@ -110,7 +110,7 @@ So just change `npm` commands to use `yarn`. See [Yarn][] recipe for more help. -[Yarn]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/node/yarn.md %} +[Yarn]: {% link recipes/ci-cd/github-actions/workflows/node/yarn.md %} ### Advanced diff --git a/recipes/ci-cd/github-actions/workflows/node/yarn.md b/recipes/ci-cd/github-actions/workflows/node/yarn.md index eb84b8fe..94c21fa2 100644 --- a/recipes/ci-cd/github-actions/workflows/node/yarn.md +++ b/recipes/ci-cd/github-actions/workflows/node/yarn.md @@ -286,5 +286,5 @@ Find out more about deployment here: [GitHub Actions React Node post]: https://spin.atomicobject.com/2020/01/20/github-actions-react-node/ [Set up Node]: https://github.com/actions/setup-node -[Cache]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/cache.md %} -[Basic]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/node/basic.md %} +[Cache]: {% link recipes/ci-cd/github-actions/workflows/cache.md %} +[Basic]: {% link recipes/ci-cd/github-actions/workflows/node/basic.md %} diff --git a/recipes/ci-cd/github-actions/workflows/tweet/python.md b/recipes/ci-cd/github-actions/workflows/tweet/python.md index 2c8b8fad..b33ef403 100644 --- a/recipes/ci-cd/github-actions/workflows/tweet/python.md +++ b/recipes/ci-cd/github-actions/workflows/tweet/python.md @@ -22,7 +22,7 @@ Add files to your repo: - `requirements.txt` - `tweet.py` -[Tweet]: {{ site.baseurl }}{% link recipes/python/tweet.md %} +[Tweet]: {% link recipes/python/tweet.md %} ## Configure workflow diff --git a/recipes/ci-cd/netlify/index.md b/recipes/ci-cd/netlify/index.md index 167b6dff..2f7b2e48 100644 --- a/recipes/ci-cd/netlify/index.md +++ b/recipes/ci-cd/netlify/index.md @@ -32,7 +32,7 @@ Push changes to your repo to automatically trigger a build. See the [Configure][] section for how to configure a Netlify build. -[Configure]: {{ site.baseurl }}{% link recipes/ci-cd/netlify/configure/index.md %} +[Configure]: {% link recipes/ci-cd/netlify/configure/index.md %} ## Netlify vs GH Actions diff --git a/recipes/containers/docker/jekyll.md b/recipes/containers/docker/jekyll.md index 58cab4a9..0ccdf063 100644 --- a/recipes/containers/docker/jekyll.md +++ b/recipes/containers/docker/jekyll.md @@ -4,7 +4,7 @@ logo: jekyll description: How to run a Jekyll site in a container --- -Related recipe - [Jekyll in a container on GitHub Actions]({{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/jekyll/build/container.md %}). +Related recipe - [Jekyll in a container on GitHub Actions]({% link recipes/ci-cd/github-actions/workflows/jekyll/build/container.md %}). {% raw %} @@ -56,7 +56,7 @@ The docker command is just long to write, you probably want to use an alias, `Ma - The `--rm` flag will delete a container after it is run. Useful if you want to run the Jekyll container as an executable. Using volumes, the output will be persisted outside the container. But you should leave out the flag when you want to perist gems inside the container. - We use the `volume` flag so that we can mount the project in the container as `/srv/jekyll`. Any operations in the container like gems in `vendor` and output in `_site` are persisted on the host. -[Jekyll on GH Actions]: ({{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/jekyll/build/index.md %}) +[Jekyll on GH Actions]: ({% link recipes/ci-cd/github-actions/workflows/jekyll/build/index.md %}) ### Create new site diff --git a/recipes/go/index.md b/recipes/go/index.md index 5a8f70b2..fa569c01 100644 --- a/recipes/go/index.md +++ b/recipes/go/index.md @@ -6,7 +6,7 @@ logo: go ### Related sections -- [Go]({{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/go/index.md %}) recipe in GitHub Actions section. +- [Go]({% link recipes/ci-cd/github-actions/workflows/go/index.md %}) recipe in GitHub Actions section. ### Resources diff --git a/recipes/javascript/packages/vue/app-structure.md b/recipes/javascript/packages/vue/app-structure.md index 88232dcd..f7fb2014 100644 --- a/recipes/javascript/packages/vue/app-structure.md +++ b/recipes/javascript/packages/vue/app-structure.md @@ -1,6 +1,6 @@ # App structure -See also [Semantic HTML]({{ site.baseurl }}{% link recipes/web/html/outlines/semantic-html.md %}) page, which is not specific to Vue but gives recommendations for modern semantic HTML elements to use. +See also [Semantic HTML]({% link recipes/web/html/outlines/semantic-html.md %}) page, which is not specific to Vue but gives recommendations for modern semantic HTML elements to use. ## Basic without nav diff --git a/recipes/make/index.md b/recipes/make/index.md index 9ed1cc63..471aaa24 100644 --- a/recipes/make/index.md +++ b/recipes/make/index.md @@ -9,4 +9,4 @@ Make originally came from C background but I find it is a great fit for Python a This section is for use in the shell of Linux and macOS distros. If you use Windows, you'll need to install `make` yourself. -[Rake]: {{ site.baseurl }}{% link recipes/ruby/rake/index.md %} +[Rake]: {% link recipes/ruby/rake/index.md %} diff --git a/recipes/make/jekyll.md b/recipes/make/jekyll.md index d92523f8..081856e9 100644 --- a/recipes/make/jekyll.md +++ b/recipes/make/jekyll.md @@ -52,17 +52,17 @@ This is based on the [Makefile][] in my Jekyll Blog Demo project. See an equivalent Jekyll [Rakefile][] in the Ruby Rake recipes section. -[Rakefile]: {{ site.baseurl }}{% link recipes/ruby/rake/jekyll.md %} +[Rakefile]: {% link recipes/ruby/rake/jekyll.md %} #### Windows -See an equivalent Windows `make.bat` file below. This can presumably be run without `make` installed. +See an equivalent Windows `make.bat` file below. This can presumably be run without `make` installed. This was generated using the [Make-to-Batch](https://github.com/espositoandrea/Make-to-Batch) tool using `Makefile` as an input. This has not been tested but is included for interest and comparison.
make.bat - + ```bat @echo off @@ -160,4 +160,4 @@ Here we use a `make` variable set with the Docker `run` command and arguments, s $(DOCKER_RUN) jekyll build --trace ``` -[Jekyll]: {{ site.baseurl }}{% link recipes/containers/docker/jekyll.md %} +[Jekyll]: {% link recipes/containers/docker/jekyll.md %} diff --git a/recipes/nosql/mongo.md b/recipes/nosql/mongo.md index d285f8b1..30340990 100644 --- a/recipes/nosql/mongo.md +++ b/recipes/nosql/mongo.md @@ -4,4 +4,4 @@ - [Python Mongo recipes][] -[Python Mongo recipes]: {{ site.baseurl }}{% link recipes/python/mongo.md %} +[Python Mongo recipes]: {% link recipes/python/mongo.md %} diff --git a/recipes/other/editor-config.md b/recipes/other/editor-config.md index 984bd025..bbb569cd 100644 --- a/recipes/other/editor-config.md +++ b/recipes/other/editor-config.md @@ -38,7 +38,7 @@ Without using editor config, VS Code already lets you choose the indent level an When you use an editor config file and an extension in VS Code, then you get to set the indentation for all new and existing files. This takes preference over the VS Code's inference. -For using the Prettier extension, see the VS Code section of the [Prettier]({{ site.baseurl }}{% link recipes/javascript/format-and-lint/prettier.md %}) page. +For using the Prettier extension, see the VS Code section of the [Prettier]({% link recipes/javascript/format-and-lint/prettier.md %}) page. ## File format diff --git a/recipes/ruby/rake/jekyll.md b/recipes/ruby/rake/jekyll.md index b7381286..a706154d 100644 --- a/recipes/ruby/rake/jekyll.md +++ b/recipes/ruby/rake/jekyll.md @@ -4,7 +4,7 @@ Use `rake` to manage a static site project built with Jekyll. See also [Make Jekyll][] recipe for an equivalent `Makefile` version of this `Rakefile`. Though `make` is not standard on Windows. While if you have Ruby, you probably have `rake` too, on any OS. -[Make Jekyll]: {{ site.baseurl }}{% link recipes/make/jekyll.md %} +[Make Jekyll]: {% link recipes/make/jekyll.md %} ## Setup diff --git a/recipes/shell/ssh/access/allow-login-by-ssh-key.md b/recipes/shell/ssh/access/allow-login-by-ssh-key.md index ed2e3947..b3adae49 100644 --- a/recipes/shell/ssh/access/allow-login-by-ssh-key.md +++ b/recipes/shell/ssh/access/allow-login-by-ssh-key.md @@ -2,13 +2,13 @@ ## Why -This is secure as a machine is configured to accept SSH access from known public keys (which have the appropriate private key too). So that a password prompt is not given. +This is secure as a machine is configured to accept SSH access from known public keys (which have the appropriate private key too). So that a password prompt is not given. A password is much easier to crack than a long SSH key. And while you have to remember a password and type it, you don't have to enter a password for SSH because it is based on a trust. You can also add a password to an SSH key if you really want. This approach works best when login by password is also disabled - see another guide in this folder. See [Disable Password Login][] page. -[Disable Password Login]: {{ site.baseurl }}{% link recipes/shell/ssh/access/disable-password-login.md %} +[Disable Password Login]: {% link recipes/shell/ssh/access/disable-password-login.md %} ## Steps diff --git a/recipes/shell/ssh/github-ssh-access.md b/recipes/shell/ssh/github-ssh-access.md index c523bd7d..084e3f89 100644 --- a/recipes/shell/ssh/github-ssh-access.md +++ b/recipes/shell/ssh/github-ssh-access.md @@ -28,8 +28,8 @@ You can also use the SSH URL for any **public** repos by other people if you wan 1. Follow the [Install SSH][] recipe to install SSH itself. 2. Follow the [SSH keys][] recipe to generate a pair of SSH keys. -[Install SSH]: {{ site.baseurl }}{% link recipes/shell/ssh/install.md %} -[SSH keys]: {{ site.baseurl }}{% link recipes/shell/ssh/keys.md %} +[Install SSH]: {% link recipes/shell/ssh/install.md %} +[SSH keys]: {% link recipes/shell/ssh/keys.md %} ### 2. View keys @@ -62,4 +62,3 @@ e.g. ```sh $ git clone git@github.com:MichaelCurrin/code-cookbook.git ``` - diff --git a/recipes/shell/ssh/index.md b/recipes/shell/ssh/index.md index 3ea5b847..355e436b 100644 --- a/recipes/shell/ssh/index.md +++ b/recipes/shell/ssh/index.md @@ -13,7 +13,7 @@ The least you need to know: See the [Install][] page. -[Install]: {{ site.baseurl }}{% link recipes/shell/ssh/install.md %} +[Install]: {% link recipes/shell/ssh/install.md %} ### Check current setup diff --git a/recipes/shell/upgrade-packages.md b/recipes/shell/upgrade-packages.md index ad19f607..58ad3706 100644 --- a/recipes/shell/upgrade-packages.md +++ b/recipes/shell/upgrade-packages.md @@ -9,7 +9,7 @@ description: A convenient way to upgrade all your project packages with one comm - [Upgrade packages][] for a Node app using GitHub Actions for automation. -[Upgrade packages]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/node/upgrade-packages.md %} +[Upgrade packages]: {% link recipes/ci-cd/github-actions/workflows/node/upgrade-packages.md %} ## Configure @@ -84,4 +84,3 @@ $ git-deps ``` Assuming you don't have any unrelated change that would get unintentionally committed too. - diff --git a/recipes/version-control/github/ssh.md b/recipes/version-control/github/ssh.md index 7aa81b74..d8384c7e 100644 --- a/recipes/version-control/github/ssh.md +++ b/recipes/version-control/github/ssh.md @@ -6,4 +6,4 @@ description: How to set up SSH keys locally and on GitHub so you can push and pu See [GitHub SSH Access][] recipe in the Shell section. -[GitHub SSH Access]: {{ site.baseurl }}{% link recipes/shell/ssh/github-ssh-access.md %} +[GitHub SSH Access]: {% link recipes/shell/ssh/github-ssh-access.md %} diff --git a/recipes/web/check-links/html-proofer.md b/recipes/web/check-links/html-proofer.md index 0708ef21..e7487a2f 100644 --- a/recipes/web/check-links/html-proofer.md +++ b/recipes/web/check-links/html-proofer.md @@ -19,8 +19,8 @@ You can run this on any directory of static HTML files, locally or with CI. - [Install gems and run][] - generic recipe for setting up Ruby and gems on GH Actions. - [HTML Proofer GH Actions][] recipe in the GH Actions section. -[Install gems and run]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/ruby/install-gems-and-run.md %} -[HTML Proofer GH Actions]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/check-links/html-proofer-generic.md %} +[Install gems and run]: {% link recipes/ci-cd/github-actions/workflows/ruby/install-gems-and-run.md %} +[HTML Proofer GH Actions]: {% link recipes/ci-cd/github-actions/workflows/check-links/html-proofer-generic.md %} ## Install diff --git a/recipes/web/check-links/index.md b/recipes/web/check-links/index.md index 1bea9a56..ff6f67bb 100644 --- a/recipes/web/check-links/index.md +++ b/recipes/web/check-links/index.md @@ -9,4 +9,4 @@ You can set up these tools to run locally or on GH Actions. - [Check links][] recipes in the GitHub Actions section. -[Check links]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/check-links/index.md %} +[Check links]: {% link recipes/ci-cd/github-actions/workflows/check-links/index.md %} diff --git a/recipes/web/check-links/markdown-link-check.md b/recipes/web/check-links/markdown-link-check.md index 46861b00..590609bc 100644 --- a/recipes/web/check-links/markdown-link-check.md +++ b/recipes/web/check-links/markdown-link-check.md @@ -10,7 +10,7 @@ An NPM package to check links in Markdown files. See [GitHub Action Markdown Link Check][] recipe in the GitHub Actions section. -[GitHub Action Markdown Link Check]: {{ site.baseurl }}{% link recipes/ci-cd/github-actions/workflows/check-links/gh-action-md-link-check.md %} +[GitHub Action Markdown Link Check]: {% link recipes/ci-cd/github-actions/workflows/check-links/gh-action-md-link-check.md %} ## Run NPM CLI tool diff --git a/recipes/web/html/accordion.md b/recipes/web/html/accordion.md index a140d3f1..d34868ec 100644 --- a/recipes/web/html/accordion.md +++ b/recipes/web/html/accordion.md @@ -7,13 +7,13 @@ Plain HTML, no CSS or JS. ```html
Heading 1 - + My content
Heading 2 - + More content
``` @@ -30,4 +30,4 @@ See W3 schools tutorials: See [Accordion][] in the jQuery section. -[Accordion]: {{ site.baseurl }}{% link recipes/javascript/packages/jquery/accordion.md %} +[Accordion]: {% link recipes/javascript/packages/jquery/accordion.md %} From 57eae3f8c153f07fa4e92af4bcac1ac4a81cd223 Mon Sep 17 00:00:00 2001 From: Michael Currin <18750745+MichaelCurrin@users.noreply.github.com> Date: Sat, 27 Nov 2021 19:07:58 +0200 Subject: [PATCH 08/14] fix: update recipes/ci-cd/github-actions/workflows/jekyll/build/index.md --- recipes/ci-cd/github-actions/workflows/jekyll/build/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/ci-cd/github-actions/workflows/jekyll/build/index.md b/recipes/ci-cd/github-actions/workflows/jekyll/build/index.md index 8276212c..e8eb7f54 100644 --- a/recipes/ci-cd/github-actions/workflows/jekyll/build/index.md +++ b/recipes/ci-cd/github-actions/workflows/jekyll/build/index.md @@ -21,7 +21,7 @@ That approach without GitHub Actions is much simpler. The downside is that you a - [Deploy GH Pages][] as a more generic section which could still be used for Jekyll. - [Jekyll container][] page. -[GH Pages Actions]: {% link recipes/ci-cd/github-actions/workflows/jekyll/gh-pages-actions.md %} +[GH Pages Actions]: {% link recipes/ci-cd/github-actions/workflows/jekyll/build/gh-pages-actions.md %} [Deploy GH Pages]: {% link recipes/ci-cd/github-actions/workflows/deploy-gh-pages/index.md %} [Jekyll container]: {% link recipes/containers/docker/jekyll.md %} From e90cd7fe8bc330e2c336ae799d7f38989b8f878c Mon Sep 17 00:00:00 2001 From: Michael Currin <18750745+MichaelCurrin@users.noreply.github.com> Date: Sat, 27 Nov 2021 19:10:41 +0200 Subject: [PATCH 09/14] update jekyll-actions-action.md --- .../workflows/jekyll/build/jekyll-actions-action.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/ci-cd/github-actions/workflows/jekyll/build/jekyll-actions-action.md b/recipes/ci-cd/github-actions/workflows/jekyll/build/jekyll-actions-action.md index a7e5edf1..45f2292b 100644 --- a/recipes/ci-cd/github-actions/workflows/jekyll/build/jekyll-actions-action.md +++ b/recipes/ci-cd/github-actions/workflows/jekyll/build/jekyll-actions-action.md @@ -1,4 +1,4 @@ -# Use the Jekyll Actions action +# Jekyll Actions action {% raw %} From 609a59a219c192832f5abd40d1ecaf6cad12a614 Mon Sep 17 00:00:00 2001 From: Michael Currin <18750745+MichaelCurrin@users.noreply.github.com> Date: Sat, 27 Nov 2021 19:10:53 +0200 Subject: [PATCH 10/14] fix: update container.md --- .../ci-cd/github-actions/workflows/jekyll/build/container.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/ci-cd/github-actions/workflows/jekyll/build/container.md b/recipes/ci-cd/github-actions/workflows/jekyll/build/container.md index 7e95d0db..392c41dc 100644 --- a/recipes/ci-cd/github-actions/workflows/jekyll/build/container.md +++ b/recipes/ci-cd/github-actions/workflows/jekyll/build/container.md @@ -5,7 +5,7 @@ Related recipe - [Jekyll][] in the Container section. This flow runs a **Docker container**. If you don't want to use Docker, see [Jekyll Ruby Action][], which is a light approach. [Jekyll]: {% link recipes/containers/docker/jekyll.md %} -[Jekyll Ruby Action]: {% link recipes/ci-cd/github-actions/workflows/jekyll/build/ruby-action.md %} +[Jekyll Ruby Action]: {% link recipes/ci-cd/github-actions/workflows/jekyll/build/generic.md %} {% raw %} From ee9531992f91b610514f7e0bbe252d93fb2bb473 Mon Sep 17 00:00:00 2001 From: Michael Currin <18750745+MichaelCurrin@users.noreply.github.com> Date: Sat, 27 Nov 2021 19:31:07 +0200 Subject: [PATCH 11/14] update exports.md --- recipes/make/exports.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/recipes/make/exports.md b/recipes/make/exports.md index a68b1b8c..b2072f00 100644 --- a/recipes/make/exports.md +++ b/recipes/make/exports.md @@ -20,25 +20,28 @@ I don't know if these defaults are actually used here. include defaults.mk check-env : - @echo "ENVIRONMENT is only 'prod'. And needed for backwards compatibility. Exporting... "; - @export ENVIRONTMENT=prod; - @if [ -z $(PROGRAM) ]; then \ - echo "PROGRAM must be set; export PROGRAM="; exit 10; \ - fi + @echo "ENVIRONMENT is only 'prod'. And needed for backwards compatibility. Exporting... "; + @export ENVIRONMENT=prod; + @if [ -z $(PROGRAM) ]; then \ + echo "PROGRAM must be set; export PROGRAM="; exit 10; \ + fi ``` ## StackOverflow sample [link](https://stackoverflow.com/questions/24263291/define-a-makefile-variable-using-a-env-variable-or-a-default-value) +Use lines here start with a colon to print only and not execute. + - `Makefile` ```Makefile T ?= foo + all: - : '$(T)' + : '$(T)' ``` -```sh +```console $ make : 'foo' @@ -65,11 +68,9 @@ $ make TMPDIR=foo foo ``` - - For debugging, check the value of the token. -B. Only run this on a remote if the logs are private, so no one steals your token on a PR preview. GitHub now hides secrets, does Netlify? Should builds be restricted to only PRs by me and not forks to avoid someone making a preview that expposes a token? The easiest is just private logs. +B. Only run this on a remote if the logs are private, so no one steals your token on a PR preview. GitHub now hides secrets, does Netlify? Should builds be restricted to only PRs by me and not forks to avoid someone making a preview that exposes a token? The easiest is just private logs. ```Makefile export GITHUB_TOKEN := $(if $(GITHUB_TOKEN), $(GITHUB_TOKEN), '') From 416675f1b89a0c8dba06997863aaa8ef14f1f764 Mon Sep 17 00:00:00 2001 From: Michael Currin <18750745+MichaelCurrin@users.noreply.github.com> Date: Sat, 27 Nov 2021 19:32:28 +0200 Subject: [PATCH 12/14] docs: update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b6514883..720b8a67 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![GitHub tag](https://img.shields.io/github/tag/MichaelCurrin/code-cookbook?include_prereleases&sort=semver)](https://github.com/MichaelCurrin/code-cookbook/releases/) [![License](https://img.shields.io/badge/License-MIT-blue)](#license) -[![Jekyll - 3.9](https://img.shields.io/badge/Jekyll-3.9-blue?logo=jekyll&logoColor=white)](https://jekyllrb.com) +[![Jekyll](https://img.shields.io/badge/Jekyll-4-blue?logo=jekyll&logoColor=white)](https://jekyllrb.com) [![theme - fractal](https://img.shields.io/static/v1?label=theme&message=fractal&color=blue&logo=github)](https://github.com/MichaelCurrin/fractal) [![Hosted with - GitHub Pages](https://img.shields.io/badge/Hosted_with-GitHub_Pages-blue?logo=github&logoColor=white)](https://pages.github.com/) From a3599d1f97b81ff21ec7d4db66d1f070a4b6b834 Mon Sep 17 00:00:00 2001 From: Michael Currin <18750745+MichaelCurrin@users.noreply.github.com> Date: Sat, 27 Nov 2021 19:32:34 +0200 Subject: [PATCH 13/14] docs: update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 720b8a67..94caa24e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Code Cookbook 👩‍💻👨‍🍳📖🥗 > Reusable code patterns which you can use as reference or copy to your project +[![GH Pages Deploy](https://github.com/MichaelCurrin/code-cookbook/workflows/GH%20Pages%20Deploy/badge.svg)](https://github.com/MichaelCurrin/code-cookbook/actions?query=workflow:"GH+Pages+Deploy") [![GitHub tag](https://img.shields.io/github/tag/MichaelCurrin/code-cookbook?include_prereleases&sort=semver)](https://github.com/MichaelCurrin/code-cookbook/releases/) [![License](https://img.shields.io/badge/License-MIT-blue)](#license) From 77a9b7aa7d266889411d195e0be369170d267254 Mon Sep 17 00:00:00 2001 From: Michael Currin <18750745+MichaelCurrin@users.noreply.github.com> Date: Sat, 27 Nov 2021 19:33:05 +0200 Subject: [PATCH 14/14] docs: update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 94caa24e..7038ca54 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@
-[![View site - GH Pages](https://img.shields.io/static/v1?label=View+site&message=GH+Pages&color=2ea44f&style=for-the-badge)](https://michaelcurrin.github.io/code-cookbook/) +[![View site - GH Pages](https://img.shields.io/static/v1?label=View+site&message=GH+Pages&color=2ea44f&style=for-the-badge)](https://michaelcurrin.github.io/code-cookbook/ "Go to website")