Basic settings

When you extend the HtmlPage you get basic support for a HTML page.

First we'll define a template for all our pages.
Here we can put site-wide settings, include common JS and CSS dependencies.
For basic site settings you override def siteSettings. It has the following fields:

NameMandatoryTypeDefault valueDescription
nameNoOption[String]NoneName of this site
faviconNormalNoOption[String]NoneFavicon of this site
faviconInvertedNoOption[String]NoneFavicon with alternative color, can be used in navbar for example

SiteSettings are usually defined in a common trait, for example:


        package utils
        import Bundle.*

        trait MyPageTemplate extends Page {
          override def siteSettings = super.siteSettings
            .withName("example.com")
            .withFaviconNormal("favicon.jpg")
        }
      

Per-page settings are in the def pageSettings.
PageSettings has the following fields:

NameMandatoryTypeDefault valueDescription
titleNoStringchangemeTitle of this page
labelNoString<same as title>Label used for link to this page
languageNoStringenLanguage of this page
descriptionNoOption[String]NoneDescription of page content
Example of page definition:

        package files
        import utils.*
        
        object Index extends MyPageTemplate {
          override def pageSettings =
            super.pageSettings
              .withTitle("Welcome!")
              .withDescription("My cool site")
        }
      

Body content

Next up is the def bodyContent: List[Frag] method.
You guessed it, it is the <body> of your HTML page. :)
Here you type content to be rendered in the body of your page.

Head content

Next up is the def headContent: List[Frag] method.
Yup, it is the <head> of your HTML page.
It has some defaults, you can see them in source code or inspect it in browser.