From 16f1d3ea9b60e4e1d7f8ee2792e6529d6e9a0959 Mon Sep 17 00:00:00 2001 From: Neeldhara Misra Date: Wed, 24 Jun 2026 02:17:20 +0530 Subject: [PATCH] Replace Hyvor with Coral on Micro --- public/coral-transparent.css | 24 ++++++++++ src/components/CoralComments.astro | 58 +++++++++++++++++++++++++ src/components/Head.astro | 9 ---- src/components/Hyvor.astro | 70 ------------------------------ src/pages/blog/[...id].astro | 6 ++- 5 files changed, 86 insertions(+), 81 deletions(-) create mode 100644 public/coral-transparent.css create mode 100644 src/components/CoralComments.astro delete mode 100644 src/components/Hyvor.astro diff --git a/public/coral-transparent.css b/public/coral-transparent.css new file mode 100644 index 0000000..7bc6145 --- /dev/null +++ b/public/coral-transparent.css @@ -0,0 +1,24 @@ +#coral { + --palette-background-body: transparent; +} + +#coral, +#coral [class*="App-root"], +#coral [class*="StreamContainer-root"] { + background: transparent !important; + background-color: transparent !important; +} + +#coral nav[aria-label="Main Tablist"]:not(:has([role="tab"] ~ [role="tab"])):not(:has(button ~ button)):not(:has(a ~ a)):not(:has(li ~ li)) { + display: none !important; +} + +#coral:has(nav[aria-label="Main Tablist"]:not(:has([role="tab"] ~ [role="tab"])):not(:has(button ~ button)):not(:has(a ~ a)):not(:has(li ~ li))) [class*="App-tabContent"] { + padding-top: 0 !important; +} + +#coral [class*="FloatingNotificationButton-root"], +#coral [class*="MobileNotificationButton-"], +#coral [class*="TabBar-notificationsTab"] { + display: none !important; +} diff --git a/src/components/CoralComments.astro b/src/components/CoralComments.astro new file mode 100644 index 0000000..c513639 --- /dev/null +++ b/src/components/CoralComments.astro @@ -0,0 +1,58 @@ +--- +interface Props { + storyID: string; + storyURL: string; +} + +const { storyID, storyURL } = Astro.props; +const coralRoot = "https://coral.neeldhara.cloud"; +--- + +
+
+
+ + + + diff --git a/src/components/Head.astro b/src/components/Head.astro index edb96ef..0a9af01 100644 --- a/src/components/Head.astro +++ b/src/components/Head.astro @@ -84,7 +84,6 @@ const { title, description, image = "/astro-micro.jpg" } = Astro.props; animate(); updateThemeButtons(); addCopyCodeButtons(); - setHyvorTheme(); const backToTop = document.getElementById("back-to-top"); backToTop?.addEventListener("click", (event) => scrollToTop(event)); @@ -206,7 +205,6 @@ const { title, description, image = "/astro-micro.jpg" } = Astro.props; window.getComputedStyle(css).opacity; document.head.removeChild(css); - setHyvorTheme(); } function preloadTheme() { @@ -256,13 +254,6 @@ const { title, description, image = "/astro-micro.jpg" } = Astro.props; } } - const setHyvorTheme = () => { - const isDark = document.documentElement.classList.contains("dark"); - if (window.hyvorTalk) { - window.hyvorTalk.changeTheme(isDark ? "dark" : "light"); - } - }; - document.addEventListener("DOMContentLoaded", () => init()); document.addEventListener("astro:after-swap", () => init()); preloadTheme(); diff --git a/src/components/Hyvor.astro b/src/components/Hyvor.astro deleted file mode 100644 index bcbe95a..0000000 --- a/src/components/Hyvor.astro +++ /dev/null @@ -1,70 +0,0 @@ ---- -// Hyvor Talk comments component -interface Props { - pageId?: string; -} - -const { pageId } = Astro.props; -const computedPageId = pageId ?? Astro.url.pathname; ---- - -
- - -
- - - - diff --git a/src/pages/blog/[...id].astro b/src/pages/blog/[...id].astro index 1296f27..70687df 100644 --- a/src/pages/blog/[...id].astro +++ b/src/pages/blog/[...id].astro @@ -7,7 +7,7 @@ import { readingTime } from "@lib/utils"; import BackToPrevious from "@components/BackToPrevious.astro"; import PostNavigation from "@components/PostNavigation.astro"; import TableOfContents from "@components/TableOfContents.astro"; -import Hyvor from "@components/Hyvor.astro"; +import CoralComments from "@components/CoralComments.astro"; export async function getStaticPaths() { const posts = (await getCollection("blog")) @@ -49,6 +49,8 @@ const prevPost = getPrevPost(); const post = Astro.props; const { Content, headings } = await render(post); +const coralStoryID = `micro:${post.id}`; +const coralStoryURL = new URL(`/${post.id}/`, Astro.site).toString(); --- @@ -93,7 +95,7 @@ const { Content, headings } = await render(post);
- +