Essential Files
.github/workflows/eleventy.ymla GitHub Action that converts the Markdown files in this repository into an HTML site checked into thegh-pagesbranch.package.jsontells our GitHub Action how to setup our site generatoreleventy/11ty..eleventy.jsconfigures the11tysite generator..eleventyignoretells11tyfiles to not use when building the HTML site..nojekylltells GitHub that we are not using the Jekyll site generator._includes/layout.njkour first template file used by11tyto add the HTML header and footer to each page.
Setting up the GitHub Action
We followed these guides:
- 11ty guide by Lea Tortay,
- GitHub pages deployment by Daniel Marino
- generating GitHub Deployment keys
Be sure to ensure that the source branch under Settings/Pages is set to gh-pages.
Testing Locally
See Eleventy usage for more details.
- Setup eleventy locally
npm install @11ty/eleventy
- Serve the site locally to your local brower.
npx @11ty/eleventy --serve
- Note that the site rebuilds via GitHub action automatically when a branch is merged.
Resolving GitHub Dependabot Alerts
Use the npm update and npm audit commands to update any JavaScript libraries
that 11ty depends on.
npm update
npm audit fix
This recipe should result in updates to package-lock.json and package.json,
which should be checked into git and merge to the main branch.
It may be necessary to use
npm audit fix --force. If so, be sure to double check that the pages still render correctly.