1
0
Fork 0
mirror of https://github.com/dillonzq/LoveIt.git synced 2025-04-17 19:11:57 +02:00

feat(header): support header title typeit ()

This commit is contained in:
Dave A-W 2020-05-03 11:15:42 +08:00 committed by GitHub
parent 09a7c95362
commit 8c706548c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 0 deletions

View file

@ -655,6 +655,9 @@ enableEmoji = true
# you can add extra information after the name (HTML format is supported), such as icons
# 你可以在名称 (允许 HTML 格式) 之后添加其他信息, 例如图标
post = ""
# whether to use typeit animation for title name
# 是否为副标题显示打字机动画
typeit = false
# Footer config
# 页面底部信息配置

View file

@ -254,6 +254,8 @@ Please open the code block below to view the complete sample configuration :(far
pre = ""
# you can add extra information after the name (HTML format is supported), such as icons
post = ""
# whether to use typeit animation for title name
typeit = false
# Footer config
[params.footer]

View file

@ -259,6 +259,8 @@ Please open the code block below to view the complete sample configuration :(far
pre = ""
# you can add extra information after the name (HTML format is supported), such as icons
post = ""
# whether to use typeit animation for title name
typeit = false
# Footer config
[params.footer]

View file

@ -257,6 +257,8 @@ hugo
pre = ""
# 你可以在名称 (允许 HTML 格式) 之后添加其他信息, 例如图标
post = ""
# 是否为副标题显示打字机动画
typeit = false
# 页面底部信息配置
[params.footer]

View file

@ -10,7 +10,13 @@
{{- with .pre -}}
<span class="header-title-pre">{{ . | safeHTML }}</span>
{{- end -}}
{{- if .typeit -}}
{{- $id := dict "content" .name "scratch" $.Scratch | partial "function/id.html" -}}
<span id="{{ $id }}" class="typeit"></span>
{{- dict $id (slice $id) | dict "typeitMap" | merge ($.Scratch.Get "this") | $.Scratch.Set "this" -}}
{{- else -}}
{{- .name -}}
{{- end -}}
{{- with .post -}}
<span class="header-title-post">{{ . | safeHTML }}</span>
{{- end -}}
@ -88,7 +94,13 @@
{{- with .pre -}}
<span class="header-title-pre">{{ . | safeHTML }}</span>
{{- end -}}
{{- if .typeit -}}
{{- $id := dict "content" .name "scratch" $.Scratch | partial "function/id.html" -}}
<span id="{{ $id }}" class="typeit"></span>
{{- dict $id (slice $id) | dict "typeitMap" | merge ($.Scratch.Get "this") | $.Scratch.Set "this" -}}
{{- else -}}
{{- .name -}}
{{- end -}}
{{- with .post -}}
<span class="header-title-post">{{ . | safeHTML }}</span>
{{- end -}}