Hello all, Is there a rich text editor built into ...
# kobweb
c
Hello all, Is there a rich text editor built into Kobweb or Kotlin JS that exists as an open-source project? potentially one that I can add a dependency to my project and create a blog of some sort. Thanks in advance cc @David Herman
👀 1
s
I'm not aware of any built specifically for compose html. You can however, use any js library, like tinymce, and use it in k/js via some bindings (https://kotlinlang.org/docs/js-interop.html). For example I've used asciidoc but it's a markup language/processor rather than rich text. Alternatively you can create a separate compose for web page for the backoffice and use https://github.com/MohamedRejeb/compose-rich-editor (not the best option if it's public facing or e.g. you need non english characters)
c
I am more familiar with compose web through the compose multiplatform how can I include the wasm target to work with kobweb or I will need to host a separate container?
s
do you host your kobweb site with the kobweb backend?
it might work putting the cfw html + js into /resources/public/editor
c
Yes I have the entire app in a single container the db on another container, but I need to be able to write blogs, and show them on the blog section
also be able to edit some services and some information related to the service the client is offering
s
one important thing, without ssr your blogs might not get properly indexed. Kobweb exports all static content, but dynamic content is another story
c
I need more context on this
s
to index, bots usually only crawl the html and don't execute any js. When you export your site with kobweb it bakes all your static content into the static html files. But that only works for content that's available at build time. Dynamic content that's fetched from a db either needs to be rendered on the server (SSR, look this term up if you need), or you rebuild/export your kobweb project each time you add/edit a blog post. With a gh pipeline that should be possible as well
c
that looks like a lot of work
okay let me worry about that later, so my current question is if I want to use the wasm target for the dashboard alone and run it as part of my kobweb website how do I include it and have a route that points to it?
s
depends if SEO is important for you. You can also skip all this if you say you don't need to optimize the exposure
if you have you entire dashboard in cfw then just host it from a separate container
or caddy
c
intercepting the access to that route might be tricky
s
What's your setup like? I have caddy running in front of my containers and hosting all static content, that's super easy
c
I dont know what a caddy is, but I host everything on virtualmin, I have multiple servers running, and this one is currently hosted as a static site for the parts that dont need bloging, the backoffice that controls dynamic content is yet to be build though I have the logic and db connection in place, also the routes work. I usual segment access to some of the site using apache hostnames or reverse proxies
so is caddy like a reverse proxy?
or some sort of single sign on
s
just look it up https://caddyserver.com/. it's nginx in cool. and yeah, I'm using it as a reverse proxy for docker containers
c
let me look it up
d
Just connecting in now. Sounds like @S. can answer this better than I can though!