{"id":556731,"date":"2022-03-08T10:30:39","date_gmt":"2022-03-08T02:30:39","guid":{"rendered":"http:\/\/4563.org\/?p=556731"},"modified":"2022-03-08T10:30:39","modified_gmt":"2022-03-08T02:30:39","slug":"%e4%b8%80%e4%b8%aa%e5%9f%ba%e4%ba%8e-github-issue-%e7%9a%84%e5%8d%9a%e5%ae%a2%e7%b3%bb%e7%bb%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=556731","title":{"rendered":"\u4e00\u4e2a\u57fa\u4e8e GitHub Issue \u7684\u535a\u5ba2\u7cfb\u7edf"},"content":{"rendered":"<div>\n<div><a href=\"http:\/\/machbbs.com\/user-2.htm\" tabindex=\"-1\"><\/a><\/p>\n<div>\n<h1>\u4e00\u4e2a\u57fa\u4e8e GitHub Issue \u7684\u535a\u5ba2\u7cfb\u7edf<\/h1>\n<p><\/p>\n<div>\n<div><span>\u8cc7\u6df1\u5927\u4f6c :djyde<\/span><span><i><\/i>0<\/span><\/div>\n<div><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div isfirst=\"1\"><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2022\/03\/20220331_624566b69071d.png\" alt=\"\u4e00\u4e2a\u57fa\u4e8e GitHub Issue \u7684\u535a\u5ba2\u7cfb\u7edf\" \/><\/p>\n<p>\u5f88\u591a\u4eba\u7528 GitHub issue \u5f53\u4f5c\u81ea\u5df1\u7684\u535a\u5ba2\uff0c\u4e8e\u662f\u6211\u60f3\u5230\u53ef\u4ee5\u7528 Next.js \u901a\u8fc7 GitHub API \u751f\u6210\u4e00\u4e2a\u57fa\u4e8e GitHub issue \u7684\u535a\u5ba2\u3002<\/p>\n<p>\u7136\u800c\u8fd9\u6837\u505a\u7684\u95ee\u9898\u662f GitHub API \u6709\u8bf7\u6c42 rate limit, \u901a\u8fc7 access token \u8bf7\u6c42\u7684 rate limit \u662f 5000\/\u5c0f\u65f6\uff0c\u56e0\u6b64\u5bf9\u4e8e\u535a\u5ba2\u7f51\u7ad9\u6765\u8bf4\uff0c\u5982\u679c\u6bcf\u6b21\u6709\u7528\u6237\u8bbf\u95ee\u5c31\u8bf7\u6c42\u4e00\u6b21\uff0c\u5f53\u8bbf\u95ee\u91cf\u4e0a\u6765\u540e\uff0c\u5f88\u5feb\u5c31\u4f1a\u8fbe\u5230\u8bf7\u6c42\u4e0a\u9650\u3002<\/p>\n<p>\u5982\u679c\u6362\u4e00\u79cd\u601d\u8def\uff0c\u7528 Next.js \u7684 <code>getStaticProps<\/code> \u6765\u5728 build time \u5c31\u628a\u9759\u6001\u9875\u9762\u751f\u6210\u51fa\u6765\uff0c\u5c31\u80fd\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002\u7136\u540e\u8fd9\u6837\u7684\u7ed3\u679c\u662f\u6bcf\u6b21\u4fee\u6539 issue, \u90fd\u9700\u8981\u91cd\u65b0\u6784\u5efa\u90e8\u7f72\u3002<\/p>\n<p>\u8fd8\u597d Next.js \u6709\u4e00\u4e2a\u7279\u6b8a\u7684 data fetching \u673a\u5236\u53eb ISR, \u4e5f\u5c31\u662f\u6309\u9700\u91cd\u65b0\u751f\u6210\u9759\u6001\u9875\u9762\u3002\u6bd4\u5982\uff0c\u5982\u679c\u6211\u5728\u83b7\u53d6 issue \u4fe1\u606f\u7684\u9875\u9762\u7684 <code>getStaticProps<\/code> \u4e2d\u8fd4\u56de\u4e00\u4e2a <code>revalidate<\/code>, \u5c31\u53ef\u4ee5\u8ba9\u90e8\u7f72\u5728 Vercel \u4e0a\u7684 Next.js \u9875\u9762\u6309\u7167\u4e00\u4e2a\u9891\u7387\u81ea\u52a8\u66f4\u65b0\u8fd9\u4e2a\u9759\u6001\u9875\u9762\uff1a<\/p>\n<pre><code>export async function getStaticProps() {  const res = await fetch('https:\/\/api.github.com\/xxx')  const posts = await res.json()  return {    props: {      posts,    },    \/\/ Next.js will attempt to re-generate the page:    \/\/ - When a request comes in    \/\/ - At most once every 1 minutes    revalidate: 60, \/\/ In seconds  }}<\/code><\/pre>\n<p>\u4e8e\u662f\uff0c\u57fa\u4e8e\u8fd9\u4e2a\u673a\u5236\uff0c\u6211\u5199\u4e86 Sairin, \u4f60\u53ef\u4ee5\u901a\u8fc7\u4e00\u4e2a\u6309\u94ae\u76f4\u63a5\u521b\u5efa\u4e00\u4e2a\u57fa\u4e8e GitHub issue \u7684\u535a\u5ba2\uff0c\u5e76\u90e8\u7f72\u5230 Vercel:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2022\/03\/20220331_624566b700a55.svg\" alt=\"\u4e00\u4e2a\u57fa\u4e8e GitHub Issue \u7684\u535a\u5ba2\u7cfb\u7edf\" \/><\/p>\n<blockquote>\n<p>\u5728\u90e8\u7f72\u524d\u4f60\u9700\u8981\u7533\u8bf7\u4e00\u4e2a GitHub personal access token \u5728\u521b\u5efa\u9879\u76ee\u65f6\u586b\u5165<\/p>\n<\/blockquote>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2022\/03\/20220331_624566ba6c9c4.png\" alt=\"\u4e00\u4e2a\u57fa\u4e8e GitHub Issue \u7684\u535a\u5ba2\u7cfb\u7edf\" \/><\/p>\n<p>\u8f93\u5165\u4e00\u4e2a\u9879\u76ee\u540d\uff0c\u548c\u4f60\u7533\u8bf7\u7684 GitHub access token, \u70b9\u51fb deploy, Vercel \u4f1a\u5e2e\u4f60\u521b\u5efa\u4e00\u4e2a repo, \u5e76\u90e8\u7f72 Sairin. <\/p>\n<p>\u90e8\u7f72\u5b8c\u6210\u540e\uff0c\u5c31\u53ef\u4ee5\u8fdb\u5165 Vercel \u5e2e\u4f60\u521b\u5efa\u7684 repo, \u5728 issue \u91cc\u5199\u4e0b\u4f60\u7684\u7b2c\u4e00\u7bc7\u535a\u5ba2\u6587\u7ae0\uff1a<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2022\/03\/20220331_624566bf883b3.png\" alt=\"\u4e00\u4e2a\u57fa\u4e8e GitHub Issue \u7684\u535a\u5ba2\u7cfb\u7edf\" \/><\/p>\n<p>\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5728\u6587\u7ae0\u7684\u5f00\u5934\uff0c\u4f60\u9700\u8981\u5199\u5165 frontmatter, \u6765\u6307\u5b9a\u8fd9\u7bc7\u6587\u7ae0\u7684\u8def\u5f84\uff1a<\/p>\n<pre><code>---path: my-first-post---\u6b63\u6587\u5185\u5bb9<\/code><\/pre>\n<p>\u8fd9\u6837\u5c31\u4ee3\u8868\u4f60\u53ef\u4ee5\u901a\u8fc7 https:\/\/your-domain.com\/my-first-post \u8bbf\u95ee\u4f60\u7684\u8fd9\u7bc7\u6587\u7ae0\u3002<\/p>\n<p>\u5b8c\u6210\u6587\u7ae0\u540e\uff0c\u5c31\u53ef\u4ee5\u53d1\u8868\u3002\u53d1\u8868\u7684\u65b9\u5f0f\u662f\u5728\u8fd9\u7bc7 issue \u52a0\u5165\u4e00\u4e2a <code>published<\/code> \u7684 label:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2022\/03\/20220331_624566c353c9d.png\" alt=\"\u4e00\u4e2a\u57fa\u4e8e GitHub Issue \u7684\u535a\u5ba2\u7cfb\u7edf\" \/><\/p>\n<p>\u7b49\u5f85\u4e00\u5206\u949f\uff0c\u518d\u6b21\u8bbf\u95ee\u4f60\u7684\u535a\u5ba2\u5730\u5740\uff0c\u5c31\u53ef\u4ee5\u770b\u5230\u53d1\u5e03\u7684\u6587\u7ae0\u3002<\/p>\n<hr>\n<p>Sairin \u652f\u6301 RSS \u548c\u81ea\u5b9a\u4e49\u4e3b\u9898\uff0c\u8be6\u7ec6\u7684\u6587\u6863\u53ef\u4ee5\u53c2\u8003 https:\/\/github.com\/djyde\/sairin <\/p>\n<p>\u8fd9\u662f\u7528 Sairin \u751f\u6210\u7684 Sairin \u81ea\u5df1\u7684\u535a\u5ba2 http:\/\/blog.sairinjs.com\/<\/p>\n<\/div>\n<div><\/div>\n<\/div>\n<\/div>\n<div>\n<div>\n<div>\n<div>\n<div><b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>16<\/span>)        <\/div>\n<div><\/div>\n<\/div>\n<\/div>\n<ul>\n<li data-pid=\"7519380\" data-uid=\"2\"><a href=\"http:\/\/machbbs.com\/user-2.htm\" tabindex=\"-1\"><\/a>\n<div>\n<div>\n<div><span>\u8cc7\u6df1\u5927\u4f6c :xinyana<\/span><\/div>\n<div><i title=\"\u5f15\u7528\"><\/i><span><\/span><\/div>\n<\/div>\n<div>\u6709\u60f3\u6cd5\uff0c\u591f\u7b80\u6d01<\/div>\n<\/div>\n<\/li>\n<li data-pid=\"7519381\" data-uid=\"2\"><a href=\"http:\/\/machbbs.com\/user-2.htm\" tabindex=\"-1\"><\/a>\n<div>\n<div>\n<div><span>\u8cc7\u6df1\u5927\u4f6c :huruji<\/span><\/div>\n<div><i title=\"\u5f15\u7528\"><\/i><span><\/span><\/div>\n<\/div>\n<div>\u53ef\u4ee5\u652f\u6301\u73b0\u6709\u7684\u4ed3\u5e93\u5417<\/div>\n<\/div>\n<\/li>\n<li data-pid=\"7519382\" data-uid=\"2\"><a href=\"http:\/\/machbbs.com\/user-2.htm\" tabindex=\"-1\"><\/a>\n<div>\n<div>\n<div><span>\u8cc7\u6df1\u5927\u4f6c :czyt<\/span><\/div>\n<div><i title=\"\u5f15\u7528\"><\/i><span><\/span><\/div>\n<\/div>\n<div>\u53ef\u4ee5\u652f\u6301 cloudflared pages \u4e48<\/div>\n<\/div>\n<\/li>\n<li data-pid=\"7519383\" data-uid=\"2\"><a href=\"http:\/\/machbbs.com\/user-2.htm\" tabindex=\"-1\"><\/a>\n<div>\n<div>\n<div><span>\u4e3b<\/span><span>\u8cc7\u6df1\u5927\u4f6c :djyde<\/span><\/div>\n<div><i title=\"\u5f15\u7528\"><\/i><span><\/span><\/div>\n<\/div>\n<div><b>@czyt <\/b> \u53ef\u4ee5\uff0c\u5728\u73af\u5883\u53d8\u91cf\u91cc\u628a REPO \u6539\u6210\u73b0\u6709\u7684\u4ed3\u5e93\uff0c\u4f8b\u5982 `user\/repo`<\/div>\n<\/div>\n<\/li>\n<li data-pid=\"7519384\" data-uid=\"2\"><a href=\"http:\/\/machbbs.com\/user-2.htm\" tabindex=\"-1\"><\/a>\n<div>\n<div>\n<div><span>\u4e3b<\/span><span>\u8cc7\u6df1\u5927\u4f6c :djyde<\/span><\/div>\n<div><i title=\"\u5f15\u7528\"><\/i><span><\/span><\/div>\n<\/div>\n<div>&gt; \u4e0a\u4e00\u6761\u56de\u590d\u9519\u4e86\u3002<br \/><b>@huruji <\/b> #2 \u53ef\u4ee5\uff0c\u5728\u73af\u5883\u53d8\u91cf\u91cc\u628a REPO \u6539\u6210\u73b0\u6709\u7684\u4ed3\u5e93\uff0c\u4f8b\u5982 `user\/repo`<\/div>\n<\/div>\n<\/li>\n<li data-pid=\"7519385\" data-uid=\"2\"><a href=\"http:\/\/machbbs.com\/user-2.htm\" tabindex=\"-1\"><\/a>\n<div>\n<div>\n<div><span>\u8cc7\u6df1\u5927\u4f6c :cheung<\/span><\/div>\n<div><i title=\"\u5f15\u7528\"><\/i><span><\/span><\/div>\n<\/div>\n<div>\u5b66\u4e60\u5b66\u4e60\u5b66\u4e60\u5b66\u4e60<\/div>\n<\/div>\n<\/li>\n<li data-pid=\"7519386\" data-uid=\"2\"><a href=\"http:\/\/machbbs.com\/user-2.htm\" tabindex=\"-1\"><\/a>\n<div>\n<div>\n<div><span>\u8cc7\u6df1\u5927\u4f6c :seedscoder<\/span><\/div>\n<div><i title=\"\u5f15\u7528\"><\/i><span><\/span><\/div>\n<\/div>\n<div>\u4f7f\u7528 GitHub \u767b\u5f55\uff0c\u51fa\u73b0 `This user account is blocked. Contact [email&#160;protected] for more information.`<\/div>\n<\/div>\n<\/li>\n<li data-pid=\"7519387\" data-uid=\"2\"><a href=\"http:\/\/machbbs.com\/user-2.htm\" tabindex=\"-1\"><\/a>\n<div>\n<div>\n<div><span>\u8cc7\u6df1\u5927\u4f6c :czyt<\/span><\/div>\n<div><i title=\"\u5f15\u7528\"><\/i><span><\/span><\/div>\n<\/div>\n<div>\u6211\u7528 cloudflare pages \u6258\u7ba1 hugo \u7684\u4e86<\/div>\n<\/div>\n<\/li>\n<li data-pid=\"7519388\" data-uid=\"2\"><a href=\"http:\/\/machbbs.com\/user-2.htm\" tabindex=\"-1\"><\/a>\n<div>\n<div>\n<div><span>\u8cc7\u6df1\u5927\u4f6c :tsuad<\/span><\/div>\n<div><i title=\"\u5f15\u7528\"><\/i><span><\/span><\/div>\n<\/div>\n<div>\u771f\u4e0d\u9519.\u5df2 Star.<br \/>\u79c1\u6709\u4ed3\u5e93\u4e5f\u884c\u5417? \u5e0c\u671b\u52a0\u4e0a\u8bc4\u8bba.\u90a3\u5c31\u5b8c\u7f8e\u4e86<\/div>\n<\/div>\n<\/li>\n<li data-pid=\"7519389\" data-uid=\"2\"><a href=\"http:\/\/machbbs.com\/user-2.htm\" tabindex=\"-1\"><\/a>\n<div>\n<div>\n<div><span>\u4e3b<\/span><span>\u8cc7\u6df1\u5927\u4f6c :djyde<\/span><\/div>\n<div><i title=\"\u5f15\u7528\"><\/i><span><\/span><\/div>\n<\/div>\n<div><b>@tsuad <\/b> #9 \u79c1\u6709\u4ed3\u5e93\u4e5f\u6ca1\u95ee\u9898\u3002\u8bc4\u8bba\u6b63\u5728\u505a\u3002<\/div>\n<\/div>\n<\/li>\n<li data-pid=\"7519390\" data-uid=\"2\"><a href=\"http:\/\/machbbs.com\/user-2.htm\" tabindex=\"-1\"><\/a>\n<div>\n<div>\n<div><span>\u8cc7\u6df1\u5927\u4f6c :cheung<\/span><\/div>\n<div><i title=\"\u5f15\u7528\"><\/i><span><\/span><\/div>\n<\/div>\n<div>\u65e0\u9700\u90e8\u7f72\u5230 vercel \uff0c\u662f\u9700\u8981\u6ce8\u91ca\u4ec0\u4e48\u5417\uff1f<\/div>\n<\/div>\n<\/li>\n<li data-pid=\"7519391\" data-uid=\"2\"><a href=\"http:\/\/machbbs.com\/user-2.htm\" tabindex=\"-1\"><\/a>\n<div>\n<div>\n<div><span>\u8cc7\u6df1\u5927\u4f6c :mark2014<\/span><\/div>\n<div><i title=\"\u5f15\u7528\"><\/i><span><\/span><\/div>\n<\/div>\n<div>\u535a\u5ba2\u4e3b\u9898\u5f88\u68d2<\/div>\n<\/div>\n<\/li>\n<li data-pid=\"7519392\" data-uid=\"2\"><a href=\"http:\/\/machbbs.com\/user-2.htm\" tabindex=\"-1\"><\/a>\n<div>\n<div>\n<div><span>\u8cc7\u6df1\u5927\u4f6c :WebKit<\/span><\/div>\n<div><i title=\"\u5f15\u7528\"><\/i><span><\/span><\/div>\n<\/div>\n<div>path \u53ef\u4ee5\u6839\u636e title \u751f\u6210\u5c31\u597d\u4e86\u3002<\/div>\n<\/div>\n<\/li>\n<li data-pid=\"7519393\" data-uid=\"2\"><a href=\"http:\/\/machbbs.com\/user-2.htm\" tabindex=\"-1\"><\/a>\n<div>\n<div>\n<div><span>\u8cc7\u6df1\u5927\u4f6c :codehz<\/span><\/div>\n<div><i title=\"\u5f15\u7528\"><\/i><span><\/span><\/div>\n<\/div>\n<div>\u4e3a\u4ec0\u4e48\u4e0d\u80fd\u6362\u4e2a\u601d\u8def\uff0c\u68c0\u6d4b\u5230 issue \u521b\u5efa\u518d\u89e6\u53d1\u6587\u7ae0\u751f\u6210\u5462<\/div>\n<\/div>\n<\/li>\n<li data-pid=\"7519394\" data-uid=\"2\"><a href=\"http:\/\/machbbs.com\/user-2.htm\" tabindex=\"-1\"><\/a>\n<div>\n<div>\n<div><span>\u8cc7\u6df1\u5927\u4f6c :twfb<\/span><\/div>\n<div><i title=\"\u5f15\u7528\"><\/i><span><\/span><\/div>\n<\/div>\n<div>\u53c2\u8003\u4e3b\u521b\u610f \u5199\u4e86\u4e2a\u811a\u672c \u6839\u636e issue \u81ea\u52a8\u751f\u6210\u6587\u7ae0<\/div>\n<\/div>\n<\/li>\n<li data-pid=\"7519395\" data-uid=\"2\"><a href=\"http:\/\/machbbs.com\/user-2.htm\" tabindex=\"-1\"><\/a>\n<div>\n<div>\n<div><span>\u8cc7\u6df1\u5927\u4f6c :twfb<\/span><\/div>\n<div><i title=\"\u5f15\u7528\"><\/i><span><\/span><\/div>\n<\/div>\n<div>https:\/\/github.com\/twfb\/DeployIssue<\/div>\n<\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u4e2a\u57fa\u4e8e GitHub Issue&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/556731"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=556731"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/556731\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=556731"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=556731"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=556731"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}