Skip to content

Commit 6679818

Browse files
authored
Merge pull request #540 from typelevel/pr/i399
Distinguish between org, affiliate projects in site plugin
2 parents 58f9578 + d7e2a1e commit 6679818

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

build.sbt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ lazy val docs = project
218218
"Laika" -> url("https://typelevel.org/Laika/"),
219219
"sbt-unidoc" -> url("https://github.com/sbt/sbt-unidoc")
220220
),
221-
tlSiteIsTypelevelProject := true,
222221
mdocVariables ++= {
223222
import coursier.complete.Complete
224223
import java.time._

site/src/main/scala/org/typelevel/sbt/TypelevelSitePlugin.scala

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ object TypelevelSitePlugin extends AutoPlugin {
4747

4848
lazy val tlSiteHelium = settingKey[Helium]("The Helium theme configuration and extensions")
4949
lazy val tlSiteIsTypelevelProject =
50-
settingKey[Boolean](
51-
"Indicates whether the generated site should be pre-populated with UI elements specific to Typelevel projects (default: false)")
50+
settingKey[Option[TypelevelProject]](
51+
"Indicates whether the generated site should be pre-populated with UI elements specific to Typelevel Organization or Affiliate projects (default: None)")
5252

5353
lazy val tlSiteApiUrl = settingKey[Option[URL]]("URL to the API docs")
5454
lazy val tlSiteApiModule =
@@ -70,6 +70,7 @@ object TypelevelSitePlugin extends AutoPlugin {
7070
lazy val tlSitePreview = taskKey[Unit](
7171
"Start a live-reload preview server (combines mdoc --watch with laikaPreview)")
7272

73+
type TypelevelProject = site.TypelevelProject
7374
val TypelevelProject = site.TypelevelProject
7475
}
7576

@@ -119,11 +120,16 @@ object TypelevelSitePlugin extends AutoPlugin {
119120
) ++
120121
tlSiteApiUrl.value.map("API_URL" -> _.toString).toMap
121122
},
122-
tlSiteIsTypelevelProject := organization.value == "org.typelevel",
123+
tlSiteIsTypelevelProject := {
124+
if (organization.value == "org.typelevel")
125+
Some(TypelevelProject.Organization)
126+
else
127+
None
128+
},
123129
tlSiteHeliumConfig := TypelevelSiteSettings.defaults.value,
124130
tlSiteHeliumExtensions := GenericSiteSettings.themeExtensions.value,
125131
tlSiteHelium := {
126-
if (tlSiteIsTypelevelProject.value) tlSiteHeliumConfig.value
132+
if (tlSiteIsTypelevelProject.value.isDefined) tlSiteHeliumConfig.value
127133
else GenericSiteSettings.defaults.value
128134
},
129135
tlSiteApiUrl := {

site/src/main/scala/org/typelevel/sbt/site/TypelevelProjects.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ package org.typelevel.sbt.site
1818

1919
import sbt._
2020

21+
sealed abstract class TypelevelProject
2122
object TypelevelProject {
23+
private[sbt] case object Organization extends TypelevelProject
24+
case object Affiliate extends TypelevelProject
25+
2226
val Cats = tl("cats")
2327
val CatsEffect = tl("cats-effect")
2428
val Discipline = gh("discipline")

0 commit comments

Comments
 (0)