Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CaiJimmy/hugo-theme-stack.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFarisZR <35614734+FarisZR@users.noreply.github.com>2022-10-22 12:56:38 +0300
committerGitHub <noreply@github.com>2022-10-22 12:56:38 +0300
commit70f431ea1803b2bf6daa8e964064bb8ecc9fa70a (patch)
treee81c703f67dabe9b5711adece40733890913527c
parent30fdd000f9de7ccf55490fb553d1c4519acbfac4 (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.yaml3
-rw-r--r--layouts/partials/data/description.html5
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 }}