-
Notifications
You must be signed in to change notification settings - Fork 60
Open
Labels
Description
Currently the compiler has quite a bit of io spread out in many functions. It would be nice to refactor it into three distinct phases.
- reading posts, pages and the config into a data-structure
- transforming that data structure into a new one
- writing the transformed data structure to disk
All the difficult things are moved into the pure middle part, which becomes a lot more convenient to test and nicer to work with in general. (It's probably not necessary to be militant about purity, the printlns that are scattered around are kind of nice.)
The output data structure could be a map from url to finished html. There's a quite nice library that takes a data structure like that and either writes it to disk or serves it locally with ring. Using that we could save quite a bit of code in the compiler and, more importantly, code in the template.
It also has some other niceties.
- Reporting on conflicting urls.
- Reporting on differences in the built files.
Any thoughts on this?