sync theme
This commit is contained in:
parent
8db6bd0e55
commit
8f3d03b188
53 changed files with 1747 additions and 213 deletions
|
@ -6,4 +6,7 @@
|
|||
{{ end }}
|
||||
{{ with site.Params.umamiAnalytics.websiteid }}
|
||||
{{ partial "analytics/umami.html" }}
|
||||
{{ end }}
|
||||
{{ with site.Params.selineAnalytics.token }}
|
||||
{{ partial "analytics/seline.html" }}
|
||||
{{ end }}
|
18
themes/blowfish/layouts/partials/analytics/seline.html
Normal file
18
themes/blowfish/layouts/partials/analytics/seline.html
Normal file
|
@ -0,0 +1,18 @@
|
|||
<script async src="https://cdn.seline.so/seline.js" data-token="{{ site.Params.selineAnalytics.token }}" data-id="seline-script"></script>
|
||||
|
||||
{{ if .Site.Params.selineAnalytics.enableTrackEvent | default true }}
|
||||
<script type="text/javascript">
|
||||
document.querySelector('script[data-id="seline-script"]')
|
||||
.addEventListener('load', function () {
|
||||
const type = document.head.querySelector('meta[property = "og:type"]').getAttribute('content');
|
||||
let title = document.head.querySelector('meta[property = "og:title"]').getAttribute('content');
|
||||
let url = document.head.querySelector('meta[property = "og:url"]').getAttribute('content');
|
||||
|
||||
seline.track("user:" + type + ':' + title, {
|
||||
type: type,
|
||||
title: title,
|
||||
url: url
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{{ end }}
|
|
@ -10,6 +10,7 @@
|
|||
</script>
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.Params.umamiAnalytics.enableTrackEvent | default true }}
|
||||
<script type="text/javascript">
|
||||
document.querySelector('script[data-id="umami-script"]')
|
||||
.addEventListener('load', function () {
|
||||
|
@ -18,4 +19,5 @@
|
|||
let url = document.head.querySelector('meta[property = "og:url"]').getAttribute('content');
|
||||
umami.track(type + ':' + title, {'url': url});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
{{ end }}
|
Loading…
Add table
Add a link
Reference in a new issue