Total Pageviews

5,441,276

Saturday, 25 January 2025

搭建基于github issue的静态博客程序sgib

首先 fork此项目https://github.com/SR0725/github-issue-blog,我fork后的项目地址是

https://github.com/briteming/sgib,然后访问https://github.com/briteming/sgib/settings,勾选issues.  然后访问https://github.com/briteming/sgib/issues/new ,新建一些issues.

然后,

配置GitHub OAuth

為了讓您的應用能夠通過 GitHub OAuth驗證,請按照以下步驟操作:

  1. 訪問 GitHub Developer Settings
  2. 點擊「New OAuth App」按鈕。
  3. 在「Name」欄位中隨意填寫應用名稱。我填写的是sgib.
  4. 「Homepage URL」填寫為 http://localhost:3000/
  5. (可選)填寫應用描述。
  6. 「Authorization callback URL」填寫為 http://localhost:3000/api/auth/callback/github
  7. 確保「Enable Device Flow」保持未勾選狀態。
  8. 點擊「Register application」按鈕, 完成註冊。
  9. 註冊後,您將獲得一個 Client ID。
  10. 生成一個 Client Secret,點擊「Generate a new client secret」按鈕,輸入您的 GitHub 密碼以確認。(把Client ID的值和Client Secret的值记录下来,比如保存到一个txt文件中)

然后,访问vercel.com/new ,导入项目https://github.com/briteming/sgib到vercel.com/new。 在来到如下页面时,点击environment variables:

按https://github.com/briteming/sgib/blob/master/.env.example的内容,添加全部的环境变量。其中,NEXTAUTH_SECRET的值,填写一个随机的字符串。然后点击  deploy按钮,等待部署完成,部署完成后,我得到的网址是https://sgib.vercel.app/

演示网站:https://sgib.vercel.app/

项目地址:https://github.com/SR0725/github-issue-blog

https://github.com/briteming/sgib

 

 



No comments:

Post a Comment