Subatomic

Watch this space, but please don't use it yet
HomeBuildersScala.js support InternalsSearch
Mdoc and classpathRaw API

Under the hood, Subatomic's core idea is "it's all just moving files around" when it comes to building static sites.

Here's a super-short example:

import subatomic._

type Content = Either[String, Int]

def sitemap: Vector[(SitePath, Content)] = Vector(
  SiteRoot / "index.html"            -> Left("Hello world!"),
  SiteRoot / "the" / "answer.html"   -> Right(25)
)

val site = Site
  .init(sitemap)
  .populate { case (site, content) => 
    content match {
      case (path, Left(string)) => 
        site.addPage(path, s"<html><body>String: $string</body></html>")
      case (path, Right(int)) => 
        site.addPage(path, s"<html><body>Integer: $int</body></html>")
    }
  }

And if we want to actually produce files, we can call buildAt:

site.buildAt(os.temp.dir()) // build in a temp folder
Creating site in /tmp/1629574378979212456

index.html
    ^--content--> <html><body>String: Hello world!</body></html>
the/answer.html
    ^--content--> <html><body>Integer: 25</body></html>