Skip to content

Commit

Permalink
Merge branch 'main' into prod
Browse files Browse the repository at this point in the history
# Conflicts:
#	package.json
#	src/components/Comment.astro
#	src/content/data/links.json
#	src/pages/posts/[...slug].astro
  • Loading branch information
Jazee6 committed Dec 28, 2024
2 parents 794df04 + 65d2aae commit 3c4a516
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 38 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "astro-blur",
"type": "module",
"version": "0.3.0",
"version": "0.3.1",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
Expand Down
15 changes: 15 additions & 0 deletions src/components/Comment.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
---
---
<div class="bg-base transition-all rounded-xl px-6 pt-2 pb-4 mt-4">
<div id="comment" class="h-64 animate-pulse bg-back rounded-xl mt-2"></div>
</div>
<script is:inline src="https://cdn.staticfile.net/twikoo/1.6.40/twikoo.all.min.js"/>
<script>
import {siteConfig} from "../config";

if (siteConfig.twikoo_uri !== undefined) {
let twikoo: any = window['twikoo']
twikoo.init({
envId: siteConfig.twikoo_uri,
el: '#comment',
lang: navigator.language,
})
}
</script>
20 changes: 2 additions & 18 deletions src/layouts/PageLayout.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
import BaseLayout from "./BaseLayout.astro";
import {siteConfig} from "../config";
import Comment from "../components/Comment.astro";
interface Props {
title?: string;
Expand All @@ -19,27 +20,10 @@ const {title, description, image, comments} = Astro.props

{
comments && siteConfig.twikoo_uri &&
(
<div class="bg-base transition-all rounded-xl px-6 pt-2 pb-4 mt-4">
<div id="comment" class="h-64 animate-pulse bg-back rounded-xl mt-2"></div>
</div>
)
<Comment/>
}
</div>
</main>
</BaseLayout>

{comments && siteConfig.twikoo_uri &&
<script is:inline src="https://cdn.staticfile.net/twikoo/1.6.36/twikoo.all.min.js"/>}
<script>
import {siteConfig} from "../config";

if (document.querySelector('#comment') !== null) {
let twikoo: any = window['twikoo']
twikoo.init({
envId: siteConfig.twikoo_uri,
el: '#comment',
lang: navigator.language,
})
}
</script>
20 changes: 1 addition & 19 deletions src/pages/posts/[...slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,13 @@ const {Content, headings, remarkPluginFrontmatter} = await render(post);
</article>
{
siteConfig.twikoo_uri &&
(
<div class="bg-base transition-all rounded-xl px-6 pt-2 pb-4 mt-4">
<div id="comment" class="h-64 animate-pulse bg-back rounded-xl mt-2"></div>
</div>
)
<Comment/>
}
</div>
{
siteConfig.twikoo_uri &&
<Comment/>
}
</MainLayout>

<script>
import {debounce} from "../../utils";
import {siteConfig} from "../../config";

const links = document.querySelectorAll('.menu-item');
const handler = debounce(() => {
Expand All @@ -104,13 +95,4 @@ const {Content, headings, remarkPluginFrontmatter} = await render(post);
})
document.addEventListener('scroll', handler)
document.addEventListener('DOMContentLoaded', handler)

if (siteConfig.twikoo_uri !== undefined) {
let twikoo: any = window['twikoo']
twikoo.init({
envId: siteConfig.twikoo_uri,
el: '#comment',
lang: navigator.language,
})
}
</script>

0 comments on commit 3c4a516

Please sign in to comment.