从 Hexo 迁移到 Hugo 时,Markdown 正文通常可以直接复用,真正需要仔细处理的是 Front Matter、固定链接和旧地址。Solitude Hugo 保留常用文章参数,同时使用 Hugo 的原生字段表达更新日期和 URL 兼容关系。

Front Matter 字段映射

HexoHugo说明
datedate文章发布日期
updatedlastmod最后更新时间
abbrlinkslug用原短链接值生成文章地址
categoriescategories进入 Hugo 分类 Taxonomy
tagstags进入 Hugo 标签 Taxonomy
topweight 或自定义字段根据站点排序策略决定

cover、description、comment、aside、toc、series 等 Solitude 参数可以继续放在文章 Front Matter 中。

示例站在 hugo.yaml 中使用:

yaml
uglyURLs:
  posts: true

permalinks:
  posts: /p/:slug

文章把原 Hexo abbrlink 复制到 slug:

yaml
---
title: 从 Hexo 迁移到 Hugo
slug: "20260818"
abbrlink: "20260818"
aliases:
  - /archives/2026/08/18/legacy-url/
---