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

推荐订阅源

T
The Blog of Author Tim Ferriss
TaoSecurity Blog
TaoSecurity Blog
Apple Machine Learning Research
Apple Machine Learning Research
Hugging Face - Blog
Hugging Face - Blog
IT之家
IT之家
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
小众软件
小众软件
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
S
SegmentFault 最新的问题
T
Troy Hunt's Blog
N
News and Events Feed by Topic
雷峰网
雷峰网
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
PCI Perspectives
PCI Perspectives
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
www.infosecurity-magazine.com
www.infosecurity-magazine.com
博客园 - 三生石上(FineUI控件)
Schneier on Security
Schneier on Security
T
The Exploit Database - CXSecurity.com
L
LINUX DO - 最新话题
V
V2EX
T
Threat Research - Cisco Blogs
人人都是产品经理
人人都是产品经理
C
Cisco Blogs
The GitHub Blog
The GitHub Blog
爱范儿
爱范儿
I
Intezer
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Recent Announcements
Recent Announcements
月光博客
月光博客
Recent Commits to openclaw:main
Recent Commits to openclaw:main
N
News | PayPal Newsroom
Cyberwarzone
Cyberwarzone
B
Blog
博客园 - 聂微东
P
Palo Alto Networks Blog
A
About on SuperTechFans
The Last Watchdog
The Last Watchdog
Scott Helme
Scott Helme
Google DeepMind News
Google DeepMind News
Webroot Blog
Webroot Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
O
OpenAI News
C
Check Point Blog
Hacker News: Ask HN
Hacker News: Ask HN
W
WeLiveSecurity
V
Vulnerabilities – Threatpost
博客园 - 【当耐特】
有赞技术团队
有赞技术团队
A
Arctic Wolf

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本身的设置,主题还有大量设置,目前我只是大概过了一遍。