fi3ework / hexo-theme-archer

🎯 A smart and modern theme for Hexo.
https://fi3ework.github.io/hexo-theme-archer
MIT License
1.49k stars 274 forks source link

Resovles #312 实现 GitHub Action ,自动发布 Demo 到 GitHub Page #322

Closed Stark-X closed 2 years ago

Stark-X commented 2 years ago

效果

push mater、合并 PR,会触发构建一个 Demo 到 gh_pages 分支

https://blog.stark-x.cn/hexo-theme-archer/

snapshot

已知问题

发现「暗色」功能失效,会一直处于「暗色」模式,应该跟路径有关系,尝试修复无果

尝试的 commit:

LolipopJ commented 2 years ago

应该可以把 demo 目录中的文件直接上传到 gh-source 分支。

master 分支发生提交事件后,github actions 拉取 gh-source 分支的代码到例如 /demo 目录下,然后再克隆 master 分支的主题文件到 /demo/theme/archer 目录下,进入到 /demo 执行 hexo build 生成静态文件,最后将静态文件推送到 preview 分支。

优点是避免无关的文件占用主题空间。

接下来我尝试这么做一下,顺便修修样式表文件目录的问题!

Stark-X commented 2 years ago

应该可以再创建一个孤儿分支 用来存 demo的内容

Stark.Xiao Thank you & Best Regards

在 2021年11月14日,下午11:24,JasonSun @.***> 写道:

 应该可以把 demo 目录中的文件直接上传到 gh-source 分支。

master 分支发生提交事件后,github actions 拉取 gh-source 分支的代码到例如 /demo 目录下,然后再克隆 master 分支的主题文件到 /demo/theme/archer 目录下,进入到 /demo 执行 hexo build 生成静态文件,最后将静态文件推送到 gh-pages 分支。

优点是避免无关的文件占用主题空间。

接下来我尝试这么做一下,顺便修修样式表文件目录的问题!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

fi3ework commented 2 years ago

需要我给 gh-source 分支开启 github pages 吗

LolipopJ commented 2 years ago

应该可以再创建一个孤儿分支 用来存 demo的内容 Stark.Xiao Thank you & Best Regards

好的,现在已经创建好了 gh-source 分支存放 demo 目录中的内容。

需要我给 gh-source 分支开启 github pages 吗

推送 master 分支后,一切没有问题了的话,可以给 gh-pages 分支开启 github pages 了。

LolipopJ commented 2 years ago

@fi3ework 看上去很成功!试试给 gh-pages 分支开启 github pages 吧。

LolipopJ commented 2 years ago

发现「暗色」功能失效,会一直处于「暗色」模式,应该跟路径有关系,尝试修复无果

看上去部署在 blog.stark-x.cn/hexo-theme-archer 下,需要读取的路径应该为 /hexo-theme-archer/css/dark.css,应该可以从 Hexo 根目录下的 config.yml 中的 url 项获取。我将修复此问题。

fi3ework commented 2 years ago

@LolipopJ Done image

LolipopJ commented 2 years ago

@Stark-X @fi3ework Great works!

LolipopJ commented 2 years ago

最后修改一下这里的链接为 https://fi3ework.github.io/hexo-theme-archer 就好啦!README.md 里的链接我已经改了。

image

有机会也许可以推到 Gitee 上去,方便更多用户预览。

fi3ework commented 2 years ago

最后修改一下这里的链接为 https://fi3ework.github.io/hexo-theme-archer 就好啦!README.md 里的链接我已经改了。

image

有机会也许可以推到 Gitee 上去,方便更多用户预览。

Done, nice work! 🚀🚀🚀