Last year, I released my Elm-to-Html static site generator, Elmstatic.
As it relied on
elm-static-html-lib (which I wrote about), I had to wait for this library to be updated to Elm 0.19 first. However, the update didn’t happen, possibly because it relied on the now defunct Elm native modules, or because the author has moved on to other things.
I finally rolled up my sleeves and came up with a different solution, changing a lot of the inner workings in the process.
The current set of features is:
htmlor any other package that generates
elm-cssstylesheets in Elm code (but you can use plain old stylesheets if you like)
Elmstatic remains an early stage project for now: error handling is limited, and I haven’t done any performance optimisation. However, I’m using it for korban.net, so it’s not just a prototype!
Compared to the previous version (0.3.4), the workflow remains largely the same, but the way the content and code is organised has changed:
elm-ui, the scaffold generated by
elm-cssin order to provide a responsive template. You’re still free to use
elm-uior any other package that produces
Html msgvalues, however.
config.jsoninstead of Elm code, as this is simpler.
Note: these changes are not backwards compatible with v0.3.4.
You can install Elmstatic from NPM:
$ npm install -g elmstatic
elmstatic init in a directory will generate a site scaffold. Change the generated files to your liking, then generate the output by simply running
elmstatic without arguments.
Finally, run an HTTP server in the output directory to check out the result:
$ cd _site $ http-server
For more details:
My book, Practical Elm for a Busy Developer, skips the basics and gets right into explaining how to do practical stuff. Things like building out the UI, communicating with servers, parsing JSON, structuring the application as it grows, testing, and so on. No handholding — the focus is on giving you more substance.
It’s up to date with Elm 0.19.
Pop in your email to get a sample chapter.
(You will also get notifications of new posts along with other mailing list only freebies.)