All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kreuzberg.miniserver.Index.scala Maven / Gradle / Ivy

There is a newer version: 0.10.3
Show newest version
package kreuzberg.miniserver
import kreuzberg.scalatags.*
import scalatags.Text.all.*
import scalatags.Text.tags2.noscript

/** Index page for MiniServer. */
case class Index(config: DeploymentConfig) {
  def index = html(
    head(
      script(src := config.hashedUrl("main.js")),
      config.extraJs.map { name =>
        script(src := config.hashedUrl(name))
      },
      config.extraCss.map { name =>
        link(rel := "stylesheet", href := config.hashedUrl(name))
      },
      config.extraHtmlHeader
    ),
    body(
      div(id := "root"),
      noscript(
        config.noScriptText.getOrElse(
          "Please enable JavaScript in order to use this page."
        )
      )
    )
  )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy