Hugo搭建

2025/12/22

从2015年开始,我使用Hexo框架Next主题搭建,个人博客系统,正好十年。 框架和主题配置完成后,我只要关注markdown内容即可。

在这使用过程中,遇到过一次大规模的js投毒,那一次hexo 编译不出。 hexo 和next 框架 变更实在是太快了,最近在github 的页面编译不出后,我修复无果,也懒得折腾了,在初步调研后,准备使用hugoHugo Xmin

使用的是 hugo 与 hugo-xmin

hugo 安装

hugo 可以直接下载二进制文件 https://github.com/gohugoio/hugo/releases?page=3

hugo v0.146.7

hugo-xmin 从git库中下载

https://github.com/yihui/hugo-xmin

c871e5665f5eceb919c8fdb284b73c7a07012646

我个人是mac,使用的是docker debian镜像,在它上面安装二进制文件

docker pull --platform linux/arm64 debian:12-slim
services:
  hugo:
    image: debian:12-slim
    volumes:
      - talengu.github.io:/blog
      - blog/posts:/blog/content/post
    working_dir: /blog
    ports:
      - 1313:1313
    command: ./hugo_0.146.7_arm64 server --bind 0.0.0.0
    stdin_open: true
    tty: true

其他docker镜像可使用 klakegg/hugo

hugo 使用

./hugo server –bind 0.0.0.0 ./hugo build

cd public
git init
git remote add origin git@github.com:talengu/talengu.github.io.git
git checkout -b gh-pages
git add .
git commit -m "Deploy Hugo site"
git push -f origin gh-pages

分类布局

categoriesfolder name放什么
lifec0-life旅行 / 阅读 / 随笔
mathc1-math概率 / 线代 / 算法
roboticsc2-robotics机器人
aic3-aiLLM / CV / 实验记录
systemc4-system性能 / 架构 / OS 设计
linuxc5-linux内核、发行版、系统工具
networkc6-networkTCP/IP、抓包、协议
toolchainc7-toolchaingcc / musl / cmake / build / rss工具
programmingc8-programmingC / Python / 数据结构

添加评论 使用 giscus.app

按 giscus.app 官方进行操作即可 https://giscus.app/

添加搜索