Sha256: 2431ccb2018d617784849ebb4f5c609b226272ae9287164569ad58b56c48e398
Contents?: true
Size: 945 Bytes
Versions: 26
Compression:
Stored size: 945 Bytes
Contents
package s3.website.model import java.io.File import s3.website.{ErrorOrFile, ErrorReport} // ssg = static site generator trait Ssg { def outputDirectory: String } object Ssg { val automaticallySupportedSiteGenerators = Jekyll :: Nanoc :: Nil val notFoundErrorReport = new ErrorReport { def reportMessage = """|Could not find a website in any of the pre-defined directories. |Specify the website location with the --site=path argument and try again.""".stripMargin } def findSiteDirectory(workingDirectory: File): ErrorOrFile = Files.recursiveListFiles(workingDirectory).find { file => file.isDirectory && automaticallySupportedSiteGenerators.exists(_.outputDirectory == file.getName) }.fold(Left(notFoundErrorReport): ErrorOrFile)(Right(_)) } case object Jekyll extends Ssg { def outputDirectory = "_site" } case object Nanoc extends Ssg { def outputDirectory = "public/output" }
Version data entries
26 entries across 26 versions & 2 rubygems