mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 07:33:07 +08:00
Update PostLayout.astro
This commit is contained in:
@@ -17,7 +17,7 @@ const { title, description, ogImage, canonicalURL, pubDatetime, modDatetime } =
|
|||||||
|
|
||||||
const commentPath = Astro.url.pathname;
|
const commentPath = Astro.url.pathname;
|
||||||
|
|
||||||
const structuredData = { /* 保持不变 */ };
|
const structuredData = { /* ...保持不变... */ };
|
||||||
---
|
---
|
||||||
|
|
||||||
<Layout {title} {description} {ogImage} {canonicalURL}>
|
<Layout {title} {description} {ogImage} {canonicalURL}>
|
||||||
@@ -29,11 +29,11 @@ const structuredData = { /* 保持不变 */ };
|
|||||||
</Fragment>
|
</Fragment>
|
||||||
|
|
||||||
<slot />
|
<slot />
|
||||||
|
</Layout>
|
||||||
|
|
||||||
<!-- 评论区:限制宽度,并只对文章页显示 -->
|
<!-- 评论区放在 Layout 外面,自然位于 Footer 之上(只要 Layout 外没有固定定位) -->
|
||||||
{commentPath.startsWith("/posts/") && (
|
{commentPath.startsWith("/posts/") && (
|
||||||
<div class="mx-auto max-w-2xl">
|
<div class="mx-auto max-w-2xl px-4 sm:px-6">
|
||||||
<TwikooComments envId="http://47.108.235.131:40063/" path={commentPath} />
|
<TwikooComments envId="http://47.108.235.131:40063/" path={commentPath} />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</Layout>
|
|
||||||
|
|||||||
Reference in New Issue
Block a user