Sha256: cf1219ce53f349b33c46817dc3a6095108a295631ded18004963beec9cd29ad6

Contents?: true

Size: 698 Bytes

Versions: 15

Compression:

Stored size: 698 Bytes

Contents

package s3.website.model

import java.io.File
import s3.website.model.Files.recursiveListFiles
import s3.website.{ErrorOrFile, ErrorReport}

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

object Ssg {
  val automaticallySupportedSiteGenerators = Jekyll :: Nanoc :: 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 = "public/output"
}

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
s3_website-2.7.6 src/main/scala/s3/website/model/ssg.scala
s3_website-2.7.5 src/main/scala/s3/website/model/ssg.scala
s3_website-2.7.4 src/main/scala/s3/website/model/ssg.scala
s3_website-2.7.3 src/main/scala/s3/website/model/ssg.scala
s3_website-2.7.2 src/main/scala/s3/website/model/ssg.scala
s3_website-2.7.1 src/main/scala/s3/website/model/ssg.scala
s3_website-2.7.0 src/main/scala/s3/website/model/ssg.scala
s3_website-2.6.1 src/main/scala/s3/website/model/ssg.scala
s3_website-2.6.0 src/main/scala/s3/website/model/ssg.scala
s3_website-2.5.1 src/main/scala/s3/website/model/ssg.scala
s3_website-2.5.0 src/main/scala/s3/website/model/ssg.scala
s3_website-2.4.0 src/main/scala/s3/website/model/ssg.scala
s3_website-2.3.1 src/main/scala/s3/website/model/ssg.scala
s3_website-2.3.0 src/main/scala/s3/website/model/ssg.scala
s3_website-2.2.0 src/main/scala/s3/website/model/ssg.scala