diff --git a/plugin/src/main/scala/com/github/sbt/paradox/material/theme/ParadoxMaterialThemePlugin.scala b/plugin/src/main/scala/com/github/sbt/paradox/material/theme/ParadoxMaterialThemePlugin.scala index efcca35..9ccfef8 100644 --- a/plugin/src/main/scala/com/github/sbt/paradox/material/theme/ParadoxMaterialThemePlugin.scala +++ b/plugin/src/main/scala/com/github/sbt/paradox/material/theme/ParadoxMaterialThemePlugin.scala @@ -19,7 +19,7 @@ object ParadoxMaterialThemePlugin extends AutoPlugin { override lazy val projectSettings: Seq[Setting[_]] = Def.settings( paradoxMaterialThemeGlobalSettings, - paradoxMaterialThemeSettings(Compile) + paradoxMaterialThemeSettings ) lazy val paradoxMaterialThemeGlobalSettings: Seq[Setting[_]] = Def.settings( @@ -29,20 +29,17 @@ object ParadoxMaterialThemePlugin extends AutoPlugin { paradoxTheme := Some("com.github.sbt" % "paradox-material-theme" % (paradoxMaterialTheme / version).value) ) - def paradoxMaterialThemeSettings(config: Configuration): Seq[Setting[_]] = - inConfig(config)( - Def.settings( - paradoxMaterialTheme := ParadoxMaterialTheme(), - paradoxProperties += ("material.theme.version" -> (paradoxMaterialTheme / version).value), - paradoxProperties ++= paradoxMaterialTheme.value.paradoxProperties, - paradoxMaterialTheme / mappings := Def.taskDyn { - if (paradoxProperties.value.contains("material.search")) - Def.task(Seq(SearchIndex.mapping(config).value)) - else - Def.task(Seq.empty[(File, String)]) - }.value, - paradox / mappings ++= (paradoxMaterialTheme / mappings).value - ) - ) + lazy val paradoxMaterialThemeSettings: Seq[Setting[_]] = Def.settings( + Compile / paradoxMaterialTheme := ParadoxMaterialTheme(), + Compile / paradoxProperties += ("material.theme.version" -> (paradoxMaterialTheme / version).value), + Compile / paradoxProperties ++= (Compile / paradoxMaterialTheme).value.paradoxProperties, + Compile / paradoxMaterialTheme / mappings := Def.taskDyn { + if ((Compile / paradoxProperties).value.contains("material.search")) + Def.task(Seq(SearchIndex.mapping(Compile).value)) + else + Def.task(Seq.empty[(File, String)]) + }.value, + Compile / paradox / mappings ++= (Compile / paradoxMaterialTheme / mappings).value + ) } diff --git a/plugin/src/sbt-test/sbt-site/can-use-theme/build.sbt b/plugin/src/sbt-test/sbt-site/can-use-theme/build.sbt index 3350ba8..8a755ad 100644 --- a/plugin/src/sbt-test/sbt-site/can-use-theme/build.sbt +++ b/plugin/src/sbt-test/sbt-site/can-use-theme/build.sbt @@ -2,15 +2,11 @@ name := "test" enablePlugins(ParadoxSitePlugin, ParadoxMaterialThemePlugin) -//#theme-site-settings -ParadoxMaterialThemePlugin.paradoxMaterialThemeSettings(Paradox) -//#theme-site-settings - -Paradox / paradoxProperties ++= Map( +Compile / paradoxProperties ++= Map( "github.base_url" -> "https://github.com/sbt/sbt-paradox-material-theme" ) -Paradox / paradoxMaterialTheme ~= { +Compile / paradoxMaterialTheme ~= { _.withCopyright("test-copyright") .withLogo("test-logo") .withFavicon("test-favicon") diff --git a/plugin/src/sbt-test/sbt-site/can-use-theme/project/plugins.sbt b/plugin/src/sbt-test/sbt-site/can-use-theme/project/plugins.sbt index 8669f49..3e68ee1 100644 --- a/plugin/src/sbt-test/sbt-site/can-use-theme/project/plugins.sbt +++ b/plugin/src/sbt-test/sbt-site/can-use-theme/project/plugins.sbt @@ -4,4 +4,4 @@ sys.props.get("project.version") match { |Specify this property using the scriptedLaunchOpts -D.""".stripMargin) } -addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.3.1") +addSbtPlugin(("com.github.sbt" % "sbt-site-paradox" % "1.5.0").exclude("com.lightbend.paradox", "sbt-paradox")) diff --git a/plugin/src/sbt-test/sbt-site/can-use-theme/src/paradox/index.md b/plugin/src/sbt-test/sbt-site/can-use-theme/src/main/paradox/index.md similarity index 100% rename from plugin/src/sbt-test/sbt-site/can-use-theme/src/paradox/index.md rename to plugin/src/sbt-test/sbt-site/can-use-theme/src/main/paradox/index.md diff --git a/project/plugins.sbt b/project/plugins.sbt index 6b6275b..234ce29 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,6 +1,6 @@ addSbtPlugin("com.lightbend.paradox" % "sbt-paradox" % "0.9.2") addSbtPlugin("com.lightbend.paradox" % "sbt-paradox-theme" % "0.9.2") -addSbtPlugin("com.github.sbt" % "sbt-site" % "1.5.0") +addSbtPlugin(("com.github.sbt" % "sbt-site-paradox" % "1.5.0").exclude("com.lightbend.paradox", "sbt-paradox")) addSbtPlugin("com.github.sbt" % "sbt-ghpages" % "0.8.0") addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") diff --git a/src/main/paradox/getting-started.md b/src/main/paradox/getting-started.md index 32fb3c6..a5222a6 100644 --- a/src/main/paradox/getting-started.md +++ b/src/main/paradox/getting-started.md @@ -13,13 +13,6 @@ And enable the theme plugin in your project's `build.sbt`: @@ snip [build.sbt]($root$/plugin/src/sbt-test/paradox/can-use-theme/build.sbt) { #enable-plugin } -If you are generating your site with [sbt-site] you also need to add a few -additional settings in `build.sbt`: - -@@ snip [build.sbt]($root$/plugin/src/sbt-test/sbt-site/can-use-theme/build.sbt) { #theme-site-settings } - - [sbt-site]: http://www.scala-sbt.org/sbt-site/generators/paradox.html - ## Configuring the theme The theme is configurable via Paradox properties which means that you can