Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ lazy val root = project("paradox-material-theme-parent", file("."))
}
// #social
,
// #open-graph
Compile / paradoxProperties ++= Map(
"project.description" -> "Paradox Material Theme is a theme for Paradox, a static site generator geared towards project documentation",
"project.image" -> "https://www.scala-sbt.org/sbt-paradox-material-theme/images/material.png"
)
// #open-graph
,
// #language
Compile / paradoxMaterialTheme ~= {
_.withLanguage(java.util.Locale.ENGLISH)
Expand Down
6 changes: 6 additions & 0 deletions src/main/paradox/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,12 @@ on the URL:

[17]: http://fontawesome.io/icons/

## Open graph metadata
To enable a nice preview of the site in social media, define the
following properties in the build:

@@ snip [build.sbt]($root$/build.sbt) { #open-graph }

## Copyright Notice

To display a copyright notice in the footer configure the
Expand Down
9 changes: 9 additions & 0 deletions theme/src/main/assets/page.st
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ $!
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="description" content="$page.properties.("project.description")$">
$ if (page.properties.("title")) $
<meta property="og:title" content="$page.properties.("title")$">
$ endif $
$ if (page.properties.("project.description")) $
<meta property="og:description" content="$page.properties.("project.description")$">
$ endif $
$ if (page.properties.("project.image")) $
<meta property="og:image" content="$page.properties.("project.image")$">
$ endif $
<meta name="generator" content="Paradox, paradox-material-theme=$page.properties.("material.theme.version")$, mkdocs-material=3.0.3">

$partials/language()$
Expand Down