Skip to content

Commit

Permalink
prevent gh-pages to delete index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
niqdev committed Oct 1, 2017
1 parent b491c86 commit f94ce37
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion doc/development.md
Expand Up @@ -43,7 +43,7 @@ sbt dependencyUpdates
# generate, package and preview scaladoc
sbt makeSite packageSite previewSite
# publish gh-pages
# publish gh-pages (no travis)
sbt clean makeSite ghpagesPushSite
```

Expand Down
19 changes: 9 additions & 10 deletions doc/how-to.md
Expand Up @@ -105,30 +105,29 @@ sbt ghpagesPushSite
# [error] fatal: Not a git repository (or any of the parent directories): .git
rm -r ~/.sbt/ghpages/
# add index.html with redirect
# add index.html with redirect manually from GitHub
# but you need to trigger a push once on gh-pages branch to make index.html visible
touch lib/target/site/index.html
git checkout gh-pages
git commit -m "publish index.html" --allow-empty
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Project Documentation</title>
<script language="JavaScript">
<!--
<script type="text/javascript">
function doRedirect()
{
window.location.replace("latest/api/com/github/niqdev/stream/index.html");
}
doRedirect();
//-->
</script>
</head>
<body>
<a href="latest/api">Go to the project documentation
</a>
</body>
<body />
</html>
sbt ghpagesPushSite
# publish manually
# note that index.html is configured to be ignored
sbt clean makeSite ghpagesPushSite
```
Expand Up @@ -125,7 +125,7 @@ object CassandraSource {
protected[stream] lazy val settings = Settings.Library

/**
* Create a Cassandra [[akka.stream.scaladsl.Source]] wrapping [[com.netflix.astyanax.recipes.reader.AllRowsReader]].
* Creates a Cassandra [[akka.stream.scaladsl.Source]] wrapping [[com.netflix.astyanax.recipes.reader.AllRowsReader]].
*
* @param keyspace The [[com.netflix.astyanax.Keyspace]]
* @param columnFamily The [[com.netflix.astyanax.model.ColumnFamily]]
Expand Down
7 changes: 6 additions & 1 deletion project/Settings.scala
Expand Up @@ -3,6 +3,7 @@ import ch.epfl.scala.sbt.release.ReleaseEarlyPlugin.autoImport._
import com.lucidchart.sbt.scalafmt.ScalafmtCorePlugin.autoImport.scalafmtOnCompile
import com.typesafe.sbt.SbtGit.git
import com.typesafe.sbt.SbtPgp.autoImport._
import com.typesafe.sbt.sbtghpages.GhpagesPlugin.autoImport._
import sbt.Keys.{scmInfo, _}
import sbt._
import scoverage.ScoverageKeys._
Expand Down Expand Up @@ -36,7 +37,11 @@ object Settings {
pgpSecretRing := file(".travis/local.secring.asc"),
releaseEarlyWith := BintrayPublisher,

git.remoteRepo := scmInfo.value.get.connection
git.remoteRepo := scmInfo.value.get.connection,
excludeFilter in ghpagesCleanSite :=
new FileFilter {
def accept(f: File) = (ghpagesRepository.value / "index.html").getCanonicalPath == f.getCanonicalPath
}
)

lazy val exampleSettings = commonSettings ++ Seq(
Expand Down

0 comments on commit f94ce37

Please sign in to comment.