When you extend StaticPage
you get support for a static HTML page.
For basic settings you can override def staticSiteSettings
. It has the following fields:
Name | Mandatory | Type | Default value | Description |
---|---|---|---|---|
indexPage | No | Option[StaticPage] | None | Home page |
mainPages | No | List[StaticPage] | List.empty | Pages to display in navbar |
You usually define it in a common trait, for example:
package utils
import Bundle.*
trait MyStaticPageTemplate extends StaticPage {
override def staticSiteSettings = super.staticSiteSettings
.withIndexPage(files.Index)
}
Example of a page definition:
package files
import utils.*
import Bundle.*. Tags.*
object Index extends MyStaticPageTemplate {
override def pageContent = div("content here")
}
You can get a relative link to Index
page with the ref
method.
E.g. if you have another page in files.posts
package,
Index.ref
will give you a string "../index.html"