diff options
author | uPagge <upagge@mail.ru> | 2020-12-17 20:32:32 +0300 |
---|---|---|
committer | uPagge <upagge@mail.ru> | 2020-12-17 20:32:32 +0300 |
commit | e9df55ee473e9b4d4171c4959275ea96782fa975 (patch) | |
tree | c930571a85776e3f65c1a4699c35ebaf92a2592c /layouts/partials | |
parent | 0789bd8e1050a44a6cddee8a2f2402324243fd90 (diff) |
timeAgo
Diffstat (limited to 'layouts/partials')
-rw-r--r-- | layouts/partials/assets.html | 8 | ||||
-rw-r--r-- | layouts/partials/plugin/timeago.html | 19 |
2 files changed, 26 insertions, 1 deletions
diff --git a/layouts/partials/assets.html b/layouts/partials/assets.html index 2ae78b7..10db3d6 100644 --- a/layouts/partials/assets.html +++ b/layouts/partials/assets.html @@ -192,6 +192,12 @@ {{- dict "Source" "js/theme.min.js" "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}} {{- $_ := (resources.Get "js/theme.min.js.map").RelPermalink -}} +{{- /* Jquery script */ -}} +{{- dict "Source" "js/jquery-3.5.1.min.js" "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}} +{{- $_ := (resources.Get "js/jquery-3.5.1.min.map").RelPermalink -}} + +{{- partial "plugin/timeago.html" . -}} + {{- with (.Scratch.Get "this").scriptArr -}} {{- delimit . "\n" | dict "Content" | dict "Scratch" $.Scratch "Data" | partial "scratch/script.html" -}} {{- end -}} @@ -204,4 +210,4 @@ {{- partial "plugin/script.html" . -}} {{- end -}} -{{- partial "plugin/analytics.html" . -}} +{{- partial "plugin/analytics.html" . -}}
\ No newline at end of file diff --git a/layouts/partials/plugin/timeago.html b/layouts/partials/plugin/timeago.html new file mode 100644 index 0000000..c8e6399 --- /dev/null +++ b/layouts/partials/plugin/timeago.html @@ -0,0 +1,19 @@ +{{- $fingerprint := .Scratch.Get "fingerprint" -}} +{{- $timeAgoLang := .Site.Params.TimeAgo.Lang -}} +{{- $timeAgoEnable := .Site.Params.TimeAgo.Enable -}} + +{{- if $timeAgoEnable }} +{{- /* Timeago script */ -}} +{{- dict "Source" "js/timeago.min.js" "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}} +{{- $_ := (resources.Get "js/timeago.min.js.map").RelPermalink -}} + +{{- if $timeAgoLang }} +{{- /* Timeago language script */ -}} +{{- dict "Source" (printf "js/timeago/timeago.%v.min.js" $timeAgoLang) "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}} +{{- $_ := (resources.Get (printf "js/timeago/timeago.%v.min.js.map" $timeAgoLang)).RelPermalink -}} +{{- end -}} + +{{- /* Timeago starter script */ -}} +{{- dict "Source" "js/timeago_starter.min.js" "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}} +{{- $_ := (resources.Get "js/timeago_starter.min.js.map").RelPermalink -}} +{{- end -}}
\ No newline at end of file |