Skip to content

Instantly share code, notes, and snippets.

@joescii
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joescii/eaf47390e450d588cf2b to your computer and use it in GitHub Desktop.
Save joescii/eaf47390e450d588cf2b to your computer and use it in GitHub Desktop.
Automatic asset versioning in Lift with sbt-js
JsKeys.filenameSuffix in Compile <<= version ("-"+_)
buildInfoKeys := Seq[BuildInfoKey](version)
buildInfoPackage := "config"
<script data-lift="Script?name=Landing"></script>
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.3.1") // https://github.com/sbt/sbt-buildinfo/
package code.snippet
object Script {
def render(xhtml:NodeSeq):NodeSeq = attr("name").map { name =>
import config.BuildInfo.version
<script id={name+"_js"} src={s"/js/$name-$version.js"} type="text/javascript"></script>
} openOr xhtml
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment