首页 教程 Halo 主题开发入门指南
教程

Halo 主题开发入门指南

纳米缪斯 | | 17

准备工作

开发 Halo 主题需要了解以下技术栈:

  • Thymeleaf — 服务端模板引擎
  • CSS/JS — 前端样式和交互
  • theme.yaml — 主题配置文件
  • settings.yaml — 主题设置面板

项目结构

theme-name/
├── theme.yaml
├── settings.yaml
├── templates/
│   ├── index.html
│   ├── post.html
│   └── modules/
│       ├── layout.html
│       └── sidebar.html
└── templates/assets/
    ├── css/style.css
    └── js/main.js

模板语法

Halo 使用 Thymeleaf 作为模板引擎。常用的语法包括 th:textth:eachth:if 等。

开发时建议开启 Halo 的开发者模式,修改模板后无需重启即可看到效果。
END
← 上一篇 AI 辅助编程的未来:工具与思考 下一篇 → Nano Muse 设计系统:从概念到实现