π Table of Contents
An starter project for Eleventy with an opinionated workflow β Keeping Eleventy in control of the entire development and build processes.
gh repo clone edheltzel/flightdeck flightdeck && cd flightdeck && bun install && bun start
Build your project
bun run build
The Flightdeck objective is to provide a unified starting point for all your Jamstack websites, by leveraging popular static-site-generators (SSG).
This flavor of Flightdeck uses Eleventy with an opinionated workflow without the support additional tools like Webpack, Parcel, or Gulp. This is to keep things simple and to keep Eleventy in control of the entire development and build processes.
Like other versions of Flightdeck, this is just an adaptation of the original Flightdeck project that uses Jekyll for its static site generation and Gulp for all assets bundling. βΊβΊβΊ π« For other versions of Flightdeck, π look here
JΓ©rΓ΄me CoupΓ©'s post Structuring Eleventy Projects served as inspiration for how this project is structured and over-time, things will shift as ideas change, but in 2022, we are shamelessly adopting the concept JΓ©rΓ΄me CoupΓ© outlines.
All version of Flightdeck use NodeJS. So a very minimal and basic knowledge of Node and Git should be had when using Flightdeck as your launchpad.
In the future, we plan to include Docker and make all Flightdeck starters available as a Yeoman and/or NPM package.
We are assuming that you already have Node with NPM (or another package manger, like Bun/Pnpm/Yarn) and Git installed on your system βΒ it is also ideal that you have the latest LTS release of Node. As of this writing the current LTS release is 20.12.2
Package managers are like dotfiles, everyone has their own preference.
We have shifted to using Bun as our primary package manager.
But, you can swap bun
in favor of your preferences π NPM , Yarn, and and Pnpm. Use whatever you want π just be sure to update the preview
script in package.json
with what ever flavor you choose to use.
It's highly recommended that you enable Node's corepack, this way Yarn and PNPM are included in your toolbox without the need to install them separately.
Please be aware that this certainly won't be the most recent version of PNPM/Yarn.
-
pnpm and yarn
corepack enable corepack prepare pnpm@latest --activate corepack prepare yarn@latest --activate
β Installation
Using git
in the terminal:
git clone https://github.com/edheltzel/flightdeck.git
cd flightdeck
bun install
Using gh
in the terminal:
gh repo clone edheltzel/flightdeck
cd flightdeck
bun install
see all dependencies
bun pm ls /Users/ed/Developer/personal/flightdeck/for-11ty-esbuild node_modules (583) βββ @11ty/eleventy@2.0.1 βββ @11ty/eleventy-img@4.0.2 βββ @11ty/eleventy-navigation@0.3.5 βββ @11ty/eleventy-plugin-syntaxhighlight@5.0.0 βββ @alpinejs/persist@3.13.8 βββ @biomejs/biome@1.6.4 βββ alpinejs@3.13.8 βββ browserslist@4.23.0 βββ eleventy-plugin-embed-everything@1.18.2 βββ esbuild@0.20.2 βββ fast-glob@3.3.2 βββ html-minifier@4.0.0 βββ lightningcss@1.24.1 βββ lightningcss-cli@1.24.1 βββ markdown-it@14.1.0 βββ markdown-it-attrs@4.1.6 βββ stylelint@16.3.1 βββ stylelint-config-standard@36.0.0
There are just a few npm-:150
available, but the start
command is where all the magic πͺ happens βΒ it will spin up the development server from Eleventy.
Again, the focus here is to keep Eleventy in control of the entire development and build processes, to keep things simple.
pnpm start
Available Run Commands
package.json scripts (11 found):$ bun run start eleventy --serve
$ bun run build pnpm run clean && pnpm run build:11ty
$ bun run build:11ty cross-env ENV=production eleventy
$ bun run debug DEBUG=Eleventy* eleventy
$ bun run preview bunx http-server dist -p 4000
$ bun run check biome check
$ bun run format biome format
$ bun run lint biome lint
$ bun run lint:css stylelint "src/**/*.css" --fix
$ bun run clean ./.scrub.sh site
$ bun run purge ./.scrub.sh purge
build
command - executes the production build of your site with Eleventy, includes HTML minification, compressed Sass, optimized images, and bundled javascript.- for our workflow, Cloudflare handles the DNS while Cloudflare Pages does the building and hosting - Cloudflare's Auto Minify minifies the HTML, CSS, and JS. You can easily add minification to the build process by adding a plugin to Eleventy.
preview
command - spins up a local server to preview the production build.check
command - runs biome lint and format at the same time JS/TS, seebiome.json
.- ie:
bun run check ./src/assets/js/app.js
- ie:
format
command - uses biome to format JS/TS, seebiome.json
.- ie:
bun run format ./src/assets/js/app.js
- ie:
lint
command - uses biome to lint JS/TS, seebiome.json
.- ie:
bun run lint ./src/assets/js/app.js
- ie:
lint:css
command - uses stylelint to find issues in your css.clean
command - scrubs/removes thedist/
and.cache
directoriespurge
command - scrubs/removes thedist/
,.cache
,node_modules
, and any lock files from npm, yarn, pnpm or bun. - π§Ό A fresh install.- π NOTE: Both
clean
andpurge
are executed from a bash script
- π NOTE: Both
upgrade
command - usesbunx npm-check-updates -ui
to upgrade dependencies to their latest versions and updates thepackage.json
- this is a work around forbun upgrade
not working as expected or how other package managers work.
Deployments for this project are completely up to you and your needs, we are fans of Cloudflare Pages, which is why you'll find a .node-version
file, Cloudflare Pages currently supports Node v18.17.1. Some other really good and popular options are GitHub Pages, Vercel, Netlify, and Render. Your call on what you use.
Don't forget to create your own .env
with whatever environment variables you need for your project.
Flightdeck is a very opinionated starter kit, so the file structure is very specific to our needs. All the Eleventy configuration is done in the .eleventy.js
file, but it is broken down into sections for easier navigation and maintain. All Eleventy configuration options are available, see the Eleventy Docs for more information.
File Structure
. βββ _flightdeck β βββ filters β βββ shortcodes β βββ transforms βββ src βββ _includes β βββ components β βββ data β βββ layouts β βββ macros β βββ partials β βββ utilities βββ _static βββ assets β βββ fonts β βββ images β β βββ spacex [optional] β βββ js β β βββ modules β β βββ alpineModules β β βββ visualGuidanceSystem β βββ styles β βββ _autopilot β β βββ _base β β βββ _components β β βββ _layouts β β βββ _utilities β β βββ _vendors βββ collections βββ blog βββ pages
The core concept of Flightdeck to keep 11ty in charge of all the DX so you can focus on creating content.
Flightdeck makes a lot of assumptions and is very opinionated - but having a good idea of how Eleventy's data cascade works is always nice, as well as having some understanding on template inherence in Nunjucks will go a long way. But is not needed
For making changes to the way Flightdeck pilots Eleventy, you will want to reference the ./_flightdeck
directory. This is where all the Eleventy configuration is done, but it is broken down into sections for easier navigation and maintainability.
Inside the ./_flightdeck
directory, you will find the following directories:
./_flightdeck/filters
- where all Universal filters are added to Eleventy templates. Currently we use Nunjucks for our templates, so all filters are added to the Nunjucks environment, but are easily adapted to other template engines, like Liquid../_flightdeck/shortcodes
- where all shortcodes are added to extend the functionality of the content you are creating. We consider shortcodes content altering and not UI focused. The idea is to create shortcodes that make writing content easier and more enjoyable../_flightdeck/transforms
- where all transforms are added to templates, javascript, styles, and images.
All the directories have a corresponding file that is used to import all the files in the directory. Each of these files are imported into .eleventy.js
as modules.
./_flightdeck/filters.js
./_flightdeck/plugins.js
- this file controls Eleventy plugins that modify content../_flightdeck/shortcodes.js
./_flightdeck/transforms.js
./_flightdeck/workflow.js
- this file controls the Eleventy dev server.
Flightdeck comes with a custom image transform plugin that watches for changes in the ./src/assets/images
directory and then optimizes any new or changed images, copies it to the output destination directory ./dist/assets/images
. Since we are using the the Eleventy Image Plugin under-the-hood, it is smart enough to know if an image has already been optimized, we don't need to worry about that. Just set it and forget it.
PLEASE NOTE: This feature does add a little overhead to the initial build process, which is why it is disabled by default.
If you would like the enable this feature just set useImageDirTransform: true
in .eleventy.js
and you're good to go.
All Eleventy configuration options are available, see the Eleventy Docs for more information.
If you're looking to extend or further configure your project with other NPM modules, Eleventy plugins, or ESBuild Plugins, just reference the appropriate documentation.
If you'd rather write scss, please install sass
and eleventy-plugin-sass
and update the transform.js
file to use the module. You'll need to remove the lightingcss module and update the styles
directory to your scss files.
bun install sass eleventy-plugin-sass
WIP Autopilot, is a custom minimal css framework for semantic HTML.
The goal of Autopilot, is to provide a simple, yet powerful, set of default styles to help build your UI components.
- Improve documentation
- Create a theme using Autopilot UI Components
- Add Dockerfile
- Add Yeoman generator/npm package
- Add our Eleventy plugins
- create layout with new grid system
- improve nunjucks layouts and partials
- document the new grid system
- review lightncingcss for more performance options
- replace scss with lightncingcss
- combine autopilot and declarative scaffold
- update naming convention to be consistent
- update layouts to use sematic markup for containers
- add utility classes for grid correctly
- update the style guide to use the grid utility classes
See the open issues for a full list of proposed features (and known bugs/issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the WTFPL License. See LICENSE
for more information.