Documentation
¶
Overview ¶
Package data 加载数据并对其进行处理。
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Archive ¶
type Archive struct {
Title string // 当前存档的标题
Posts []*Post // 当前存档的文章列表
// contains filtered or unexported fields
}
Archive 表示某一时间段的存档信息
type Data ¶
type Data struct {
Created time.Time
// Updated 数据的更新时间,诸如 outdatedServer 等服务,
// 会定时更新数据,Updated 即记录这些更新的时间。
Updated time.Time
// Etag 表示 根据 Updated 生成的 etag 字符串
Etag string
SiteName string
Subtitle string
Beian string // 备案号
Uptime time.Time // 上线时间
PageSize int // 每页显示的数量
Type string // 页面的 mime type 类型
Icon *Icon // 程序默认的图标
Menus []*Link // 导航菜单
Author *Author // 默认作者信息
License *Link // 默认版权信息
Pages map[string]*Page // 各个页面的自定义内容
LanguageTag language.Tag
Tags []*Tag
Series []*Tag
Links []*Link
Posts []*Post
Archives []*Archive
Theme *Theme // 当前主题
Opensearch *Feed
Sitemap *Feed
RSS *Feed
Atom *Feed
Manifest *Feed
ServiceWorker []byte // service worker 的内容
ServiceWorkerPath string // service worker 的 URL
Matcher *search.Matcher
// contains filtered or unexported fields
}
Data 结构体包含了数据目录下所有需要加载的数据内容。
func (*Data) ExecuteTemplate ¶
ExecuteTemplate 渲染指定的模块并输出到 w
type Feed ¶
type Feed struct {
Title string // 标题,一般出现在 html>head>link.title 属性中
URL string // 地址,不能包含域名
Type string // mime type
Content []byte // 实际的内容
}
Feed RSS、Atom、Sitemap 和 Opensearch 的配置内容
type Manifest ¶
type Manifest struct {
Lang string `json:"lang"`
Name string `json:"name"`
ShortName string `json:"short_name"`
StartURL string `json:"start_url,omitempty"`
Display string `json:"display,omitempty"`
Description string `json:"description,omitempty"`
Dir string `json:"dir,omitempty"`
Orientation string `json:"orientation,omitempty"`
Scope string `json:"scope,omitempty"`
ThemeColor string `json:"theme_color,omitempty"`
Background string `json:"background_color,omitempty"`
Icons []*icon `json:"icons"`
}
Manifest 表示 PWA 中的 manifest.json 文件
type Post ¶
type Post struct {
Slug string // 唯一名称
Permalink string // 文章的唯一链接,同时当作 created 的原始值
Title string // 标题
HTMLTitle string // 网页标题,同时当作 modified 的原始值
Created time.Time // 创建时间
Modified time.Time // 修改时间
Summary string // 摘要,同时也作为 meta.description 的内容
Content string // 内容,同时也作为 outdated 的内容
Tags []*Tag
Outdated *Outdated
State string
Image string // 封面图片
Keywords string
// 以下内容不存在时,则会使用全局的默认选项
Author *Author
License *Link
Template string
Language string
Assets []string
}
Post 表示文章的信息
Source Files
¶
Click to show internal directories.
Click to hide internal directories.