(no title)
telesoft | 3 years ago
The way I use the standard library is like a super condensed version of React. Templates are my components. Since templates can be nested, templates can be used to build "components" and those components can be stored in separate files and compiled together at run time with a "model" being fed to the template(s) via a state object passed by the application.
So I may have a few dozen template files in a folder called /components, and another folder called /pages with a few templates that use these components. When a user visits a "page", the template file is "compiled" with the appropriate components.
A page might look like this:
<html>
{{template "nav"}}
{{template "thread" .Thread}}
{{template "footer"}}
</html>
And "nav", "thread", and "footer" are all components defined in another file. This allows for re-use across multiple pages.I want to do a write-up on it but I'm not sure if it's a novel idea.
tusharsoni|3 years ago
But the tldr is - you'll need a lot more than just templating for a production ready app. To name a few things - server, storage, migrations, logging, configs. IMO there's a huge benefit in having a batteries included toolkit that stays close to the stdlib - so you can totally keep your templates as is!
[1] https://vimeo.com/723537998
morelisp|3 years ago
skinnyarms|3 years ago
pram|3 years ago