feat(header): support header title typeit (#306)
This commit is contained in:
@@ -655,6 +655,9 @@ enableEmoji = true
|
|||||||
# you can add extra information after the name (HTML format is supported), such as icons
|
# you can add extra information after the name (HTML format is supported), such as icons
|
||||||
# 你可以在名称 (允许 HTML 格式) 之后添加其他信息, 例如图标
|
# 你可以在名称 (允许 HTML 格式) 之后添加其他信息, 例如图标
|
||||||
post = ""
|
post = ""
|
||||||
|
# whether to use typeit animation for title name
|
||||||
|
# 是否为副标题显示打字机动画
|
||||||
|
typeit = false
|
||||||
|
|
||||||
# Footer config
|
# Footer config
|
||||||
# 页面底部信息配置
|
# 页面底部信息配置
|
||||||
|
|||||||
@@ -254,6 +254,8 @@ Please open the code block below to view the complete sample configuration :(far
|
|||||||
pre = ""
|
pre = ""
|
||||||
# you can add extra information after the name (HTML format is supported), such as icons
|
# you can add extra information after the name (HTML format is supported), such as icons
|
||||||
post = ""
|
post = ""
|
||||||
|
# whether to use typeit animation for title name
|
||||||
|
typeit = false
|
||||||
|
|
||||||
# Footer config
|
# Footer config
|
||||||
[params.footer]
|
[params.footer]
|
||||||
|
|||||||
@@ -259,6 +259,8 @@ Please open the code block below to view the complete sample configuration :(far
|
|||||||
pre = ""
|
pre = ""
|
||||||
# you can add extra information after the name (HTML format is supported), such as icons
|
# you can add extra information after the name (HTML format is supported), such as icons
|
||||||
post = ""
|
post = ""
|
||||||
|
# whether to use typeit animation for title name
|
||||||
|
typeit = false
|
||||||
|
|
||||||
# Footer config
|
# Footer config
|
||||||
[params.footer]
|
[params.footer]
|
||||||
|
|||||||
@@ -257,6 +257,8 @@ hugo
|
|||||||
pre = ""
|
pre = ""
|
||||||
# 你可以在名称 (允许 HTML 格式) 之后添加其他信息, 例如图标
|
# 你可以在名称 (允许 HTML 格式) 之后添加其他信息, 例如图标
|
||||||
post = ""
|
post = ""
|
||||||
|
# 是否为副标题显示打字机动画
|
||||||
|
typeit = false
|
||||||
|
|
||||||
# 页面底部信息配置
|
# 页面底部信息配置
|
||||||
[params.footer]
|
[params.footer]
|
||||||
|
|||||||
@@ -10,7 +10,13 @@
|
|||||||
{{- with .pre -}}
|
{{- with .pre -}}
|
||||||
<span class="header-title-pre">{{ . | safeHTML }}</span>
|
<span class="header-title-pre">{{ . | safeHTML }}</span>
|
||||||
{{- end -}}
|
{{- 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 -}}
|
{{- .name -}}
|
||||||
|
{{- end -}}
|
||||||
{{- with .post -}}
|
{{- with .post -}}
|
||||||
<span class="header-title-post">{{ . | safeHTML }}</span>
|
<span class="header-title-post">{{ . | safeHTML }}</span>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
@@ -88,7 +94,13 @@
|
|||||||
{{- with .pre -}}
|
{{- with .pre -}}
|
||||||
<span class="header-title-pre">{{ . | safeHTML }}</span>
|
<span class="header-title-pre">{{ . | safeHTML }}</span>
|
||||||
{{- end -}}
|
{{- 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 -}}
|
{{- .name -}}
|
||||||
|
{{- end -}}
|
||||||
{{- with .post -}}
|
{{- with .post -}}
|
||||||
<span class="header-title-post">{{ . | safeHTML }}</span>
|
<span class="header-title-post">{{ . | safeHTML }}</span>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|||||||
Reference in New Issue
Block a user