varabyte / kobweb

A modern framework for full stack web apps in Kotlin, built upon Compose HTML
https://kobweb.varabyte.com
Apache License 2.0
1.51k stars 66 forks source link

Write clear docs on how to set the site's title #320

Closed sliderzxc closed 11 months ago

bitspittle commented 12 months ago

Thanks for filing the issue.

I'll answer here for now before the docs are done (which may take a while)

The default way to set your site title globally is inside your site/.kobweb/conf.yaml config file.

If you want to change the title from code, for example on a page by page basis, you can use the Kotlin/JS standard library to do it (document.title)

If you create a default app (kobweb create app) you'll see I do this in the PageLayout component;

https://github.com/varabyte/kobweb-templates/blob/fa5cf62f6fc50c91a791f767e2a9fbce0c5eab43/app/default/site/src/site/components/layouts/PageLayout.kt.ftl#L19

Hope that helps!

sliderzxc commented 11 months ago

thanks <3)