mirror of
https://github.com/dillonzq/LoveIt.git
synced 2024-11-14 02:46:16 +01:00
feat: add subtitle typeit
This commit is contained in:
parent
0b85b03f62
commit
5e55b25c8a
4 changed files with 19 additions and 8 deletions
|
@ -16,10 +16,10 @@
|
|||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ with .Site.Params.subtitle}}
|
||||
<h2 class="description">
|
||||
{{ . }}
|
||||
</h2>
|
||||
{{ with .Site.Params.subtitle }}
|
||||
<h2 class="description">
|
||||
<div id="subtitle"></div>
|
||||
</h2>
|
||||
{{ end }}
|
||||
|
||||
</div>
|
||||
|
|
|
@ -12,8 +12,10 @@
|
|||
<div class="avatar"><a href="/posts/"> <img src={{ $avatar }} alt="avatar"></a></div>
|
||||
{{ end }}
|
||||
|
||||
{{ with .Site.Params.subtitle}}
|
||||
<h2 class="description">{{ . }}</h2>
|
||||
{{ with .Site.Params.subtitle }}
|
||||
<h2 class="description">
|
||||
<div id="subtitle"></div>
|
||||
</h2>
|
||||
{{ end }}
|
||||
|
||||
<div class="social-links">
|
||||
|
|
|
@ -36,11 +36,20 @@
|
|||
{{ $countdown := `
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery-countdown@2.2.0/dist/jquery.countdown.min.js" integrity="sha256-Ikk5myJowmDQaYVCUD0Wr+vIDkN8hGI58SGWdE671A8=" crossorigin="anonymous"></script>
|
||||
` }}
|
||||
|
||||
{{ $jquery | safeHTML }}
|
||||
{{ $typeit | safeHTML }}
|
||||
{{ with .Site.Params.subtitle }}
|
||||
<script>
|
||||
if (!window.typeitMap) {
|
||||
var typeitMap = {}
|
||||
}
|
||||
typeitMap["#subtitle"] = "{{ . }}";
|
||||
</script>
|
||||
{{ end }}
|
||||
|
||||
{{ if .IsPage }}
|
||||
{{ $prettify | safeHTML }}
|
||||
{{ $typeit | safeHTML }}
|
||||
{{ $countdown | safeHTML }}
|
||||
{{ $scripts = $scripts | append $dynamicToTop }}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
{{ end }}
|
||||
{{ $id = printf "#%s" $id }}
|
||||
<script>
|
||||
if (!typeitMap) {
|
||||
if (!window.typeitMap) {
|
||||
var typeitMap = {}
|
||||
}
|
||||
typeitMap["{{ $id }}"] = {{ .Inner | safeHTML }};
|
||||
|
|
Loading…
Reference in a new issue