Skip to content

Commit

Permalink
Replaces deprecated SBT syntax (#585)
Browse files Browse the repository at this point in the history
* Replaces deprecated SBT syntax

* Bumps github4s up
  • Loading branch information
juanpedromoreno committed Apr 27, 2021
1 parent 12a2290 commit c737f81
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 54 deletions.
8 changes: 4 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ lazy val `sbt-microsites` = (project in file("."))

lazy val microsite = project
.settings(micrositeSettings: _*)
.settings(skip in publish := true)
.settings(publish / skip := true)
.enablePlugins(MicrositesPlugin)
.enablePlugins(MdocPlugin)

lazy val documentation = project
.settings(mdocOut := file("."))
.settings(skip in publish := true)
.settings(publish / skip := true)
.enablePlugins(MdocPlugin)

lazy val pluginSettings: Seq[Def.Setting[_]] = Seq(
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.20"),
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.3"),
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.4.1"),
libraryDependencies ++= Seq(
"com.47deg" %% "github4s" % "0.28.3",
"com.47deg" %% "github4s" % "0.28.4",
"org.http4s" %% "http4s-blaze-client" % "0.21.22",
"net.jcazevedo" %% "moultingyaml" % "0.4.2",
"com.lihaoyi" %% "scalatags" % "0.9.4",
Expand All @@ -65,5 +65,5 @@ lazy val micrositeSettings: Seq[Def.Setting[_]] = Seq(
micrositeGithubToken := sys.env.get("GITHUB_TOKEN"),
micrositePushSiteWith := GitHub4s,
micrositeGitterChannelUrl := "47deg/sbt-microsites",
includeFilter in makeSite := "*.html" | "*.css" | "*.png" | "*.jpg" | "*.gif" | "*.js" | "*.swf" | "*.md" | "*.svg"
makeSite / includeFilter := "*.html" | "*.css" | "*.png" | "*.jpg" | "*.gif" | "*.js" | "*.swf" | "*.md" | "*.svg"
)
44 changes: 22 additions & 22 deletions microsite/docs/docs/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,28 +179,28 @@ message MyMessage {

[Available languages: https://cdnjs.com/libraries/highlight.js/](https://cdnjs.com/libraries/highlight.js/)

- `micrositeImgDirectory`: The plugin provides some basic images, but you can add new images to personalize the microsite. This is the property where you can specify where they will be placed. The images in this folder will be automatically copied by the plugin, and they will be placed together with the rest of the Jekyll resources. By default, its value is `(resourceDirectory in Compile).value / "microsite" / "img"`, but you can override it. For instance:
- `micrositeImgDirectory`: The plugin provides some basic images, but you can add new images to personalize the microsite. This is the property where you can specify where they will be placed. The images in this folder will be automatically copied by the plugin, and they will be placed together with the rest of the Jekyll resources. By default, its value is `(Compile / resourceDirectory).value / "microsite" / "img"`, but you can override it. For instance:

```scala
micrositeImgDirectory := (resourceDirectory in Compile).value / "site" / "images"
micrositeImgDirectory := (Compile / resourceDirectory).value / "site" / "images"
```

- `micrositeCssDirectory`: You can also override the styles through the `micrositeCssDirectory` setting by using the same method. The css files in that folder will be automatically copied and imported by the plugin in your microsite. The default value is `(resourceDirectory in Compile).value / "microsite" / "css"`, but you can override it like this:
- `micrositeCssDirectory`: You can also override the styles through the `micrositeCssDirectory` setting by using the same method. The css files in that folder will be automatically copied and imported by the plugin in your microsite. The default value is `(Compile / resourceDirectory).value / "microsite" / "css"`, but you can override it like this:

```scala
micrositeCssDirectory := (resourceDirectory in Compile).value / "site" / "styles"
micrositeCssDirectory := (Compile / resourceDirectory).value / "site" / "styles"
```

- `micrositeSassDirectory`: If you want to use SCSS files, you might want to override the place to put the partials. This can be done through the `micrositeSassDirectory` setting. The main SCSS files need to go into the CSS directory, where they will be transformed into CSS files, and the partials will be loaded from this directory. The default value is `(resourceDirectory in Compile).value / "microsite" / "sass"`, but you can override it like this:
- `micrositeSassDirectory`: If you want to use SCSS files, you might want to override the place to put the partials. This can be done through the `micrositeSassDirectory` setting. The main SCSS files need to go into the CSS directory, where they will be transformed into CSS files, and the partials will be loaded from this directory. The default value is `(Compile / resourceDirectory).value / "microsite" / "sass"`, but you can override it like this:

```scala
micrositeSassDirectory := (resourceDirectory in Compile).value / "site" / "partials"
micrositeSassDirectory := (Compile / resourceDirectory).value / "site" / "partials"
```

- `micrositeJsDirectory`: You can also introduce custom javascript files in the generated microsite through the `micrositeJsDirectory` setting by using the same method. The javascript files in that folder will be automatically copied and imported by the plugin in your microsite. The default value is `(resourceDirectory in Compile).value / "microsite" / "js"`, but you can override it like this:
- `micrositeJsDirectory`: You can also introduce custom javascript files in the generated microsite through the `micrositeJsDirectory` setting by using the same method. The javascript files in that folder will be automatically copied and imported by the plugin in your microsite. The default value is `(Compile / resourceDirectory).value / "microsite" / "js"`, but you can override it like this:

```scala
micrositeJsDirectory := (resourceDirectory in Compile).value / "site" / "scripts"
micrositeJsDirectory := (Compile / resourceDirectory).value / "site" / "scripts"
```

There is a reserved filename that you cannot use in your personal microsite: `main.js`, which is provided by the plugin.
Expand All @@ -221,10 +221,10 @@ micrositeCDNDirectives := CdnDirectives(
)
```

- `micrositeExternalLayoutsDirectory`: You can also introduce custom html layouts in the generated microsite through the `micrositeExternalLayoutsDirectory` setting. The layout files in that folder will be automatically copied and imported by the plugin in your microsite. The default value is `(resourceDirectory in Compile).value / "microsite" / "layouts"`, but you can override it like this:
- `micrositeExternalLayoutsDirectory`: You can also introduce custom html layouts in the generated microsite through the `micrositeExternalLayoutsDirectory` setting. The layout files in that folder will be automatically copied and imported by the plugin in your microsite. The default value is `(Compile / resourceDirectory).value / "microsite" / "layouts"`, but you can override it like this:

```scala
micrositeExternalLayoutsDirectory := (resourceDirectory in Compile).value / "site" / "layouts"
micrositeExternalLayoutsDirectory := (Compile / resourceDirectory).value / "site" / "layouts"
```

These will be available to your pages by using the `layout` keyword in the YAML front matter block in each of your docs' markdown files (i.e., having included a `extra-layout.html` external layout file):
Expand All @@ -236,29 +236,29 @@ layout: extra-layout
---
```

- `micrositeExternalIncludesDirectory`: You can also introduce custom html partial layouts in the generated microsite through the `micrositeExternalIncludesDirectory` setting. The layout files in that folder will be automatically copied and imported by the plugin in your microsite. The default value is `(resourceDirectory in Compile).value / "microsite" / "includes"`, but you can override it like this:
- `micrositeExternalIncludesDirectory`: You can also introduce custom html partial layouts in the generated microsite through the `micrositeExternalIncludesDirectory` setting. The layout files in that folder will be automatically copied and imported by the plugin in your microsite. The default value is `(Compile / resourceDirectory).value / "microsite" / "includes"`, but you can override it like this:

```scala
micrositeExternalIncludesDirectory := (resourceDirectory in Compile).value / "site" / "includes"
micrositeExternalIncludesDirectory := (Compile / resourceDirectory).value / "site" / "includes"
```

These will be available to your pages by using `Jekyll`'s [include](https://jekyllrb.com/docs/templates/#includes) keyword in your layouts.

- `micrositeDataDirectory`: In addition, you can provide new data to your Jekyll site through the `micrositeDataDirectory` setting. It's based on the idea of [Jekyll Data Files](https://jekyllrb.com/docs/datafiles/). It's important to keep in mind that, if you are defining documentation in your microsite, you have to configure the menu through this setting. The default value is `(resourceDirectory in Compile).value / "microsite" / "data"`, but you can override it like this:
- `micrositeDataDirectory`: In addition, you can provide new data to your Jekyll site through the `micrositeDataDirectory` setting. It's based on the idea of [Jekyll Data Files](https://jekyllrb.com/docs/datafiles/). It's important to keep in mind that, if you are defining documentation in your microsite, you have to configure the menu through this setting. The default value is `(Compile / resourceDirectory).value / "microsite" / "data"`, but you can override it like this:

```scala
micrositeDataDirectory := (resourceDirectory in Compile).value / "site" / "mydatafiles"
micrositeDataDirectory := (Compile / resourceDirectory).value / "site" / "mydatafiles"
```

In the Documentation **Menu** case, as you can see in the [layouts]({% link docs/layouts.md %}) section, you need to create a file named `menu.yml` under the `micrositeDataDirectory` setting.

- `micrositeStaticDirectory`: You can also provide a static directory to your Jekyll site through the `micrositeStaticDirectory` setting. It's based on the idea of [Jekyll Static Files](https://jekyllrb.com/docs/static-files/). The default value is `(resourceDirectory in Compile).value / "microsite" / "static"`, but you can override it like this:
- `micrositeStaticDirectory`: You can also provide a static directory to your Jekyll site through the `micrositeStaticDirectory` setting. It's based on the idea of [Jekyll Static Files](https://jekyllrb.com/docs/static-files/). The default value is `(Compile / resourceDirectory).value / "microsite" / "static"`, but you can override it like this:

```scala
micrositeStaticDirectory := (resourceDirectory in Compile).value / "site" / "mystaticfiles"
micrositeStaticDirectory := (Compile / resourceDirectory).value / "site" / "mystaticfiles"
```

The directory will be copied as-is, but no process will be applied to any file on it. So the responsibility of loading/linking/using them on a layout is yours. Also, see the `includeFilter in makeSite` config setting for the allowed file types that will be copied.
The directory will be copied as-is, but no process will be applied to any file on it. So the responsibility of loading/linking/using them on a layout is yours. Also, see the `makeSite / includeFilter` config setting for the allowed file types that will be copied.

- `micrositeExtraMdFiles`: This setting can be handy if you want to include additional markdown files in your site, and these files are not located in the same place in your `mdoc` directory. By default, the setting is set up as an empty map. You can override it in this way:

Expand All @@ -284,10 +284,10 @@ Each file (the map key) can be related to a specific configuration through the `

- `micrositeExtraMdFilesOutput` this is an optional parameter when you are using `mdoc`, and refers to the microsite output location for extra-md files. Default is resourceManaged + `/jekyll/extra_md` although you can modify it.

- `micrositePluginsDirectory`: You can also introduce custom [Jekyll plugins](https://jekyllrb.com/docs/plugins/) in the generated microsite through the `micrositePluginsDirectory` setting. The plugin files in that folder will be automatically copied and imported by the plugin in your microsite. The default value is `(resourceDirectory in Compile).value / "microsite" / "plugins"`, but you can override it like this:
- `micrositePluginsDirectory`: You can also introduce custom [Jekyll plugins](https://jekyllrb.com/docs/plugins/) in the generated microsite through the `micrositePluginsDirectory` setting. The plugin files in that folder will be automatically copied and imported by the plugin in your microsite. The default value is `(Compile / resourceDirectory).value / "microsite" / "plugins"`, but you can override it like this:

```scala
micrositePluginsDirectory := (resourceDirectory in Compile).value / "site" / "plugins"
micrositePluginsDirectory := (Compile / resourceDirectory).value / "site" / "plugins"
```

- `micrositeHomeButtonTarget`: Where the large "call-to-action button" on your home page should take users. By default is set to `repo` for your project repository. Can be set to `docs` to take users to the project documentation page, if configured.
Expand Down Expand Up @@ -353,7 +353,7 @@ micrositeConfigYaml := ConfigYml(
yamlCustomProperties = Map("org" -> "My Org"),
yamlInline = """exclude: [package.json, grunt.js, Gruntfile.js, node_modules]
|""".stripMargin,
yamlPath = Some((resourceDirectory in Compile).value / "microsite" / "myconfig.yml")
yamlPath = Some((Compile / resourceDirectory).value / "microsite" / "myconfig.yml")
)
```

Expand All @@ -374,8 +374,8 @@ compiles the site. **The strings are passed in unsanitized to the templating en
{% raw %}micrositeEditButton := Some(MicrositeEditButton("Improve this Page", "/edit/master/docs/{{ page.path }}")){% endraw %}
```

- `includeFilter in makeSite`: Restrict the type of files that are included during the microsite build. The default value is `"*.html" | "*.css" | "*.png" | "*.jpg" | "*.jpeg" | "*.gif" | "*.js" | "*.swf" | "*.md" | "*.webm" | "*.ico" | "CNAME" | "*.yml" | "*.svg" | "*.json"` but you can override it like this:
- `makeSite / includeFilter`: Restrict the type of files that are included during the microsite build. The default value is `"*.html" | "*.css" | "*.png" | "*.jpg" | "*.jpeg" | "*.gif" | "*.js" | "*.swf" | "*.md" | "*.webm" | "*.ico" | "CNAME" | "*.yml" | "*.svg" | "*.json"` but you can override it like this:

```scala
includeFilter in makeSite := "*.csv" | "*.pdf" | *.html" | "*.css" | "*.png" | "*.jpg" | "*.jpeg" | "*.gif" | "*.js" | "*.swf" | "*.md" | "*.webm" | "*.ico" | "CNAME" | "*.yml" | "*.svg" | "*.json"
makeSite / includeFilter := "*.csv" | "*.pdf" | *.html" | "*.css" | "*.png" | "*.jpg" | "*.jpeg" | "*.gif" | "*.js" | "*.swf" | "*.md" | "*.webm" | "*.ico" | "CNAME" | "*.yml" | "*.svg" | "*.json"
```
12 changes: 6 additions & 6 deletions src/main/scala/microsites/MicrositeKeys.scala
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ trait MicrositeAutoImportSettings extends MicrositeKeys {

lazy val micrositeTasksSettings = Seq(
microsite := (micrositeHelper.value
.createResources(resourceManagedDir = (resourceManaged in Compile).value)),
.createResources(resourceManagedDir = (Compile / resourceManaged).value)),
micrositeMakeExtraMdFiles := micrositeHelper.value.buildAdditionalMd(),
makeMdoc := (Def.sequential(mdoc.toTask(""), micrositeMakeExtraMdFiles).value),
makeMicrosite := (Def.sequential(microsite, makeMdoc, makeSite).value),
Expand All @@ -409,7 +409,7 @@ trait MicrositeAutoImportSettings extends MicrositeKeys {
case n => sys.error("Could not run git, error: " + n)
}

val sourceDir = (resourceManaged in Compile).value
val sourceDir = (Compile / resourceManaged).value
val targetDir: String = sourceDir.getAbsolutePath.ensureFinalSlash
val currentBranchTag = "git name-rev --name-only HEAD".!!.trim

Expand All @@ -426,7 +426,7 @@ trait MicrositeAutoImportSettings extends MicrositeKeys {
case n => sys.error("Could not run git, error: " + n)
}

val publishingDir = (target in makeSite).value
val publishingDir = (makeSite / target).value
val genDocsDir = ".sbt-versioned-docs"
val currentBranchTag = "git name-rev --name-only HEAD".!!.trim

Expand All @@ -446,7 +446,7 @@ trait MicrositeAutoImportSettings extends MicrositeKeys {
s"git checkout -f $currentBranchTag".!
},
moveMicrositeVersions := {
val publishingDir = (target in makeSite).value
val publishingDir = (makeSite / target).value
val genDocsDir = ".sbt-versioned-docs"

micrositeVersionList.value.foreach { tag =>
Expand All @@ -464,10 +464,10 @@ trait MicrositeAutoImportSettings extends MicrositeKeys {
.sequential(createMicrositeVersions, clean, makeVersionedMicrosite, moveMicrositeVersions)
.value,
ghpagesPrivateMappings := {
sbt.Path.allSubpaths((target in makeSite).value).toList
sbt.Path.allSubpaths((makeSite / target).value).toList
},
pushMicrosite := Def.taskDyn {
val siteDir: File = (target in makeSite).value
val siteDir: File = (makeSite / target).value
val noJekyll: Boolean = ghpagesNoJekyll.value
val branch: String = ghpagesBranch.value
val pushSiteWith: PushWith = micrositePushSiteWith.value
Expand Down

0 comments on commit c737f81

Please sign in to comment.