Getting Started
This is a template repo that contains some scripts and other code to create a basic static site using EJS. It contains a development environment as well as scripts to automatically rebuild the site based on changes.
Clone the repo, using it as a template.
Make sure you have Docker installed.
dx/build
dx/start
In another terminal,
dx/exec bin/setup
In that same other terminal,
dx/exec bin/dev
Open
http://localhost:5555
in your browser.
What's What
All files for your site are inside src/
:
-
src/assets
should contain any non-CSS, non-HTML, non-image files, e.g. PDFs. -
src/css/index.css
contains your CSS. By default, it references the MelangeCSS library installed by default. You can change that and remove it frompackage.json
if you like. -
src/html
is the root of the site. This files, except forsrc/html/templates
, will be processed through EJS to produce the site. Any file with a.html
extension will be processed.-
src/html/templates
contain re-usable templates or partials for your EJS. By default,src/html/templates/head.html
is here, and it is referenced bysrc/html/index.html
as an example of what to do.
-
-
src/images
will be copied to/images
in your site. Any file is copied.-
src/images/icons/icon.png
is your favicon. This will be turned into/favicon.ico
,/iamges/icons/icon-180.png
,/iamges/icons/icon-192.png
, and/iamges/icons/icon-512.png
automatically.icon-180.png
is referenced insrc/html/templates/head.html
, and the other two are referenced in the webmanifest, which is created automatically.
-
-
src/js/index.js
contains your JavaScript. It's built by esbuild, so you can useimport
or whatever.
That's One Helluva Toolchain
This brings together a meager, but effective, toolchain.
-
make
orchestrates everything via theMakefile
. -
EJS provides dynamic template-construction.
-
chokidar watches for changes and re-builds everything.
-
esbuild handles building CSS and JS.
-
http-server serves it up locally.
Deploying
This depends on how you deploy. You will need to modify bin/deploy
to suit your needs Currently it does bin/build production
, which will put all the files in site/production
.