Skip to content

Commit

Permalink
Merge pull request #292 from ennru/project-url-default
Browse files Browse the repository at this point in the history
Default project.url to homepage
  • Loading branch information
2m authored Mar 8, 2019
2 parents 410beab + 03264b2 commit 575e713
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
3 changes: 1 addition & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ lazy val docs = (project in file("docs"))
paradoxTheme := Some(builtinParadoxTheme("generic")),
paradoxProperties in Compile ++= Map(
"empty" -> "",
"version" -> version.value,
"project.url" -> "https://developer.lightbend.com/docs/paradox/current/",
"version" -> version.value
),
paradoxGroups := Map("Language" -> Seq("Scala", "Java")),
publish / skip := true
Expand Down
6 changes: 4 additions & 2 deletions docs/src/main/paradox/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ Paradox supports showing a warning when users browse documentation which is not

The built in theme (`generic`) contains Javascript to fetch the JSON file and compare the version with the version for which the documentation showing was generated. Whenever they differ, a warning text shows on every page offering a link to the released version's page.

To use this functionality, add `project.url` to Paradox properties
To use this functionality, make `project.url` point to a URL where the **current** version will be deployed. It defaults to the sbt `homepage` setting. Make sure `homepage` contains something useful.

To set a URL different from `homepage`, add `project.url` to Paradox properties

```scala
paradoxProperties += ("project.url" -> "https://developer.lightbend.com/docs/paradox/current/")
Expand All @@ -67,7 +69,7 @@ paradoxProperties += ("project.url" -> "https://developer.lightbend.com/docs/par

The built-in theme (`generic`) will add a `<link rel="canonical" href=...` page header using the sbt `homepage` setting. Make sure `homepage` contains something useful.

To set a different URL, add `canonical.base_url` to Paradox properties
To set a URL different from `homepage`, add `canonical.base_url` to Paradox properties

```scala
paradoxProperties += ("canonical.base_url" -> "https://developer.lightbend.com/docs/paradox/current/")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,11 @@ object ParadoxPlugin extends AutoPlugin {
"scala.binary.version" -> scalaBinaryVersion.value),
paradoxProperties ++= {
(homepage in ThisBuild).value match {
case Some(url) => Map("canonical.base_dir" -> url.toString)
case None => Map.empty
case Some(url) => Map(
"project.url" -> url.toString,
"canonical.base_dir" -> url.toString
)
case None => Map.empty
}
},
paradoxProperties ++= dateProperties,
Expand Down

0 comments on commit 575e713

Please sign in to comment.