惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
Darknet – Hacking Tools, Hacker News & Cyber Security
V
Vulnerabilities – Threatpost
Cloudbric
Cloudbric
G
GRAHAM CLULEY
S
Securelist
Schneier on Security
Schneier on Security
Help Net Security
Help Net Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Project Zero
Project Zero
Spread Privacy
Spread Privacy
P
Privacy International News Feed
C
Cyber Attacks, Cyber Crime and Cyber Security
Cisco Talos Blog
Cisco Talos Blog
T
Tailwind CSS Blog
博客园_首页
有赞技术团队
有赞技术团队
Simon Willison's Weblog
Simon Willison's Weblog
Stack Overflow Blog
Stack Overflow Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Latest news
Latest news
T
Tor Project blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Attack and Defense Labs
Attack and Defense Labs
www.infosecurity-magazine.com
www.infosecurity-magazine.com
O
OpenAI News
J
Java Code Geeks
T
Tenable Blog
K
Kaspersky official blog
AWS News Blog
AWS News Blog
S
Security @ Cisco Blogs
The GitHub Blog
The GitHub Blog
T
Threatpost
月光博客
月光博客
H
Heimdal Security Blog
Security Latest
Security Latest
The Hacker News
The Hacker News
Y
Y Combinator Blog
A
Arctic Wolf
Apple Machine Learning Research
Apple Machine Learning Research
C
Cisco Blogs
美团技术团队
Microsoft Security Blog
Microsoft Security Blog
Hugging Face - Blog
Hugging Face - Blog
T
The Blog of Author Tim Ferriss
C
CERT Recently Published Vulnerability Notes
D
Docker
Google Online Security Blog
Google Online Security Blog
D
DataBreaches.Net
V
Visual Studio Blog
H
Help Net Security

绘星里

绘星里 | 2026-06小记 绘星里 | 2026-05小记 绘星里 | 2026-04小记 绘星里 | emaction,但适配pjax(附新版教程) 绘星里 | 2026-03小记 绘星里 | 2026-02小记 绘星里 | 2026-01小记 绘星里 | 2025小结 绘星里 | 2025-12小记 绘星里 | 2025的最后几天,主题再次重写 绘星里 | 一个追梦者的“堕落”
绘星里 | 将Hugo博客通过CNB部署到Edgeone Pages和Vercel
王九弦SZ·Ninty · 2026-01-11 · via 绘星里

2026年1月11日 站点折腾 站点折腾 154 字 1 分钟

考完春季高考之后,终究还是没忍住 CNBEdgeone Pages 的诱惑

到家立刻就给博客源码放到CNB上面来了当然这没有开源
同时在 枋柚梓的文章 那边了个将博客仓库同步到Github的配置

但是 Edgeone Pages 没有可以配置Hugo模版的地方
而且cnb的云原生构建和和github action不太一样
云原生那个是用的Docker镜像

我选取的镜像是hugomods/hugo:node-git,因为这个镜像带 Git 和 node
(用 Node 的原因是我配置了 gulp 来压缩站点的静态资源)

配置文件(Vercel):

# 定义云构建
main:
  push:
    - name: 上传到Vercel
      imports: 
        - https://cnb.cool/SinzMise/szn-cnb-keys/-/blob/main/blog-push.yml
      docker:
        image: hugomods/hugo:node-git
        volumes:
          - /root/.npm
          - ./node_modules
      stages:
        - name: 安装依赖
          script: |
            npm install
            npm install -g gulp-cli vercel
        - name: 构建博客 + 上传到Vercel
          script: |
            npm run build
            npm run compress
            cd public
            vercel deploy --prod --token $VERCEL_TOKEN

配置文件(Edgeone Pages):

# 定义云构建
main:
  push:
    - name: 上传到Edgeone
      imports: 
        - https://cnb.cool/SinzMise/szn-cnb-keys/-/blob/main/blog-push.yml
      docker:
        image: hugomods/hugo:node-git
        volumes:
          - /root/.npm
          - ./node_modules
      stages:
        - name: 安装依赖
          script: |
            npm install
            npm install -g gulp-cli edgeone
        - name: 构建博客 + 上传到Edgeone
          script: |
            npm run build
            npm run compress
            edgeone pages deploy ./public -n cenablog -t $EDGEONE_TOKEN

关于npm run buildnpm run compress的定义如下:

{
  "scripts": {
    "build": "node link.js && hugo --gc", // 友链朋友圈json的生成和Hugo的构建
    "compress": "gulp" // 静态资源压缩
  },
}

本文作者: 王九弦SZ·Ninty

版权声明: 转载请注明原文出处及本声明。本文采用 BY-NC-SA 许可协议进行许可。

网络回响

加载中...

发送回应

如果您在其他地方写过关于这篇文章的文章,可以在这里发送 Webmention: