From 04dd839cce64c1202571262cdb67fcd7507f0c7d Mon Sep 17 00:00:00 2001 From: wangzipai <38389763+wangzipai@users.noreply.github.com> Date: Wed, 30 Oct 2024 10:22:06 +0800 Subject: [PATCH] Update quartz.layout.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 启用Giscus评论系统 --- quartz.layout.ts | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/quartz.layout.ts b/quartz.layout.ts index 501b666b0..7774c2d1b 100644 --- a/quartz.layout.ts +++ b/quartz.layout.ts @@ -5,7 +5,33 @@ import * as Component from "./quartz/components" export const sharedPageComponents: SharedLayout = { head: Component.Head(), header: [], - afterBody: [], + afterBody: [ + Component.Comments({ + provider: 'giscus', + options: { + // from data-repo + repo: 'xxx', + // from data-repo-id + repoId: 'xxx', + // from data-category + category: 'Announcements', + // from data-category-id + categoryId: 'xxx', + // how to map pages -> discussions + // defaults to 'url' + mapping: "pathname", + // use strict title matching + // defaults to true + strict: false, + // whether to enable reactions for the main post + // defaults to true + reactionsEnabled: true, + // where to put the comment input box relative to the comments + // defaults to 'bottom' + inputPosition: "top", + } + }), + ], footer: Component.Footer({ links: { GitHub: "https://github.com/jackyzha0/quartz",