Skip to content

Commit

Permalink
Use Bluesky to power comments! 🦋
Browse files Browse the repository at this point in the history
  • Loading branch information
kutyel committed Nov 26, 2024
1 parent 3f74c46 commit 1b21e4a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 28 deletions.
6 changes: 0 additions & 6 deletions src/css/article.css
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,6 @@ article > header small {
}
}

.giscus,
.giscus-frame {
max-width: 600px;
margin: 0 auto;
}

/* FOOTER */

footer {
Expand Down
1 change: 1 addition & 0 deletions src/posts/2024-09-17-japanese-n3.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ keywords: 'japanese,english,noken,languages,polyglot'
lang: 'en'
title: 'My Journey to Japanese N3 Level'
date: '2024-09-18T15:00:00Z'
postId: 'at://did:plc:dvrocvv5szl2evqiafsx4iyw/app.bsky.feed.post/3lbu2ym72422p'
---

<img src="./images/n3.png" alt="logo" width="650px">
Expand Down
5 changes: 0 additions & 5 deletions src/templates/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@
localStorage.setItem('theme', name);
window.site.theme = name;
window.site.refreshThemeSwitch();

document.querySelector('iframe.giscus-frame')?.contentWindow.postMessage(
{ giscus: { setConfig: { theme: name === 'dark' ? 'dark_dimmed' : 'light' } } },
'https://giscus.app'
);
},
refreshThemeSwitch: () => {
const isLight = window.site.theme === 'light';
Expand Down
36 changes: 19 additions & 17 deletions src/templates/post.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
$partial("templates/nav.html")$

<style>
bsky-comments {
--background-color: var(--bgColor);
--text-color: var(--textColor);
--link-color: var(--textLinkColor);
--link-hover-color: var(--textLinkHoverColor);
--comment-meta-color: #888;
--error-color: #ff4d4d;
--reply-border-color: var(--separatorColor);
--button-background-color: var(--btnBgColor);
--button-hover-background-color: rgba(var(--btnBgColor), 0.2);
--author-avatar-border-radius: 50%;
}
</style>

<main id="content" tabindex="-1">
<article>
<header>
Expand All @@ -16,7 +31,9 @@ <h1>$title$</h1>
</article>
</main>

<div class="giscus" style="max-width: 600px; margin: 0 auto;"></div>
$if(postId)$
<bsky-comments post="$postId$"></bsky-comments>
$endif$

<footer class="section--padded">
<div class="layout--constrained">
Expand All @@ -41,19 +58,4 @@ <h1>$title$</h1>
</footer>

<script async src="./js/time.js"></script>

<script src="https://giscus.app/client.js"
data-repo="kutyel/kutyel-hakyll"
data-repo-id="R_kgDOJAKzeQ"
data-category="Announcements"
data-category-id="DIC_kwDOJAKzec4CZFzP"
data-mapping="pathname"
data-strict="0"
data-reactions-enabled="1"
data-emit-metadata="0"
data-input-position="top"
data-theme="dark_dimmed"
data-lang="en"
crossorigin="anonymous"
async>
</script>
<script src="https://gistcdn.githack.com/kutyel/41d12e099484fd390fb67168271fcdd9/raw/9be26e500525a2e4edacc53d3a8006aaddec0e15/bsky-comments.js"></script>

0 comments on commit 1b21e4a

Please sign in to comment.