{"id":10005982,"date":"2022-07-22T11:57:31","date_gmt":"2022-07-22T03:57:31","guid":{"rendered":"https:\/\/ityet.com\/?p=10005982"},"modified":"2022-07-22T11:57:31","modified_gmt":"2022-07-22T03:57:31","slug":"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8-github-%e8%ae%a8%e8%ae%ba%e4%bd%9c%e4%b8%ba%e6%82%a8%e5%8d%9a%e5%ae%a2%e7%9a%84%e8%81%8a%e5%a4%a9%e7%b3%bb%e7%bb%9f","status":"publish","type":"post","link":"https:\/\/itmax.cn\/?p=10005982","title":{"rendered":"\u5982\u4f55\u4f7f\u7528 GitHub \u8ba8\u8bba\u4f5c\u4e3a\u60a8\u535a\u5ba2\u7684\u804a\u5929\u7cfb\u7edf"},"content":{"rendered":"<blockquote><p>\u5982\u679c\u60a8\u6709\u4e2a\u4eba\u535a\u5ba2\uff0c\u60a8\u53ef\u80fd\u4f1a\u4f7f\u7528\u8bc4\u8bba\u7cfb\u7edf\u6765\u7ba1\u7406\u535a\u5ba2\u7684\u8ba8\u8bba\u548c\u8bc4\u8bba\u3002\u5982\u679c\u662f\u8fd9\u6837\uff0c\u662f\u65f6\u5019\u8003\u8651\u66f4\u65b0\u60a8\u7684\u8bc4\u8bba\u7cfb\u7edf\u4e86\u3002<\/p><\/blockquote>\n<p>\u5728GitHub Discussions(\u8ba8\u8bba\u533a)\u7684\u5e2e\u52a9\u4e0b\uff0c\u4f60\u53ef\u4ee5\u628a\u4f60\u7684\u535a\u5ba2\u7684\u8bc4\u8bba\u63d0\u5347\u5230\u4e00\u4e2a\u65b0\u7684\u6c34\u5e73\u3002\u5728\u8fd9\u7bc7\u6587\u7ae0\u4e2d\uff0c\u6211\u5c06\u89e3\u91ca\u5982\u4f55\u5c06GitHub\u8ba8\u8bba\u6574\u5408\u5230\u4f60\u7684\u535a\u5ba2\u4e2d\u5e76\u5145\u5206\u5229\u7528\u5b83\u3002<\/p>\n<h2>\u4ec0\u4e48\u662f\u201cGitHub \u8ba8\u8bba\u201d\uff1f<\/h2>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc0h77\" alt=\"\" title=\"\" loading=\"lazy\" ><\/p>\n<p>GitHub \u8ba8\u8bba\u662f\u4e00\u4e2a\u53ef\u4ee5\u5728\u6bcf\u4e2a GitHub \u4ed3\u5e93\u4e0a\u542f\u7528\u7684\u8bba\u575b\u3002\u5b83\u4f7f\u5f00\u53d1\u8005\u80fd\u591f\u8f7b\u677e\u5730\u8ba8\u8bba\u65b0\u529f\u80fd\uff0c\u4ece\u793e\u533a\u83b7\u5f97\u53cd\u9988\uff0c\u521b\u5efa\u6295\u7968\uff0c\u53d1\u5e03\u516c\u544a\u7b49\u3002<\/p>\n<p>GitHub\u8ba8\u8bba\u533a\u662f\u5f00\u53d1\u8005\u548c\u793e\u533a\u6210\u5458\u7684\u4e00\u7ad9\u5f0f\u5408\u4f5c\u573a\u6240\u3002<\/p>\n<h2>\u5982\u4f55\u4f7f\u7528 GitHub \u8ba8\u8bba\u4f5c\u4e3a\u804a\u5929\u7cfb\u7edf<\/h2>\n<p>\u4e3a\u4e86\u5c06GitHub\u8ba8\u8bba\u6574\u5408\u5230\u4f60\u7684\u535a\u5ba2\uff0c\u6211\u4eec\u5c06\u4f7f\u7528 <a href=\"https:\/\/link.segmentfault.com\/?enc=mtahmNrX4e89d8ysXGDedQ%3D%3D.UZjWezWHiIcn4zWpS4eJHQMjxXwICRrsL1MvHHC2oAA%3D\" rel=\"nofollow\"><strong>giscus<\/strong><\/a>\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc0h78\" alt=\"\" title=\"\" loading=\"lazy\" ><\/p>\n<p>giscus\u662f\u4e00\u4e2a\u7531GitHub\u8ba8\u8bba\u652f\u6301\u7684\u8bc4\u8bba\u7cfb\u7edf\u3002\u5b83\u53ef\u4ee5\u8ba9\u4f60\u628a\u4ed3\u5e93\u4e2d\u7684\u8ba8\u8bba\u6574\u5408\u5230\u4f60\u7684\u535a\u5ba2\u4e2d\u3002<\/p>\n<p>\u4f60\u7684\u8bfb\u8005\u53ef\u4ee5\u5728\u4f60\u7684\u535a\u5ba2\u4e0a\u7559\u4e0b\u8bc4\u8bba\uff0c\u8fd9\u4e9b\u8bc4\u8bba\u4f1a\u540c\u65f6\u51fa\u73b0\u5728\u4f60\u7684\u535a\u5ba2\u548c\u4f60\u7684\u4ee3\u7801\u5e93\u7684\u8ba8\u8bba\u9875\u9762\u4e0a\u3002<\/p>\n<p><strong>\u4f7f\u7528\u8ba8\u8bba\u533a\u4f5c\u4e3a\u4f60\u7684\u535a\u5ba2\u804a\u5929\u7cfb\u7edf\u7684\u4f18\u52bf<\/strong><\/p>\n<ul>\n<li>\u5b83\u662f\u5b8c\u5168\u514d\u8d39\u7684<\/li>\n<li>\u6ca1\u6709\u5e7f\u544a\u6216\u8ddf\u8e2a<\/li>\n<li>\u5b83\u8d85\u7ea7\u5f3a\u5927<\/li>\n<li>\u4f60\u5bf9\u8bc4\u8bba\u6709\u5b8c\u5168\u7684\u63a7\u5236\u6743\u548c\u5b8c\u5168\u7684\u4fee\u6539\u6743\u3002<\/li>\n<li>\u6709\u5f88\u591a\u4e3b\u9898<\/li>\n<li>\u5b83\u662f\u76f8\u5f53\u53ef\u81ea\u5b9a\u4e49\u7684<\/li>\n<li>\u4f60\u53ef\u4ee5\u5728\u4f60\u81ea\u5df1\u7684\u670d\u52a1\u5668\u4e0a\u81ea\u884c\u6258\u7ba1<\/li>\n<\/ul>\n<p>\u8bf7\u8bb0\u4f4f\uff0c\u6b64\u5de5\u5177\u4e3b\u8981\u9002\u7528\u4e8e\u5f00\u53d1\u8005\u535a\u5ba2\uff0c\u56e0\u4e3a\u5927\u591a\u6570\u5f00\u53d1\u4eba\u5458\u4f7f\u7528 GitHub\u3002<\/p>\n<h2>\u5982\u4f55\u5728\u4f60\u7684\u535a\u5ba2\u4e2d\u6574\u5408giscus<\/h2>\n<p><strong>\u5148\u51b3\u6761\u4ef6<\/strong><\/p>\n<ul>\n<li>\u4e00\u4e2a\u535a\u5ba2\uff08\u4f60\u5fc5\u987b\u80fd\u591f\u83b7\u5f97\u6e90\u4ee3\u7801\uff09<\/li>\n<li>\u4e00\u4e2a GitHub \u5e10\u6237<\/li>\n<li>\u4f60\u9009\u62e9\u7684\u4ee3\u7801\u5e93\u5fc5\u987b\u662f\u516c\u5f00\u7684<\/li>\n<\/ul>\n<p>\u9996\u5148\uff0c\u4f60\u9700\u8981\u4e3a\u4f60\u7684\u4ee3\u7801\u5e93\u542f\u7528\u8ba8\u8bba\u529f\u80fd\u3002<\/p>\n<p>\u8f6c\u5230\u4ee3\u7801\u5e93<strong>Settings<\/strong> -&gt; \u5728<strong>Features<\/strong>\u90e8\u5206\u4e0b -&gt; \u52fe\u9009<strong>Discussions<\/strong>\u6846\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc0h8g\" alt=\"\" title=\"\" loading=\"lazy\" ><\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u5728\u4f60\u7684\u4ee3\u7801\u5e93\u4e2d\u5b89\u88c5giscus\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<p>\u8f6c\u5230 <a href=\"https:\/\/link.segmentfault.com\/?enc=XTfdXh48LWRsnAOTo2%2BvcA%3D%3D.CIMFk%2BEBLqmlvhJJeNhUaT1IRiwIZshshUrZz86rRGc%3D\" rel=\"nofollow\">https:\/\/github.com\/apps\/giscus<\/a>\uff0c\u6309\u7167\u63d0\u793a\u64cd\u4f5c\uff0c\u5e76\u4ec5\u6388\u4e88\u5bf9\u9009\u5b9a\u4ee3\u7801\u5e93\u7684\u8bbf\u95ee\u6743\u9650\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc0h8h\" alt=\"\" title=\"\" loading=\"lazy\" ><\/p>\n<p>\u73b0\u5728\u662f\u91cd\u8981\u7684\u90e8\u5206\uff1a\u6211\u4eec\u9700\u8981\u914d\u7f6egiscus\u5c0f\u90e8\u4ef6\u3002<\/p>\n<p>\u9996\u5148\uff0c\u8fdb\u5165giscus\u4e3b\u9875\uff0c\u6eda\u52a8\u5230<strong>Configuration<\/strong>\u90e8\u5206\u3002<\/p>\n<p>\u9009\u62e9\u60a8\u7684\u5c0f\u90e8\u4ef6\u8bed\u8a00\uff0c\u8fd9\u662f\u60a8\u60f3\u8981\u663e\u793a\u5c0f\u90e8\u4ef6\u7684\u8bed\u8a00\u3002<\/p>\n<p>=<img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc0h8j\" alt=\"\" title=\"\" loading=\"lazy\" ><\/p>\n<p>\u7136\u540e\u8f93\u5165\u4f60\u7684<strong>\u4ee3\u7801\u5e93\u540d\u79f0<\/strong>\u548c\u4f60\u7684<strong>\u7528\u6237\u540d<\/strong>\uff0c\u5982\u7528<code>username\/reponame<\/code>\u3002<\/p>\n<p>=<img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc0h8l\" alt=\"\" title=\"\" loading=\"lazy\" ><\/p>\n<p>\u5bf9\u4e8e<strong>\u9875\u9762\u2194\ufe0f\u8ba8\u8bba\u6620\u5c04<\/strong>\uff0c\u6211\u5efa\u8bae\u9009\u62e9 &#8220;\u8ba8\u8bba\u6807\u9898\u5305\u542b\u9875\u9762<code>URL<\/code>&#8220;\u3002\u4f46\u6839\u636e\u4f60\u7684\u9700\u8981\uff0c\u9009\u62e9\u6700\u9002\u5408\u4f60\u7684\u90a3\u4e00\u4e2a\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc0h8n\" alt=\"\" title=\"\" loading=\"lazy\" ><\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u5728\u4f60\u7684GitHub \u4ee3\u7801\u5e93\u4e0a\u7684\u8ba8\u8bba\u9875\u9762\u521b\u5efa\u4e00\u4e2a\u7c7b\u522b\u2014\u2014\u6bd4\u5982 &#8220;Comments\uff08\u8bc4\u8bba\uff09&#8221;\u2014\u2014\u6216\u8005\u9009\u62e9\u73b0\u6709\u7684\u7c7b\u522b\u3002<\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc0h8o\" alt=\"\" title=\"\" loading=\"lazy\" ><\/p>\n<p><img decoding=\"async\" referrerpolicy=\"no-referrer\" src=\"https:\/\/segmentfault.com\/img\/bVc0h8p\" alt=\"\" title=\"\" loading=\"lazy\" ><\/p>\n<p>\u7136\u540e\u6839\u636e\u9700\u8981\u542f\u7528\u53ef\u9009\u529f\u80fd\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u9009\u62e9\u4e3b\u9898\u3002\u4e0d\u8981\u62c5\u5fc3\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u7f16\u7a0b\u6765\u5207\u6362\u4e0d\u540c\u7684\u4e3b\u9898\u3002<\/p>\n<p>\u6700\u540e\uff0c\u590d\u5236\u5e76\u7c98\u8d34\u751f\u6210\u7684\u4ee3\u7801\u3002<\/p>\n<p>Giscus\u5c06\u6839\u636e\u4f60\u7684\u8bbe\u7f6e\u751f\u6210\u4e00\u4e2a\u811a\u672c\u6807\u7b7e\uff0c\u4f60\u53ef\u4ee5\u5c06\u5176\u7c98\u8d34\u5230\u4f60\u7684\u4ee3\u7801\u4e2d\u3002\u4f46\u6211\u4eec\u5c06\u770b\u5230\u5982\u4f55\u4f7f\u7528giscus\u7ec4\u4ef6\u3002<\/p>\n<h2>\u5982\u4f55\u4f7f\u7528 giscus \u7ec4\u4ef6<\/h2>\n<p>\u5982\u679c\u4f60\u7684\u535a\u5ba2\u662f\u7528React\/Vue\/Svelte\u6216Web\u7ec4\u4ef6\u6784\u5efa\u7684\uff0c\u90a3\u4e48\u4f60\u53ef\u4ee5\u5b89\u88c5giscus\u7ec4\u4ef6\u3002<\/p>\n<p>\u4f8b\u5982\uff0c\u8981\u5728React\u4e2d\u96c6\u6210giscus\uff0c\u8bf7\u505a\u4ee5\u4e0b\u5de5\u4f5c\uff1a<\/p>\n<ul>\n<li>\n<p>\u5b89\u88c5 giscus \u5305\u3002<\/p>\n<pre><code class=\"shell\">npm i @giscus\/react\nor\nyarn add $giscus\/react<\/code><\/pre>\n<\/li>\n<li>\n<p>\u7136\u540e\u5728\u4f60\u7684\u7ec4\u4ef6\u4e2d\u5bfc\u5165 <code>giscus<\/code> \u5e76\u4f7f\u7528\u5b83\u3002\u590d\u5236\u6211\u4eec\u5728\u4e0a\u4e00\u6b65\u5f97\u5230\u7684\u5c5e\u6027\uff0c\u4ece\u6240\u6709\u7684\u5c5e\u6027\u4e2d\u5220\u9664 <code>data-<\/code>\uff0c\u5e76\u5c06\u5c5e\u6027\u8f6c\u5316\u4e3a\u6709\u6548\u7684 <code>jsx<\/code> \u5c5e\u6027\u3002<\/p>\n<pre><code class=\"javascript\">import Giscus from '@giscus\/react';\n\nexport default function MyApp() {\n  return (\n    &lt;Giscus\n      id=&quot;comments&quot;\n      repo=&quot;giscus\/giscus-component&quot;\n      repoId=&quot;MDEwOlJlcG9zaXRvcnkzOTEzMTMwMjA=&quot;\n      category=&quot;Announcements&quot;\n      categoryId=&quot;DIC_kwDOF1L2fM4B-hVS&quot;\n      mapping=&quot;specific&quot;\n      term=&quot;Welcome to @giscus\/react component!&quot;\n      reactionsEnabled=&quot;1&quot;\n      emitMetadata=&quot;0&quot;\n      inputPosition=&quot;top&quot;\n      theme=&quot;light&quot;\n      lang=&quot;en&quot;\n      loading=&quot;lazy&quot;\n    \/&gt;\n  );\n}<\/code><\/pre>\n<\/li>\n<\/ul>\n<p>\u5bf9\u5176\u4ed6\u6846\u67b6\u6765\u8bf4\uff0c\u8fd9\u57fa\u672c\u4e0a\u662f\u540c\u6837\u7684\u7a0b\u5e8f\u3002<\/p>\n<h2>\u603b\u7ed3<\/h2>\n<p>\u5728\u672c\u6587\u4e2d\uff0c\u6211\u4eec\u4e86\u89e3\u4e86\u5c06 GitHub \u8ba8\u8bba\u7528\u4f5c\u804a\u5929\u7cfb\u7edf\u7684\u597d\u5904\u3002\u6211\u4eec\u8fd8\u5b66\u4e60\u4e86\u5982\u4f55\u5728\u6211\u4eec\u7684\u7f51\u7ad9\u4e2d\u521b\u5efa\u548c\u96c6\u6210 giscus \u5c0f\u90e8\u4ef6\u3002<\/p>\n<p>\u6211\u5e0c\u671b\u4f60\u89c9\u5f97\u8fd9\u5f88\u6709\u5e2e\u52a9\uff0c\u786e\u4fddstar\u4e86giscus GitHub\u4ee3\u7801\u5e93\u6765\u652f\u6301\u5b83\u4eec\u3002<\/p>\n<p><a href=\"https:\/\/segmentfault.com\/a\/1190000041976390\">https:\/\/segmentfault.com\/a\/1190000041976390<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u679c\u60a8\u6709\u4e2a\u4eba\u535a\u5ba2\uff0c\u60a8\u53ef\u80fd\u4f1a\u4f7f\u7528\u8bc4\u8bba\u7cfb\u7edf\u6765\u7ba1\u7406\u535a\u5ba2\u7684\u8ba8\u8bba\u548c\u8bc4\u8bba\u3002\u5982\u679c\u662f\u8fd9\u6837\uff0c\u662f\u65f6\u5019\u8003\u8651\u66f4\u65b0\u60a8\u7684\u8bc4\u8bba\u7cfb\u7edf\u4e86\u3002 \u5728G [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-10005982","post","type-post","status-publish","format-standard","hentry"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10005982","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10005982"}],"version-history":[{"count":0,"href":"https:\/\/itmax.cn\/index.php?rest_route=\/wp\/v2\/posts\/10005982\/revisions"}],"wp:attachment":[{"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10005982"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10005982"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itmax.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10005982"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}