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

推荐订阅源

WordPress大学
WordPress大学
Microsoft Security Blog
Microsoft Security Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
V
Visual Studio Blog
宝玉的分享
宝玉的分享
IT之家
IT之家
人人都是产品经理
人人都是产品经理
T
The Blog of Author Tim Ferriss
I
InfoQ
B
Blog RSS Feed
T
Threatpost
博客园_首页
M
MIT News - Artificial intelligence
Spread Privacy
Spread Privacy
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Know Your Adversary
Know Your Adversary
U
Unit 42
Engineering at Meta
Engineering at Meta
C
Cyber Attacks, Cyber Crime and Cyber Security
月光博客
月光博客
Scott Helme
Scott Helme
T
Tor Project blog
有赞技术团队
有赞技术团队
AWS News Blog
AWS News Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Last Week in AI
Last Week in AI
S
Schneier on Security
Vercel News
Vercel News
博客园 - Franky
C
Cybersecurity and Infrastructure Security Agency CISA
L
LINUX DO - 热门话题
NISL@THU
NISL@THU
L
LangChain Blog
爱范儿
爱范儿
Google DeepMind News
Google DeepMind News
The GitHub Blog
The GitHub Blog
雷峰网
雷峰网
Latest news
Latest news
C
CXSECURITY Database RSS Feed - CXSecurity.com
Hugging Face - Blog
Hugging Face - Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
G
GRAHAM CLULEY
S
Security Affairs
A
About on SuperTechFans
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
大猫的无限游戏
大猫的无限游戏
W
WeLiveSecurity
Cisco Talos Blog
Cisco Talos Blog
罗磊的独立博客

ncc的个人网站

MCSManager 数据备份与迁移实践 Goland Update Delve frp反向代理群晖WebDAV服务器 1panel安装的Mysql版本从5.7升级到8.4.5 备份mc服务器脚本 威联通使用screen报错 Cannot find terminfo entry for 'screen.linux' Brew No Available Formula Gitea迁移和SSH容器直通 QQ邮箱文件夹重新开启通知 Act_runner 使用 supervisor 启动无法正常识别到 asdf 设置的环境问题(二)
将博客从Typecho迁移到Hugo
FGHWETT · 2024-11-10 · via ncc的个人网站

警告

本文最后更新于 2025-01-22,文中内容可能已过时。

上半年的时候,蓝易云搞了个CDN,送我我一年的体验时间,于是我就想着将博客框架换成hugo,顺便体验一下artalk。

当时其实已经搞了一半,但是后来一只没时间进行细化(主题和artalk涉及的自定义项目太多了),也就搁置到了现在。

大致流程

  1. 创建对应的Hugo项目,并选择喜欢的主题。
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 新建站点
hugo new site blog_name

# 添加主题
git init .
git submodule add https://github.com/hugo-fixit/FixIt.git themes/FixIt
echo "theme = 'FixIt'" >> hugo.toml
echo "defaultContentLanguage = 'zh-cn'" >> hugo.toml

# 切换主题分支
git submodule add -b dev https://github.com/hugo-fixit/FixIt.git themes/FixIt

# 升级主题
git submodule update --remote --merge themes/FixIt

# 添加内容
hugo new content posts/my-first-post.md

# 本地启动 -D 查看草稿
hugo server -D

# 修改主题配置文件
mv hugo.toml hugo.old.toml
cp themes/FixIt/hugo.toml hugo.toml
echo "theme = 'FixIt'" >> hugo.toml
  1. 导出博客内容为对应的格式

    这里我是直接连接到数据库,并且编写相应的代码,将文章和分类导出来了。目前代码不完善且不能适配所有情况,所以就不放了,有需求的可以直接在github搜索相关关键词,使用其他人的。

  2. 搭建artalk服务,并迁移typecho的评论

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
services:
  artalk:
    container_name: artalk
    image: artalk/artalk-go:2.9.1
    restart: unless-stopped
    ports:
      - 30100:23366
    volumes:
      - ./data:/data
    environment:
      - TZ=Asia/Shanghai
      - ATK_LOCALE=zh-CN
    networks:
      - 1panel-network

networks:
  1panel-network:
    external: true

其实流程并不是很复杂,主要还是配置项目太多,hugo本身的设置,主题还有大量设置,目前我只是大概过了一遍。