- Install WSL and enable WSL2.
- Ensure everything is up to date from the WSL prompt:
sudo apt update sudo apt upgrade sudo apt install build-essential
- Install Node:
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash
- Navigate to your home folder:
cd ~
- Create a folder for your first Eleventy site:
mkdir eleventy-site
- Navigate to this new folder:
cd eleventy-site
- Use configure this folder for use with npm:
npm init -y
- Use
npm
to install Eleventy into this folder:npm install --save-dev @11ty/eleventy
- Set the folder as a git repo:
git init .
- Have git ignore certain files:
touch .gitignore
- Edit the
.gitignore
file:code .gitignore
- Add the following lines to the
.gitignore
file and save it:_site node_modules
- Create your first 11ty template:
echo '<!doctype html><html><head><title>Page title</title></head><body><p>Hi</p></body></html>' > index.html
- Save everything to git:
git add . git commit -m 'Initial commit'
- Fire up the 11ty live server:
npx @11ty/eleventy --serve
- View your new website: http://localhost:8080
Created
February 4, 2022 04:35
-
-
Save stungeye/da23f4ca7a256649a26082ce0f738d1f to your computer and use it in GitHub Desktop.
Getting Started with Eleventy using WSL 2
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment