Skip to content

Instantly share code, notes, and snippets.

@joescii
Created May 9, 2014 02:57
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/129a1a9f90305b798539 to your computer and use it in GitHub Desktop.
Save joescii/129a1a9f90305b798539 to your computer and use it in GitHub Desktop.
Automatic asset versioning in Lift with sbt-less/sbt-sass
LessKeys.filenameSuffix in Compile <<= version ("-"+_)
SassKeys.filenameSuffix in Compile <<= version ("-"+_)
buildInfoKeys := Seq[BuildInfoKey](version)
buildInfoPackage := "config"
<link data-lift="Style?name=styles">
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.3.1") // https://github.com/sbt/sbt-buildinfo/
object Style {
def render(xhtml:NodeSeq):NodeSeq = attr("name").map { name =>
import config.BuildInfo.version
<link id={name+"_css"} href={s"/css/$name-$version.css"} rel="stylesheet"></link>
} openOr xhtml
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment