andrewvy / nima

Static website generator in Nim
MIT License
4 stars 1 forks source link

Refactor to use Files instead of custom file type #5

Closed andrewvy closed 9 years ago

andrewvy commented 9 years ago

That's what they're supposed to be used for!

That way we can buffer and mark files that contain partials as we're reading them from the file, rather than importing all files into memory.

How we can do this:

We skip reading the partials folder/files until we've properly marked the other files. Then, we read the partials and inject them where we need to.

READ index.html Found partial header.html at line 2

READ partials/header.html partials/header.html is needed at index.html line 2 REPLACE index.html buffer at line 2 with contents of partials/header.html

andrewvy commented 9 years ago

:+1: it is done, started with https://github.com/andrewvy/nima/commit/8ff1bee418cdebccf39191d9d7f5ba1ad2b5e7e1