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

github.com/jesselau76/hugo-w3-simple.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjesselau76 <jesselau76@gmail.com>2019-04-04 05:29:43 +0300
committerjesselau76 <jesselau76@gmail.com>2019-04-04 05:29:43 +0300
commit2f76a595a9bbd3dbf0714b5244fbd0219f81b517 (patch)
tree76cf22ebc6269b265b2bf30c381d1aaa9458db36
parentc8ace733fc119a9e07bcd63147b25ebbeff970f5 (diff)
title set by lang
-rw-r--r--exampleSite/config.toml4
-rw-r--r--layouts/partials/head.html6
2 files changed, 6 insertions, 4 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 634aac1..de056fb 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -1,7 +1,7 @@
baseurl = "https://example.com/"
languageCode = "en-us"
defaultContentLanguage = "en" # en / zh-CN / ... (This field determines which i18n file to use)
-title = "Hugo W3 Simple Theme"
+
theme = "hugo-w3-simple"
disqusShortname = "" # disqus_shortname
googleAnalytics = "" # UA-XXXXXXXX-X
@@ -13,6 +13,7 @@ weight = 0
languageName = "English"
contentDir = "content/english"
[languages.en.params]
+ title = "Hugo W3 Simple Theme"
authorinfo = "<h4>Authored By John Doe</h4>"
licenseinfo = "<p class=\"w3-small\">John Doe, a good man living on the earth, loving making website with hugo. This article is licensed under a <a rel=\"license\" href=\"https://creativecommons.org/licenses/by/4.0/\" class=\"w3-text-white\">Creative Commons Attribution 4.0 International License</a>.</p>"
logotext = "HUGO W3 SIMPLE" # logo text
@@ -50,6 +51,7 @@ languageName = "Chinese"
contentDir = "content/chinese"
[languages.zh-cn.params]
+ title = "王一贴的博客"
authorinfo = "<h4>本文由王一贴原创</h4>"
licenseinfo = '<p class="w3-small">王一贴,曾记录于《红楼梦》第八十回人物。任何问题,一贴搞定.<br>本文采用<a rel="license" href="http://creativecommons.org/licenses/by/4.0/" class="w3-text-white">知识共享署名 4.0 国际许可协议</a>进行许可。</p>'
logotext = "王一贴的博客" # logo text
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index e8bc5c4..466508d 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -12,11 +12,11 @@
{{ .Hugo.Generator }}
{{ if .IsHome }}
- {{ $.Scratch.Set "theTitle" .Site.Title }}
+ {{ $.Scratch.Set "theTitle" .Site.Params.Title }}
{{else}}
- {{ $.Scratch.Add "theTitle" .Title}}
+ {{ $.Scratch.Set "theTitle" .Title}}
{{ $.Scratch.Add "theTitle" " • "}}
- {{ $.Scratch.Add "theTitle" .Site.Title}}
+ {{ $.Scratch.Add "theTitle" .Site.Params.Title}}
{{ end }}
<title>{{ $.Scratch.Get "theTitle" }}</title>
{{ with .Site.Params.meta.description }}<meta name="description" content="{{ . }}">{{ end }}