mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-02-06 11:53:31 +08:00
feat: add Bluesky comments support
This commit is contained in:
parent
087989e427
commit
0a3fd094a4
@ -25,6 +25,12 @@
|
|||||||
|
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
{{ partial "article/article.html" . }}
|
{{ partial "article/article.html" . }}
|
||||||
|
|
||||||
|
{{ with .Params.bsky_post }}
|
||||||
|
{{ if . }}
|
||||||
|
{{ partial "bsky-comments.html" . }}
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{ if .Params.links }}
|
{{ if .Params.links }}
|
||||||
{{ partial "article/components/links" . }}
|
{{ partial "article/components/links" . }}
|
||||||
|
29
layouts/partials/comments/bsky-comments.html
Normal file
29
layouts/partials/comments/bsky-comments.html
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<script type="module" src="https://cdn.jsdelivr.net/gh/Siya-33/static@1.2.7/js/bsky-comments.js"></script>
|
||||||
|
<bsky-comments post="{{ . }}" ></bsky-comments>
|
||||||
|
<style>
|
||||||
|
bsky-comments {
|
||||||
|
--background-color: var(--card-background);
|
||||||
|
--text-color: var(--card-text-color-main);
|
||||||
|
--link-color: var(--code-text-color);
|
||||||
|
--comment-meta-color: #5E9595;
|
||||||
|
--error-color: red;
|
||||||
|
--reply-border-color: transparent;
|
||||||
|
--button-background-color: var(--code-background-color);
|
||||||
|
--author-avatar-border-radius: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<!-- custom style -->
|
||||||
|
<!-- <script>
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
const bskyComments = document.querySelector('bsky-comments');
|
||||||
|
if (bskyComments) {
|
||||||
|
const style = document.createElement('style');
|
||||||
|
style.textContent = `
|
||||||
|
comments {
|
||||||
|
border-radius: var(--card-border-radius);
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
bskyComments.shadowRoot.appendChild(style);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script> -->
|
Loading…
Reference in New Issue
Block a user