Hexo 使用记录: 安装和简单配置

Hexo 是一个快速, 简洁且高效的博客框架. 使用 Markdown 解析文章,依照配置好的主题来生成静态网页.

本博客用的就是 Hexo.

安装

安装 Hexo 之前要先安装 Git 和 Node.js. Git 的安装不在这里说明, 只说明安装 Node.js.

1
2
3
4
5
6
7
8
9
10
# 如果没有curl, 要先安装curl
sudo apt-get install -y curl
# 下载安装脚本
curl -fsSL https://deb.nodesource.com/setup_23.x -o nodesource_setup.sh
# 运行安装脚本
sudo -E bash nodesource_setup.sh
# 安装Node.js
sudo apt-get install -y nodejs
# 验证安装结果
node -v

安装好 Node.js 后, 开始安装 Hexo

1
2
3
4
5
6
7
8
# 安装 hexo
npm install -g hexo-cli
# 启动 hexo
cd ~
mkdir hexo
hexo init hexo
cd hexo
npm install

配置和使用

可以在 _config.yml 中修改大部分的配置. 具体配置项及其含义见官方文档配置章节.

最开始, 这个网站主要修改了:

1
2
3
4
5
6
7
8
9
10
11
12
# Site
title: Ker's site.
subtitle: 'ker0123的个人网站, 记载了他一段时间的所学.'
description: '网站开始于2025年5月, 自己大学毕业的后几天. 实际上已经工作快半年了. 这段时间发觉自己的技术栈还是太浅了, 对于软件这一块, 尤其是互联网软件, 相关知识及其欠缺. 于是租了个服务器, 开始一边学习一边尝试自己写一些东西.'
keywords:
author: ker0123
language: ch
timezone: 'Asia/Shanghai'

# URL
## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'
url: http://www.kers.site

在命令行使用new命令来生成新文章:

1

Hexo 使用记录: 安装和简单配置

http://www.kers.site/2025/05/29/record-hexo/

作者

ker0123

发布于

2025-05-29

更新于

2025-06-14

许可协议

You need to set install_url to use ShareThis. Please set it in _config.yml.
You forgot to set the business or currency_code for Paypal. Please set it in _config.yml.

评论