Compare commits
3 commits
90a74dd3e1
...
0a845d402f
Author | SHA1 | Date | |
---|---|---|---|
Yash Karandikar | 0a845d402f | ||
Yash Karandikar | a6f720d626 | ||
Yash Karandikar | cb4ddb35aa |
|
@ -6,12 +6,19 @@
|
|||
<link rel="stylesheet" href="/style.css">
|
||||
<link href="/fonts.css" rel="stylesheet">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta property="og:title" content="Welcome to Yash's Website!" />
|
||||
<meta property="og:title" content="karx's website" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content="{{ current_url }}" />
|
||||
<meta property="og:image" content="https://karx.xyz/favicon.ico" />
|
||||
|
||||
<title>{% block title %} {% endblock title %} - karx's website</title>
|
||||
|
||||
<script type="module">
|
||||
import flamethrower from "https://esm.sh/v90/flamethrower-router";
|
||||
flamethrower({log: true, pageTransitions: true});
|
||||
</script>
|
||||
|
||||
{% block headext %} {% endblock headext %}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
|
@ -15,11 +15,55 @@
|
|||
</i></strong>
|
||||
</p>
|
||||
{{ page.content | safe }}
|
||||
<script src="https://utteranc.es/client.js"
|
||||
repo="karx1/site-comments"
|
||||
issue-term="pathname"
|
||||
theme="photon-dark"
|
||||
<script src="https://giscus.app/client.js"
|
||||
data-repo="karx1/site-comments"
|
||||
data-repo-id="R_kgDOH0rjbA"
|
||||
data-category="Announcements"
|
||||
data-category-id="DIC_kwDOH0rjbM4CYkSv"
|
||||
data-mapping="pathname"
|
||||
data-strict="0"
|
||||
data-reactions-enabled="1"
|
||||
data-emit-metadata="0"
|
||||
data-input-position="bottom"
|
||||
data-theme="cobalt"
|
||||
data-lang="en"
|
||||
data-loading="lazy"
|
||||
crossorigin="anonymous"
|
||||
async>
|
||||
async
|
||||
data-reload>
|
||||
</script>
|
||||
{% endblock content %}
|
||||
|
||||
{% block headext %}
|
||||
<script data-reload>
|
||||
// handler for pages loaded through flamethrower
|
||||
function handleMessage(event) {
|
||||
if (event.origin !== 'https://giscus.app') return;
|
||||
if (!(typeof event.data === 'object' && event.data.giscus)) return;
|
||||
|
||||
const giscusData = event.data.giscus;
|
||||
if ('error' in giscusData) {
|
||||
if (giscusData.error.includes("not installed")) {
|
||||
console.log("Hello from handler " + giscusData.error);
|
||||
sendMessage({
|
||||
setConfig: {
|
||||
repo: "karx1/site-comments",
|
||||
theme: "cobalt",
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function sendMessage(message) {
|
||||
const iframe = document.querySelector("iframe.giscus-frame");
|
||||
if (!iframe) return;
|
||||
iframe.contentWindow.postMessage({ giscus: message }, "*");
|
||||
console.log("Sent message to giscus");
|
||||
}
|
||||
|
||||
|
||||
window.removeEventListener('message', handleMessage); // remove any old event listeners
|
||||
window.addEventListener('message', handleMessage);
|
||||
</script>
|
||||
{% endblock headext %}
|
||||
|
|
Loading…
Reference in a new issue