Project starter to spin up a static site when you don't need a js framework.
The scaffold includes:
The Eleventy static site generator
New, but it has a few things going for it including (1) the flexibility to choose from a ton of template languages and (2) it's written in JS, so there's no dependency on Ruby or Go.
-
Compile Sass to CSS and process with postcss
-
TODO: Decide on a scripts strategy. Do we use webpack, or simply concat files together?
-
TODO: Images optimization with imagemin
-
Live reloading and mobile mirroring with browsersync
You can use tpl to quickly start a new project with this (or any other) scaffold from Github.
# install tpl
npm install -g @jmegs/tpl
# or
yarn global add @jmegs/tpl
# start your project
tpl jmegs/static-starter YOUR_PROJECT
-
Clone the repo and clean up its git brain (remove my git repo and start a new blank one).
# clone the repo without its full history. git clone --depth 1 https://github.com/jmegs/static-starter.git YOUR_PROJECT cd YOUR_PROJECT # remove existing git information and create a new repository. rm -rf .git && git init
-
Install dependencies. Grab a coffee. Breathe deeply.
yarn # or npm install
-
Start the development server. All changes will be processed and your site will automatically reload on http://localhost:3000
yarn start # or npm start
-
When you're done, build the project and deploy
dist/
somewhere awesome. I like Netlify and Zeit's Now.yarn build # or npm run build
- Pages and content live in
src
where they will be compiled by the static site generator. - Any data files placed in
src/_data
will be available to all pages insidesrc
- CSS, JS, images, and fonts live in their own folders in
assets/
where they will be processed by gulp and placed lovingly intodist
. - Built output lives in
dist