diff options
author | FarisZR <35614734+FarisZR@users.noreply.github.com> | 2022-10-22 12:56:38 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-22 12:56:38 +0300 |
commit | 70f431ea1803b2bf6daa8e964064bb8ecc9fa70a (patch) | |
tree | e81c703f67dabe9b5711adece40733890913527c | |
parent | 30fdd000f9de7ccf55490fb553d1c4519acbfac4 (diff) |
feat: add a separate configuration field for site description (#672)
* Add an optional site description option
* Add site description to the example site (Chinese Auto-translated)
-rw-r--r-- | exampleSite/config.yaml | 3 | ||||
-rw-r--r-- | layouts/partials/data/description.html | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index f723d96..c1b48dd 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -8,15 +8,18 @@ languages: en: languageName: English title: Example Site + description: Example description weight: 1 zh-cn: languageName: 中文 title: 演示站点 + description: 演示说明 weight: 2 ar: languageName: عربي languagedirection: rtl title: موقع تجريبي + description: وصف تجريبي weight: 3 # Change it to your Disqus shortname before using diff --git a/layouts/partials/data/description.html b/layouts/partials/data/description.html index f63d603..4f54e5c 100644 --- a/layouts/partials/data/description.html +++ b/layouts/partials/data/description.html @@ -1,6 +1,11 @@ <!-- Use site subtitle by default --> {{ $description := .Site.Params.sidebar.subtitle }} +<!-- Seprate description exists --> +{{ if .Site.Params.description }} + {{ $description = .Site.Params.description }} +{{ end }} + {{ if .Description }} <!-- Page description exists --> {{ $description = .Description }} |