Sha256: ec3e3e368f1aa501eb3e5a5eace6a6220a8f8cfb6b1087aec0552030e522dff5

Contents?: true

Size: 653 Bytes

Versions: 9

Compression:

Stored size: 653 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 :: 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

9 entries across 9 versions & 1 rubygems

Version Path
s3_website-2.11.0 src/main/scala/s3/website/model/ssg.scala
s3_website-2.10.0 src/main/scala/s3/website/model/ssg.scala
s3_website-2.9.0 src/main/scala/s3/website/model/ssg.scala
s3_website-2.8.6 src/main/scala/s3/website/model/ssg.scala
s3_website-2.8.5 src/main/scala/s3/website/model/ssg.scala
s3_website-2.8.4 src/main/scala/s3/website/model/ssg.scala
s3_website-2.8.3 src/main/scala/s3/website/model/ssg.scala
s3_website-2.8.1 src/main/scala/s3/website/model/ssg.scala
s3_website-2.8.0 src/main/scala/s3/website/model/ssg.scala