feat: add TypeIt and CountDown
This commit is contained in:
17
layouts/shortcodes/countdown.html
Normal file
17
layouts/shortcodes/countdown.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{{ if .Get "id" }}
|
||||
{{ $id := .Get "id" }}
|
||||
{{ with .Get "class" }}
|
||||
<div id={{ $id }} class="{{ . }}"></div>
|
||||
{{ else }}
|
||||
<div id={{ $id }}></div>
|
||||
{{ end }}
|
||||
{{ $id = printf "#%s" $id }}
|
||||
{{ with .Get "date" }}
|
||||
<script>
|
||||
if (!window.countdownMap) {
|
||||
var countdownMap = {}
|
||||
}
|
||||
countdownMap["{{ $id }}"] = {{ . }};
|
||||
</script>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
15
layouts/shortcodes/typeit.html
Normal file
15
layouts/shortcodes/typeit.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{{ if .Get "id" }}
|
||||
{{ $id := .Get "id" }}
|
||||
{{ with .Get "class" }}
|
||||
<div id={{ $id }} class="{{ . }}"></div>
|
||||
{{ else }}
|
||||
<div id={{ $id }}></div>
|
||||
{{ end }}
|
||||
{{ $id = printf "#%s" $id }}
|
||||
<script>
|
||||
if (!typeitMap) {
|
||||
var typeitMap = {}
|
||||
}
|
||||
typeitMap["{{ $id }}"] = {{ .Inner | safeHTML }};
|
||||
</script>
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user