Merge pull request #545 from khusika/home-feat

feat(home): allow HTML format in subtitle
This commit is contained in:
Dillon 2022-05-21 23:36:18 +08:00 committed by GitHub
commit 0fe4c38d6b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 7 deletions

View file

@ -179,8 +179,8 @@
# title shown in home page (HTML format is supported) # title shown in home page (HTML format is supported)
# 主页显示的网站标题 (支持 HTML 格式) # 主页显示的网站标题 (支持 HTML 格式)
title = "" title = ""
# subtitle shown in home page # subtitle shown in home page (HTML format is supported)
# 主页显示的网站副标题 # 主页显示的网站副标题 (允许 HTML 格式)
subtitle = "This is my cool site" subtitle = "This is my cool site"
# whether to use typeit animation for subtitle # whether to use typeit animation for subtitle
# 是否为副标题显示打字机动画 # 是否为副标题显示打字机动画

View file

@ -261,8 +261,8 @@ enableEmoji = true
# title shown in home page (HTML format is supported) # title shown in home page (HTML format is supported)
# 主页显示的网站标题 (支持 HTML 格式) # 主页显示的网站标题 (支持 HTML 格式)
title = "" title = ""
# subtitle shown in home page # subtitle shown in home page (HTML format is supported)
# 主页显示的网站副标题 # 主页显示的网站副标题 (允许 HTML 格式)
subtitle = "A Clean, Elegant but Advanced Hugo Theme" subtitle = "A Clean, Elegant but Advanced Hugo Theme"
# whether to use typeit animation for subtitle # whether to use typeit animation for subtitle
# 是否为副标题显示打字机动画 # 是否为副标题显示打字机动画

View file

@ -322,7 +322,7 @@ Please open the code block below to view the complete sample configuration :(far
avatarURL = "/images/avatar.png" avatarURL = "/images/avatar.png"
# {{< version 0.2.7 changed >}} title shown in home page (HTML format is supported) # {{< version 0.2.7 changed >}} title shown in home page (HTML format is supported)
title = "" title = ""
# subtitle shown in home page # subtitle shown in home page (HTML format is supported)
subtitle = "This is My New Hugo Site" subtitle = "This is My New Hugo Site"
# whether to use typeit animation for subtitle # whether to use typeit animation for subtitle
typeit = true typeit = true

View file

@ -324,7 +324,7 @@ hugo
avatarURL = "/images/avatar.png" avatarURL = "/images/avatar.png"
# {{< version 0.2.7 changed >}} 主页显示的网站标题 (支持 HTML 格式) # {{< version 0.2.7 changed >}} 主页显示的网站标题 (支持 HTML 格式)
title = "" title = ""
# 主页显示的网站副标题 # 主页显示的网站副标题 (允许 HTML 格式)
subtitle = "这是我的全新 Hugo 网站" subtitle = "这是我的全新 Hugo 网站"
# 是否为副标题显示打字机动画 # 是否为副标题显示打字机动画
typeit = true typeit = true

View file

@ -34,7 +34,7 @@
<div id="{{ $id }}" class="typeit"></div> <div id="{{ $id }}" class="typeit"></div>
{{- dict $id (slice $id) | dict "typeitMap" | merge ($.Scratch.Get "this") | $.Scratch.Set "this" -}} {{- dict $id (slice $id) | dict "typeitMap" | merge ($.Scratch.Get "this") | $.Scratch.Set "this" -}}
{{- else -}} {{- else -}}
{{- . -}} {{- . | safeHTML -}}
{{- end -}} {{- end -}}
</div> </div>
{{- end -}} {{- end -}}