4 ms·
I'm not a web dev so my knowledge is limited here. What is the canonical way to do "components" with this htmx workflow though? How do you create an abstractio
by jdmoreira 3y ago
I'm not a web dev so my knowledge is limited here.
What is the canonical way to do "components" with this htmx workflow though? How do you create an abstraction for a button, or a card, etc...
Do you just copy/paste the html all the time?
Is it just BE templates?
- llmblockchain 3y agoThe same you always have? With HTML/CSS. Copy and paste sounds a bit derogatory, but it's pretty much what you're doing. You can also "templatize" things depending on your backend (card partial/template, etc). What I like about my tech stack (go, tailwind, htmx, alpinejs) is the fact I can work entirely in HTML and Go. It keeps the work very focused and simple. I render HTML from Go. I style it with Tailwind. If I remove styles from HTML then Tailwind culls the unused styles (I don't need to manage CSS). I use HTMX for some dynamic behavior (active search, lazy loading content/modals/slide overs/product details/etc). I use Alpine for client side state (drop downs, slide overs, toggles, etc).
- jdmoreira 3y agoI get it, thanks. Out of curiosity what's the templating lib/engine/whatever you use in Go?
- llmblockchain 3y agohtml/template https://pkg.go.dev/html/template https://pkg.go.dev/html/template