Hello, is there a way with Compose HTML to generat...
# compose-web
a
Hello, is there a way with Compose HTML to generate static pages ? (if no I think I'll move my website into another framework, like the Astro JS framework)
h
What do you mean with static pages? HTML files without JS?
a
Yes exactly, or at least HTML pages with all the Composable element created (like when the page and the JS has loaded on current Compose HTML) + the JS necessary for running the code not related to HTML generation
h
This is a feature of #kobweb
1
d
Author of #kobweb here! https://github.com/varabyte/kobweb Please check it out, I think it's probably what you want. And let me know if you have any questions. (Thanks @hfhbd for the callout!)
a
Thanks, I'll try this tomorrow then !
👍 1
Hey, I'm trying kobweb so, but I'm stuck when trying to export my website, I'm getting this error in JS when opening any page :
d
Are you opening your website directly? By clicking on the html files?
If so, you can't do that -- your website needs to have a root. What does "/" mean, in other words. The way you are supposed to visit your static files is by running
kobweb run --env prod --layout static
and then visiting
<http://localhost:8080>
a
That's exactly what I was doing, running the
kobweb run --env prod --layout static
command
d
Huh weird. I'll start a DM with you so we don't keep pinging
#compose-web
👍 1
a
Why not just Kotlinx HTML?
d
Compose is a great API for building responsive applications. It's doing A LOT for you, so for me personally, I'd want to use that instead of reinventing state management myself.