Total Pageviews

Sunday, 29 December 2024

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

 首先fork这个项目https://github.com/wallleap/ethereal ,我fork后,得到的项目地址是

github.com/briteming/ethereal,然后编辑config.js文件:

https://github.com/briteming/ethereal/blob/main/src/config.js,把第48行的username的值和第49行的repository的值分别改为你的username的值和repository的值。

在 https://github.com/briteming/ethereal/settings ,勾选issues。然后在

https://github.com/briteming/ethereal/issues/new 写issue的标题和内容,并提交。


然后在本地机器上,

git clone https://github.com/briteming/ethereal ethereal-by-briteming

cd ethereal-by-briteming

pnpm install

pnpm build (此命令会生成静态网站的根目录dist)

cd dist

~/ethereal-by-briteming/dist (main)$ ls

css/  favicon.ico  index.html  js/  logo.svg  manifest.json  png/

~/ethereal-by-briteming/dist (main)$ python3 -m http.server 2345

访问http://127.0.0.1:2345 ,即可看到网站效果。

采取导入项目https://github.com/briteming/ethereal 到https://app.netlify.com/空间的办法(或者导入项目https://github.com/briteming/ethereal 到render.com 空间)

得到的网址是https://etr-briten.netlify.app/#/archives

(得到的网址是https://ethereal-y18f.onrender.com,

https://etr-brite.onrender.com)


https://github.com/briteming/ethereal/blob/main/.env.sample  (在https://app.netlify.com/网站上, 到了 add environment variables 那步,需要添加环境变量VITE_GITHUB_TOKEN及其值)

https://vercel.com/ 空间,已部署过的项目能重新部署:

要先访问https://vercel.com/luckypoems-projects/ethereal-qsz7/settings/environment-variables ,编辑环境变量(主要是如果access token失效了,就需要重新输入新的access token)
然后访问https://vercel.com/luckypoems-projects/ethereal-qsz7/deployments ,如下面的示意图那样部署,这次终于成功重新部署网站https://ethereal-qsz7.vercel.app


(详见https://github.com/wallleap/ethereal/issues/2#issuecomment-2676677476)


这个静态博客程序ethereal也是有点神奇:我提交issue后,博客网站就自动更新了。

演示网站:

https://etr-briten.netlify.app

https://etr-brite.onrender.com

https://ethereal-y18f.onrender.com

https://ethereal-qsz7.vercel.app

项目地址:

https://github.com/wallleap/ethereal 

https://github.com/wallleap/ethereal/issues/2

github.com/briteming/ethereal


No comments:

Post a Comment