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

推荐订阅源

I
Intezer
V
Vulnerabilities – Threatpost
Google Online Security Blog
Google Online Security Blog
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
AWS News Blog
AWS News Blog
G
GRAHAM CLULEY
P
Privacy & Cybersecurity Law Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
Cybersecurity and Infrastructure Security Agency CISA
N
News | PayPal Newsroom
T
Tenable Blog
Spread Privacy
Spread Privacy
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
S
Secure Thoughts
P
Privacy International News Feed
IT之家
IT之家
Project Zero
Project Zero
T
The Blog of Author Tim Ferriss
Engineering at Meta
Engineering at Meta
大猫的无限游戏
大猫的无限游戏
博客园_首页
GbyAI
GbyAI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
量子位
雷峰网
雷峰网
Apple Machine Learning Research
Apple Machine Learning Research
Hacker News: Ask HN
Hacker News: Ask HN
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
N
Netflix TechBlog - Medium
Martin Fowler
Martin Fowler
NISL@THU
NISL@THU
I
InfoQ
D
DataBreaches.Net
有赞技术团队
有赞技术团队
K
Kaspersky official blog
Security Latest
Security Latest
The Register - Security
The Register - Security
Hugging Face - Blog
Hugging Face - Blog
S
Security @ Cisco Blogs
P
Proofpoint News Feed
M
MIT News - Artificial intelligence
H
Hackread – Cybersecurity News, Data Breaches, AI and More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
AI
AI
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
N
News and Events Feed by Topic

绘星里

绘星里 | 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: