Sha256: af78e46408b616c142e1e6e0f60cc48817074603630668e6c051b8bb9fde8abd

Contents?: true

Size: 759 Bytes

Versions: 19

Compression:

Stored size: 759 Bytes

Contents

package s3.website.model

import java.io.File
import s3.website.model.Files.recursiveListFiles

// ssg = static site generator
trait Ssg {
  def outputDirectory: String
}

object Ssg {
  val automaticallySupportedSiteGenerators = Jekyll :: Nanoc :: Middleman :: Nil

  def autodetectSiteDir(workingDirectory: File): Option[File] =
    recursiveListFiles(workingDirectory).find { file =>
      file.isDirectory && automaticallySupportedSiteGenerators.exists(ssg => file.getAbsolutePath.endsWith(ssg.outputDirectory))
    }
}

case object Jekyll extends Ssg {
  def outputDirectory = "_site"
}

case object Nanoc extends Ssg {
  def outputDirectory = s"public${File.separatorChar}output"
}

case object Middleman extends Ssg {
  def outputDirectory = "build"
}

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
s3_website_revived-4.0.2 src/main/scala/s3/website/model/ssg.scala
s3_website_revived-4.0.1 src/main/scala/s3/website/model/ssg.scala
s3_website_revived-4.0.0 src/main/scala/s3/website/model/ssg.scala
s3_website-3.4.0 src/main/scala/s3/website/model/ssg.scala
s3_website-3.3.0 src/main/scala/s3/website/model/ssg.scala
s3_website-3.2.0 src/main/scala/s3/website/model/ssg.scala
s3_website-3.1.0 src/main/scala/s3/website/model/ssg.scala
s3_website-3.0.0 src/main/scala/s3/website/model/ssg.scala
s3_website-2.16.0 src/main/scala/s3/website/model/ssg.scala
s3_website-2.15.1 src/main/scala/s3/website/model/ssg.scala
s3_website-2.15.0 src/main/scala/s3/website/model/ssg.scala
s3_website-2.14.3 src/main/scala/s3/website/model/ssg.scala
s3_website-2.14.2 src/main/scala/s3/website/model/ssg.scala
s3_website-2.14.1 src/main/scala/s3/website/model/ssg.scala
s3_website-2.14.0 src/main/scala/s3/website/model/ssg.scala
s3_website-2.13.0 src/main/scala/s3/website/model/ssg.scala
s3_website-2.12.3 src/main/scala/s3/website/model/ssg.scala
s3_website-2.12.2 src/main/scala/s3/website/model/ssg.scala
s3_website-2.12.1 src/main/scala/s3/website/model/ssg.scala