17 ms·
I edit my HTML templates in the templates/ directory. Then I use this little Ruby script to sync them into the database, which is where they're actually used:
by sivers 11mo ago
I edit my HTML templates in the templates/ directory.
Then I use this little Ruby script to sync them into the database, which is where they're actually used:
https://github.com/sivers/sivers/blob/master/scripts/template-sync.rb https://github.com/sivers/sivers/blob/master/scripts/templat...
I haven't done HTMX fragments yet. This repository is quite new, and only like 5% done.
- hatefulheart 11mo agoHey, Thanks for your response. I didn’t explain myself properly. Suppose I have a html template that contains the dynamic value {{ foo }}, that template is on my SQLDB, how do I populate {{ foo }} whilst querying the template table? I hope that makes more sense.
- sivers 11mo agoAh, sorry. I misunderstood. The parser for Mustache templates - https://mustache.github.io/ https://mustache.github.io/ - is in the PostgreSQL functions. See it in practice here in the unit tests: https://github.com/sivers/sivers/blob/master/omni/test/template.sql https://github.com/sivers/sivers/blob/master/omni/test/templ... https://github.com/sivers/sivers/blob/master/omni/test/must_template.sql https://github.com/sivers/sivers/blob/master/omni/test/must_... It comes from these three functions, but really only using the top-level "o.template" function: https://github.com/sivers/sivers/blob/master/omni/template.sql https://github.com/sivers/sivers/blob/master/omni/template.s... https://github.com/sivers/sivers/blob/master/omni/must_template.sql https://github.com/sivers/sivers/blob/master/omni/must_templ... https://github.com/sivers/sivers/blob/master/omni/must_sections.sql https://github.com/sivers/sivers/blob/master/omni/must_secti... I'm using it for https://nownownow.com/ https://nownownow.com/ and https://my.nownownow.com/ https://my.nownownow.com/ already. Example test: https://github.com/sivers/sivers/blob/master/nnn/test/mynow-welcome.sql https://github.com/sivers/sivers/blob/master/nnn/test/mynow-...
- hatefulheart 11mo agoThank you very much!