chore: debug
This commit is contained in:
parent
efd6f7445f
commit
86ab1d894d
5 changed files with 61 additions and 3 deletions
|
@ -15,6 +15,10 @@
|
|||
{% render "../assets/styles/index.css" %}
|
||||
{% endcapture %}
|
||||
<style>{{ css }}</style>
|
||||
{% capture js %}
|
||||
{% render "../assets/scripts/index.js" %}
|
||||
{% endcapture %}
|
||||
<script>{{ js }}</script>
|
||||
<script src="https://cdn.usefathom.com/script.js" data-site="CWSVCDJC" defer></script>
|
||||
<link rel="canonical" href="{{ fullUrl }}" />
|
||||
<meta property="og:title" content="{{ pageTitle }}" />
|
||||
|
@ -86,6 +90,7 @@
|
|||
{% endif %}
|
||||
<noscript>
|
||||
<style>.client-side {display:none}</style>
|
||||
<img src="/api/event?page={{ fullUrl }}&ns=true" />
|
||||
</noscript>
|
||||
</head>
|
||||
<body>
|
||||
|
|
15
src/assets/scripts/index.js
Normal file
15
src/assets/scripts/index.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
const id = Math.floor(Math.random() * Date.now())
|
||||
let i;
|
||||
if (window.sessionStorage && !window.sessionStorage?.getItem('id')) sessionStorage.setItem('id', id)
|
||||
if (window.localStorage && window.localStorage.getItem('i')) i = localStorage.getItem('i')
|
||||
if (!window.fathom) {
|
||||
fetch(`https://coryd.dev/api/event/?page=${encodeURIComponent(window.location.href)}&num=${sessionStorage.getItem('id' || id)}&lang=${navigator.language}&nav=${navigator.userAgent}&i=${i}`)
|
||||
.then((data) => {
|
||||
console.log(data)
|
||||
return {}
|
||||
})
|
||||
.catch(err => {
|
||||
console.log(err);
|
||||
return {}
|
||||
});
|
||||
}
|
Reference in a new issue