{"id":13449482,"url":"https://github.com/T-miracle/vitepress-plugin-comment-with-giscus","last_synced_at":"2025-03-22T22:33:01.845Z","repository":{"id":147781578,"uuid":"619080642","full_name":"T-miracle/vitepress-plugin-comment-with-giscus","owner":"T-miracle","description":"vitepress comment plugin based on giscus。    基于giscus的vitepress评论插件。","archived":false,"fork":false,"pushed_at":"2024-04-29T14:46:22.000Z","size":663,"stargazers_count":43,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T04:51:11.271Z","etag":null,"topics":["giscus","vitepress","vitepress-plugin"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/vitepress-plugin-comment-with-giscus","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/T-miracle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-26T07:52:10.000Z","updated_at":"2025-03-15T05:34:07.000Z","dependencies_parsed_at":"2024-10-28T15:37:10.382Z","dependency_job_id":null,"html_url":"https://github.com/T-miracle/vitepress-plugin-comment-with-giscus","commit_stats":{"total_commits":67,"total_committers":6,"mean_commits":"11.166666666666666","dds":"0.19402985074626866","last_synced_commit":"09f993a2ee82671bb20c58f2d7513f50c82936be"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/T-miracle%2Fvitepress-plugin-comment-with-giscus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/T-miracle%2Fvitepress-plugin-comment-with-giscus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/T-miracle%2Fvitepress-plugin-comment-with-giscus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/T-miracle%2Fvitepress-plugin-comment-with-giscus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/T-miracle","download_url":"https://codeload.github.com/T-miracle/vitepress-plugin-comment-with-giscus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245029183,"owners_count":20549661,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["giscus","vitepress","vitepress-plugin"],"created_at":"2024-07-31T06:00:39.989Z","updated_at":"2025-03-22T22:33:01.522Z","avatar_url":"https://github.com/T-miracle.png","language":"TypeScript","funding_links":[],"categories":[":electric_plug: Plugins"],"sub_categories":["Community Plugins"],"readme":"# vitepress-plugin-comment-with-giscus\n\n[![npm](https://img.shields.io/npm/v/vitepress-plugin-comment-with-giscus?color=green\u0026style=flat)](https://www.npmjs.com/package/vitepress-plugin-comment-with-giscus)\n\nEN | [中文文档](README_zh.md)\n\n![](demo.png)\n\n\u003e `vitepress` comment section plugin based on `giscus`\n\n## Install\n\n```shell\n// npm\nnpm i vitepress-plugin-comment-with-giscus\n// yarn\nyarn add vitepress-plugin-comment-with-giscus\n```\n\n## Usage\n\nIn the `index` file under the `.vitepress/theme` path\n\n```ts\nimport DefaultTheme from 'vitepress/theme';\nimport giscusTalk from 'vitepress-plugin-comment-with-giscus';\nimport { useData, useRoute } from 'vitepress';\nimport { toRefs } from \"vue\";\n\nexport default {\n    ...DefaultTheme,\n    enhanceApp(ctx) {\n        DefaultTheme.enhanceApp(ctx);\n        // ...\n    },\n    setup() {\n        // Get frontmatter and route\n        const { frontmatter } = toRefs(useData());\n        const route = useRoute();\n        \n        // Obtain configuration from: https://giscus.app/\n        giscusTalk({\n            repo: 'your github repository',\n            repoId: 'your repository id',\n            category: 'your category', // default: `General`\n            categoryId: 'your category id',\n            mapping: 'pathname', // default: `pathname`\n            inputPosition: 'top', // default: `top`\n            lang: 'en', // default: `zh-CN`\n            // i18n setting (Note: This configuration will override the default language set by lang)\n            // Configured as an object with key-value pairs inside:\n            // [your i18n configuration name]: [corresponds to the language pack name in Giscus]\n            locales: {\n                'zh-Hans': 'zh-CN',\n                'en-US': 'en'\n            },\n            homePageShowComment: false, // Whether to display the comment area on the homepage, the default is false\n            lightTheme: 'light', // default: `light`\n            darkTheme: 'transparent_dark', // default: `transparent_dark`\n            // ...\n        }, {\n            frontmatter, route\n        },\n            // Whether to activate the comment area on all pages.\n            // The default is true, which means enabled, this parameter can be ignored;\n            // If it is false, it means it is not enabled.\n            // You can use `comment: true` preface to enable it separately on the page.\n            true\n        );\n    }\n};\n```\n\nFor the parameter acquisition method of `giscus`, please refer to：[giscus configuration](https://giscus.app/)\n\n[Click to see the list of currently supported languages](https://github.com/giscus/giscus/blob/main/lib/i18n.tsx#L45)\n\n## Extended\n\nWhen the configuration option enables the comment area by default, add the following code, the comment area will not be generated\n\n```md\n---\ncomment: false\n---\n```\n\nWhen the configuration options do not enable the comment area by default, you can still enable the comment area on the current page through the following code\n\n```md\n---\ncomment: true\n---\n```\n\n## change log\n\n\u003cdetails open\u003e\n  \u003csummary\u003echange log\u003c/summary\u003e\n  \u003cul\u003e\n    \u003cli\u003e\n      \u003cp\u003ev1.1.15\u003c/p\u003e\n      \u003cp\u003enew i18n setting\u003c/p\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003cp\u003ev1.1.10\u003c/p\u003e\n      \u003cp\u003eNow customizable day/night themes\u003c/p\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003cp\u003ev1.1.9\u003c/p\u003e\n      \u003cp\u003eYou can now set whether to enable configuration globally by default\u003c/p\u003e\n    \u003c/li\u003e\n  \u003c/ul\u003e\n\u003c/details\u003e\n\n## more vitepress plugins\n\nYou may be interested in these plugins：\n[Click me to view more vitepress plugins](https://github.com/T-miracle/vitepress-plugins)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FT-miracle%2Fvitepress-plugin-comment-with-giscus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FT-miracle%2Fvitepress-plugin-comment-with-giscus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FT-miracle%2Fvitepress-plugin-comment-with-giscus/lists"}