Skip to content

Commit

Permalink
GH-pages versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
aldemirenes committed Aug 29, 2019
1 parent 752f4a4 commit 1acc1f4
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
1 change: 1 addition & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ lazy val root = project.in(file("."))
))
.enablePlugins(SiteScaladocPlugin)
.enablePlugins(GhpagesPlugin)
.enablePlugins(PreprocessPlugin)
.settings(BuildSettings.buildSettings)
.settings(BuildSettings.publishSettings)
.settings(BuildSettings.mimaSettings)
Expand Down
10 changes: 8 additions & 2 deletions project/BuildSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ import com.typesafe.tools.mima.plugin.MimaPlugin
import scoverage.ScoverageKeys._

import com.typesafe.sbt.sbtghpages.GhpagesPlugin.autoImport._
import com.typesafe.sbt.site.SitePlugin.autoImport.makeSite
import com.typesafe.sbt.site.SitePlugin.autoImport._
import com.typesafe.sbt.site.SiteScaladocPlugin.autoImport._
import com.typesafe.sbt.SbtGit.GitKeys.{gitBranch, gitRemoteRepo}
import com.typesafe.sbt.site.preprocess.PreprocessPlugin.autoImport._

object BuildSettings {

Expand Down Expand Up @@ -101,6 +103,10 @@ object BuildSettings {
ghpagesNoJekyll := false,
gitRemoteRepo := "[email protected]:snowplow/snowplow-scala-analytics-sdk.git",
gitBranch := Some("gh-pages"),
excludeFilter in ghpagesCleanSite := "index.html"
siteSubdirName in SiteScaladoc := s"${version.value}",
preprocessVars in Preprocess := Map("VERSION" -> version.value),
excludeFilter in ghpagesCleanSite := new FileFilter {
def accept(f: File) = true
}
)
}
20 changes: 20 additions & 0 deletions src/site-preprocess/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Project Documentation</title>
<script language="JavaScript">
<!--
function doRedirect()
{
window.location.replace("@VERSION@");
}
doRedirect();
//-->
</script>
</head>
<body>
<a href="@VERSION@">Go to the project documentation
</a>
</body>
</html>

0 comments on commit 1acc1f4

Please sign in to comment.