diff --git a/src/components/Remark42Embed.astro b/src/components/Remark42Embed.astro index 81c6cab..437b024 100644 --- a/src/components/Remark42Embed.astro +++ b/src/components/Remark42Embed.astro @@ -1,11 +1,16 @@ --- +import Remark42Status from "./Remark42Status.astro"; + const { slug } = Astro.props; const pagePath = `/posts/${slug}/`; const host = import.meta.env.PUBLIC_REMARK42_HOST; const siteId = import.meta.env.PUBLIC_REMARK42_SITE_ID; --- -
+
+ +
+
+ + diff --git a/src/components/Remark42Status.astro b/src/components/Remark42Status.astro new file mode 100644 index 0000000..6878b31 --- /dev/null +++ b/src/components/Remark42Status.astro @@ -0,0 +1,75 @@ +--- +import { getLangFromUrl } from "@/i18n"; + +const lang = getLangFromUrl(Astro.url); +const loadingText = lang === "zh" ? "评论区加载中……" : "Loading comments…"; +const failedText = lang === "zh" ? "评论区加载失败" : "Failed to load comments"; +--- + +
+

+ + {loadingText} +

+ +
+ + diff --git a/src/i18n/en.ts b/src/i18n/en.ts index 56b64bd..fb5854b 100644 --- a/src/i18n/en.ts +++ b/src/i18n/en.ts @@ -17,7 +17,7 @@ export default { publishedOn: "Published on", commentsDesc: [ "Feel free to leave your thoughts here. 💭💡", - "After signing in, you can click the “Subscribe by Email” button at the bottom right of the text box to receive notifications of new interactions via email." + "After signing in, you can click “Subscribe by Email” at the bottom right of the text box to receive notifications via E-mail." ] }, theme: { diff --git a/src/layouts/MarkdownPostLayout.astro b/src/layouts/MarkdownPostLayout.astro index bd3dffa..7d5bb9b 100644 --- a/src/layouts/MarkdownPostLayout.astro +++ b/src/layouts/MarkdownPostLayout.astro @@ -103,7 +103,9 @@ const publishedDate = new Intl.DateTimeFormat( aria-labelledby="comments-heading" >

{comments}

- {t.post.commentsDesc.map((line: string) =>

)} + {t.post.commentsDesc.map((line: string) => ( +

+ ))} @@ -653,6 +655,16 @@ const publishedDate = new Intl.DateTimeFormat( scroll-margin-top: 5rem; } + .comments-description { + color: #6b7680; + font-size: 0.85rem; + line-height: 1.6; + } + + :global(html.dark) .comments-description { + color: #aab7c4; + } + :global(html.dark) .post-content { --article-muted: #aab7c4; --article-rule: rgba(170, 183, 196, 0.28);