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)
This commit is contained in:
FarisZR 2022-10-22 12:56:38 +03:00 committed by GitHub
parent 30fdd000f9
commit 70f431ea18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -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

View file

@ -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 }}