diff --git a/website2/build.sbt b/website2/build.sbt index fb5e92753..0ae97378f 100644 --- a/website2/build.sbt +++ b/website2/build.sbt @@ -10,10 +10,13 @@ import laika.ast.Path.Root import laika.ast.Image import laika.ast.Length import laika.ast.LengthUnit +import com.comcast.ip4s._ +import scala.concurrent.duration.DurationInt +import laika.sbt.LaikaPreviewConfig ThisBuild / scalaVersion := "3.3.0" -enablePlugins(LaikaPlugin) +enablePlugins(LaikaPlugin, GhpagesPlugin) Global / onChangedBuildSource := ReloadOnSourceChanges @@ -90,6 +93,7 @@ laikaTheme := ), navLinks = Seq( ButtonLink.external("https://discord.gg/b5CD47g", "Discord"), + ButtonLink.external("/api", "API"), ButtonLink.external( "https://github.com/PurpleKingdomGames/indigo", "Github" @@ -104,10 +108,22 @@ laikaTheme := // Helium.defaults -import com.comcast.ip4s._ -import scala.concurrent.duration.DurationInt -import laika.sbt.LaikaPreviewConfig - laikaPreviewConfig := LaikaPreviewConfig.defaults .withPort(port"8080") + +// Make site + +siteSourceDirectory := target.value / "docs" / "site" +makeSite / includeFilter := "*" +makeSite / excludeFilter := ".DS_Store" +git.remoteRepo := "git@github.com:PurpleKingdomGames/indigo.git" +ghpagesNoJekyll := true + +addCommandAlias( + "publishIndigoSite", + List( + "makeSite", + "ghpagesPushSite" + ).mkString(";", ";", "") +) diff --git a/website2/build.sh b/website2/build.sh new file mode 100644 index 000000000..3e7de0c8a --- /dev/null +++ b/website2/build.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +set -e + +WEBSITE_DIR=$(pwd) +PROJECT_DIR=$WEBSITE_DIR/.. +INDIGO_ENGINE_DIR=$PROJECT_DIR/indigo/ + +# ----- +# generate / check docs +# - "indigo/doc" // Docs in ./indigo/target/scala-3.3.0/unidoc/ +# - "docs/mdoc" // Docs in ./indigo/indigo-docs/target/mdoc +cd $INDIGO_ENGINE_DIR +sbt gendocs +cd $WEBSITE_DIR + +# ----- +# build the site // $WEBSITE_DIR/target/docs/site +sbt clean laikaSite + +# ----- +# Publish +mkdir -p $WEBSITE_DIR/target/docs/site/api/ +cp -R $INDIGO_ENGINE_DIR/target/scala-3.*/unidoc/. $WEBSITE_DIR/target/docs/site/api/ +sbt clean makeSite ghpagesPushSite diff --git a/website2/project/plugins.sbt b/website2/project/plugins.sbt index 76184aedc..b8a8dc4d3 100644 --- a/website2/project/plugins.sbt +++ b/website2/project/plugins.sbt @@ -1 +1,3 @@ addSbtPlugin("org.planet42" % "laika-sbt" % "0.19.3") +addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.4.1") +addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.3")