Sha256: 7e08f40e3777a6b5174f0b7716fdda284377b2787fba36fa72201f30bc528687

Contents?: true

Size: 674 Bytes

Versions: 1

Compression:

Stored size: 674 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 = s"public${File.separatorChar}output"
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
s3_website-2.11.2 src/main/scala/s3/website/model/ssg.scala