andrewvy / nima

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

HTML Templating #2

Open andrewvy opened 9 years ago

andrewvy commented 9 years ago

https://github.com/onionhammer/nim-templates

Pages are static layouts. Posts are based off of single.html. Posts are exposed via a Posts object which you can iterate over in your main page template layout.

Layouts must be parsed to find if they have partials in them. If they do, insert the HTML from partial into that layout file.

Partials cannot have embedded partials. (future?)

andrewvy commented 9 years ago

Most of this is done, but we need a way to render template data. Probably have a render proc that takes the template string + data args, and uses nim-templates to render it out.

EDIT: Looks like nim-templates doesn't support using a string as a template, the string must be directly instantiated after.