Documentation
¶
Overview ¶
Package theme 负责加载与渲染主题. 主题目录结构: theme.json, layouts/, assets/. 优先加载 Space 中的 themes/<name>, 缺失时回退到内嵌默认主题.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Theme ¶
type Theme struct {
Name string
Version string
Layouts map[string]*template.Template
Assets map[string][]byte // 相对路径 -> 内容
HasOwnFS bool // 是否来自 Space 目录
}
Theme 表示一个已加载的主题.
func Load ¶
Load 从 Space 的 themes/<name> 目录加载主题. 如果目录不存在, 回退到内嵌默认主题. lang 决定模板函数 (t / formatDate) 的语言, baseURL 决定链接基础路径 (url 函数).
func LoadEmbedded ¶
LoadEmbedded 加载内嵌的默认主题. 内嵌主题版本跟随产品版本 (由 internal/version 提供), 用于构建指纹.
Click to show internal directories.
Click to hide internal directories.