cdlug / cdlug.github.io

Website of Chengdu GNU/Linux User Group
https://cdlug.org
Creative Commons Attribution Share Alike 4.0 International
6 stars 3 forks source link

要不要考虑把 static site generator 迁移到 hugo #19

Closed QuantumGhost closed 4 years ago

QuantumGhost commented 4 years ago

Hugo 跟 Jekyll 差不多,但是安装比 Jekyll 方便(下载一个 binary 就能跑了),这样本地改样式的时候可以直接本地生成本地调试。

不过坏处就是 Github 不支持自动生成网页了,要想办法用其他工具(比如 CircleCI,Github Actions)来在 push 之后自动生成网页。

或者直接用 Netlify 来部署,看起来应该原生支持 Hugo

附:在 Github 上部署 Hugo 的文档

too commented 4 years ago

不知道用过 hexo 没有, hexo 有插件可以 push 之后自动更新

QuantumGhost commented 4 years ago

Hexo 也有要装环境(Node.js)的问题,Hugo 可以避免这点。

自动部署看起来可以用 Netlify 来做

QuantumGhost commented 4 years ago

不过我考虑了一下,可能前端同学们对 JS 写的 Hexo 会更喜欢(不知道这个项目都是谁在维护)

too commented 4 years ago

主要是 Hexo 比较熟悉, Hugo 据说是挺不错的,就是没弄过

QuantumGhost commented 4 years ago

Hexo 我没弄过,不过这个我先看看再说吧

haobug commented 4 years ago

hexo 有哥们(手动 @ cosmos )弄过。

之前有哥们弄了 hexo,还玩了反向代理 ,然后他忙于和各种妹子约会和学习,然后我接到锅玩不转。

我在怀疑 SF 的维护者们,天天还在自己撸 html 或者自己维护脚本更新页面。 我认同用 sf 的都是大佬(我有过劝 xxdiff 大佬用 git/github 被骂怂的战绩),但是至今我都没有 sf 帐号,或者注册来就没有活跃用起来。

不只是我也看到很多之前托管在 sf 或者其他地方的项目慢慢迁移到 github github 作为商业实现,他之所以走到今天的地位,就是香。 (gitlab 我不了解,如果一样香,毫不犹豫的不犹豫的)

我在这说这,不是舔哪一家,是因为我爱你们,我也是在对赌一样用命和你们在这讨论这。

https://github.com/cdlug/cdlug.github.io/issues/3#issuecomment-600252519On 3/17/20,

QuantumGhost notifications@github.com wrote:

Hexo 我没弄过,不过这个我先看看再说吧

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/cdlug/cdlug.github.io/issues/19#issuecomment-599855907

-- from haobug

haobug commented 4 years ago

刚发现 xxdiff 作者也在用 bitbucket 了(笑 (:D。

QuantumGhost commented 4 years ago

xxdiff 是什么...

QuantumGhost commented 4 years ago

FYI #20

haobug commented 4 years ago

@QuantumGhost 看到了效果比 jekyll 打开快一点,但是有可能是 netlify 的cdn 做的好。 但是兄弟,我切换 hugo 意思就是我们又要买vps 了(或者 netlify 有免费更新机器人?), 最重要的是你吧 hugo 的锅背起了哦,可能这一秒你愿意,但是这个承诺要 10 年的话,你能愿意吗。

所以我有一个很 sao 的想法,能不能做静态化引擎的兼容(或者的文章模板的兼容),让我们同一个仓库,可以用不同工具预览(hexo, hugo, jekyll etc.)

(jekyll 本地预览工具搭建一次就累了,但是在线预览真香)

haobug commented 4 years ago

(考虑到 1w 年的时候都后银河帝国时代了,想太远,改成 10 年)

TechQuery commented 4 years ago

Hexo 我搞的多,也封装了好用的工具 —— https://tech-query.me/development/wiki-on-git/

但 Jekyll、Hexo、Hugo 这些有一个共同的问题 —— 它们都使用基于字符串拼接的模板,开发起来不能有很好的代码提示,更不能利用现代的工程化工具链。所以我正在开发一个基于最新 Web 组件标准和 JSX 的静态网站生成器 —— https://github.com/EasyWebApp/MarkCell ,这两天正在开发一个试验网站,很快就能用起来。

QuantumGhost commented 4 years ago

Hugo 不用买 VPS 啊,这个也是静态站点生成器,理论上你把 hugo output 拷贝到任何服务器上然后拿个 http server serve 起来就能看到

Netlify 就是用来部署静态网站的,然后可以集成 Github 直接用 hook 来触发 Deploy

gRPC 的网站也是用 Netlify 来部署的 https://github.com/grpc/grpc.io/pull/121

QuantumGhost commented 4 years ago

@TechQuery 也有现代化组件化的前端框架,比如 GatsbyNext.js 或者 Nuxt.js (更多查看:https://www.staticgen.com/

不过我觉得这些对于内容贡献者不太友好(需要安装 Node.js 和各种开发依赖才能在本地预览),对于网页设计者当然要友好很多;这也是为什么我会说用 Hugo,因为安装一个二进制包就能提交内容还是相对简单很多的

TechQuery commented 4 years ago

@QuantumGhost 你说的那些框架用起来太重,我才自研的

Node.js 安装已经非常方便了,比如 Windows ——

choco install nodejs

git clone https://github.com/xxx/xxx.git

cd xxx/
npm install
npm start
QuantumGhost commented 4 years ago

但是依然是要安装

  1. Node.js 依赖
  2. 静态网站生成器的

而且我在想,cdlug 主要的还是内容而不是主题,换一个对主题维护者友好的实现收益可能未必会很大

haobug commented 4 years ago

Node.js 安装已经非常方便了,比如 Windows ——

choco install nodejs

git clone https://github.com/xxx/xxx.git

cd xxx/
npm install
npm start

这是概念层面的美好愿望。请给出完整的命令,或者你找台 windows 试试看。现实有时候很残酷。

@QuantumGhost 你说的那些框架用起来太重,我才自研的

一定要做成能无依赖或者打包好能独立运行版本。单个文件的大小没有所谓的,jekyll 就是个依赖一大堆的坑货。虽然坑但它有 github page 的在线预览编辑功能很好用,对单纯贡献文章很好用。

@QuantumGhost 推荐同样 也是基于让文章贡献者更易用的目标我想。

TechQuery commented 4 years ago

@haobug 我给出的都不是概念性的东西,全是我在 Windows、Linux、Mac 上实战、填坑完的,已经建了好几个站了 ——

  1. https://github.com/TechQuery/TechQuery.github.io
  2. https://github.com/FreeCodeCamp-Chengdu/FreeCodeCamp-Chengdu.github.io
  3. https://github.com/kaiyuanshe/kaiyuanshe.github.io

全是以下两条命令一键搭建的 ——

choco install nodejs

npm init hexo-wiki repo_name \
    --theme name \
    --plugins one,two \
    --remote https://github.com/your_id/repo_name.git
haobug commented 4 years ago

@TechQuery 看到你的战绩很可观。 最后和 @too 对赌达成,后续网站基础设施都由他维护。我们只管贡献内容。这样。

QuantumGhost commented 4 years ago

所以说结论是基于现在的 Jekyll 继续跑呢,还是换 Hugo 呢,还是其他方案呢

too commented 4 years ago

@TechQuery 看到你的战绩很可观。 最后和 @too 对赌达成,后续网站基础设施都由他维护。我们只管贡献内容。这样。

我维护并不能阻止其他人贡献啊,我来协调和梳理可以吧,我贡献内容也可以吧?

too commented 4 years ago

@QuantumGhost 你测试 Hugo 的情况如何? 对于 @TechQuery 的方案你觉得如何? 要不先选一个做起来看,另外一个放一放,免得重复工作了

QuantumGhost commented 4 years ago

我这个 #20 基本完工了 2333

其实没啥工作量,当然也算不上完美(比如 Telegram 就没有 Icon,当然这都是可以解决的)

我还是觉得让大家提交内容更简单一点比较好(当然在有人维护主题的情况下,内容提交者的差别也就是依赖了

too commented 4 years ago

我也支持先试试让大家提交内容,万一都没人看 blog 了,那折腾半天不是白忙活吗

QuantumGhost commented 4 years ago

blog 还是要有的(至少需要一个关于页面和一个财务页面 = =

QuantumGhost commented 4 years ago

所以说这个现在是什么情况呢

haobug commented 4 years ago

所以说这个现在是什么情况呢

issue #20 回复一下我。(结果还是花命的老实人) 我看了预览地址加载比现在快点。看着轻爽点。

haobug commented 4 years ago

It seems that we are using Hugo now...

Maybe you should check it out: https://cdlug.org

Sorry for not reminding you.

Sent from ProtonMail mobile

-------- Original Message -------- On Mar 18, 2020, 04:18, hao Qing wrote:

hexo 有哥们(手动 @ cosmos )弄过。

之前有哥们弄了 hexo,还玩了反向代理 ,然后他忙于和各种妹子约会和学习,然后我接到锅玩不转。

我在怀疑 SF 的维护者们,天天还在自己撸 html 或者自己维护脚本更新页面。 我认同用 sf 的都是大佬(我有过劝 xxdiff 大佬用 git/github 被骂怂的战绩),但是至今我都没有 sf 帐号,或者注册来就没有活跃用起来。

不只是我也看到很多之前托管在 sf 或者其他地方的项目慢慢迁移到 github github 作为商业实现,他之所以走到今天的地位,就是香。 (gitlab 我不了解,如果一样香,毫不犹豫的不犹豫的)

我在这说这,不是舔哪一家,是因为我爱你们,我也是在对赌一样用命和你们在这讨论这。

https://github.com/cdlug/cdlug.github.io/issues/3#issuecomment-600252519On 3/17/20,

QuantumGhost notifications@github.com wrote:

Hexo 我没弄过,不过这个我先看看再说吧

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/cdlug/cdlug.github.io/issues/19#issuecomment-599855907

-- from haobug

-- You received this message because you are subscribed to the Google Groups "Chengdu GNU/Linux User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to cdlug_community+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/cdlug_community/CANw%2Br1UgE4Jm6sGhcDf0Cos0i_5U-44gSbDJAFTGXxrDbtoW7w%40mail.gmail.com.

QuantumGhost commented 4 years ago

done in #20