Created
May 9, 2014 02:57
-
-
Save joescii/129a1a9f90305b798539 to your computer and use it in GitHub Desktop.
Automatic asset versioning in Lift with sbt-less/sbt-sass
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LessKeys.filenameSuffix in Compile <<= version ("-"+_) | |
SassKeys.filenameSuffix in Compile <<= version ("-"+_) | |
buildInfoKeys := Seq[BuildInfoKey](version) | |
buildInfoPackage := "config" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link data-lift="Style?name=styles"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.3.1") // https://github.com/sbt/sbt-buildinfo/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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