Last active
August 29, 2015 14:01
-
-
Save joescii/eaf47390e450d588cf2b to your computer and use it in GitHub Desktop.
Automatic asset versioning in Lift with sbt-js
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
JsKeys.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
<script data-lift="Script?name=Landing"></script> |
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
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