Skip to content

Commit

Permalink
Site building machinery
Browse files Browse the repository at this point in the history
  • Loading branch information
davesmith00000 committed Aug 18, 2023
1 parent 9fad37a commit daecfa3
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 5 deletions.
26 changes: 21 additions & 5 deletions website2/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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"
Expand All @@ -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 := "[email protected]:PurpleKingdomGames/indigo.git"
ghpagesNoJekyll := true

addCommandAlias(
"publishIndigoSite",
List(
"makeSite",
"ghpagesPushSite"
).mkString(";", ";", "")
)
25 changes: 25 additions & 0 deletions website2/build.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions website2/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -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")

0 comments on commit daecfa3

Please sign in to comment.