Skip to content

Commit

Permalink
Changed: doc site config
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-lee committed Nov 7, 2020
1 parent b6459a4 commit 398c082
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 7 deletions.
25 changes: 20 additions & 5 deletions build.sbt
Expand Up @@ -3,6 +3,9 @@ import ProjectInfo._
val testosteroneVersion = "0.2.0"
val junitJupiterVersion = "5.6.2"

val GitHubUsername = "Kevin-Lee"
val ProjectName = "j8plus"

ThisBuild / scalaVersion := "2.13.3"
ThisBuild / version := ProjectVersion
ThisBuild / organization := "io.kevinlee"
Expand All @@ -12,11 +15,14 @@ ThisBuild / homepage := projectHomePage
ThisBuild / scmInfo := projectScmInfo

lazy val j8plus = (project in file("."))
.enablePlugins(DevOopsJavaPlugin)
.enablePlugins(DevOopsGitReleasePlugin)
.enablePlugins(JacocoCoverallsPlugin)
.enablePlugins(
DevOopsJavaPlugin,
DevOopsGitReleasePlugin,
JacocoCoverallsPlugin,
DocusaurPlugin,
)
.settings(
name := "j8plus"
name := ProjectName
, javacOptions := Seq(
"-source", javaVersion.value
, "-encoding", "UTF-8"
Expand Down Expand Up @@ -44,7 +50,7 @@ lazy val j8plus = (project in file("."))
, testOptions += Tests.Argument(TestFrameworks.JUnit, "-a")

, bintrayPackageLabels := Seq("maven", "java", "fp", "functional programming")
, bintrayVcsUrl := Some("git@github.com:Kevin-Lee/j8plus.git")
, bintrayVcsUrl := Some(s"git@github.com:$GitHubUsername/$ProjectName.git")
, bintrayRepository := "maven"

, publishMavenStyle := true
Expand All @@ -65,4 +71,13 @@ lazy val j8plus = (project in file("."))
/* GitHub Release { */
, devOopsPackagedArtifacts := List(s"target/${name.value}*.jar")
/* } GitHub Release */

/* Docs { */
, docusaurDir := (ThisBuild / baseDirectory).value / "website"
, docusaurBuildDir := docusaurDir.value / "build"

, gitHubPagesOrgName := GitHubUsername
, gitHubPagesRepoName := ProjectName
/* } Docs */

)
2 changes: 1 addition & 1 deletion project/build.properties
@@ -1 +1 @@
sbt.version = 1.4.1
sbt.version = 1.4.2
2 changes: 2 additions & 0 deletions project/plugins.sbt
Expand Up @@ -11,3 +11,5 @@ addSbtPlugin("com.github.sbt" % "sbt-jacoco" % "3.2.1")
resolvers += Resolver.jcenterRepo

addSbtPlugin("net.aichler" % "sbt-jupiter-interface" % "0.8.3")

addSbtPlugin("io.kevinlee" % "sbt-docusaur" % "0.3.0")
1 change: 1 addition & 0 deletions website/algolia.config.json
@@ -0,0 +1 @@
{}
22 changes: 21 additions & 1 deletion website/docusaurus.config.js
@@ -1,4 +1,15 @@
module.exports = {
const algoliaConfig = require('./algolia.config.json');
const googleAnalyticsConfig = require('./google-analytics.config.json');

const isEmptyObject = obj => {
for (field in obj) return false;
return true;
};

const isSearchable = !isEmptyObject(algoliaConfig);
const hasGoogleAnalytics = !isEmptyObject(googleAnalyticsConfig);

const websiteConfig = {
title: 'J8+',
tagline: 'The Missing Functional Parts of Java 8',
url: 'https://j8plus.kevinly.dev',
Expand Down Expand Up @@ -75,3 +86,12 @@ module.exports = {
],
],
};

if (isSearchable) {
websiteConfig['themeConfig']['algolia'] = algoliaConfig;
}
if (hasGoogleAnalytics) {
websiteConfig['themeConfig']['googleAnalytics'] = googleAnalyticsConfig;
}

module.exports = websiteConfig;
1 change: 1 addition & 0 deletions website/google-analytics.config.json
@@ -0,0 +1 @@
{}

0 comments on commit 398c082

Please sign in to comment.