88 lines
2.7 KiB
Go
88 lines
2.7 KiB
Go
package main
|
|
|
|
import "time"
|
|
|
|
// Config 配置文件
|
|
type Config struct {
|
|
Title string `yaml:"title"` // 网站标题
|
|
SourceVersion string `yaml:"-"` // 资源版本号
|
|
Seo SEO `yaml:"seo"` // seo相关信息
|
|
Person Person `yaml:"person"` // 博主个人信息
|
|
Theme string `yaml:"theme"` // 主题
|
|
Site Site `yaml:"site"` // 站点配置信息
|
|
Now time.Time `yaml:"-"` // 当前时间
|
|
Deploy Deploy `yaml:"deploy"` // 部署配置
|
|
}
|
|
|
|
type Site struct {
|
|
LogoName string `yaml:"logo_name"` // logo名称
|
|
IcpEnable bool `yaml:"icp_enable"` // 是否展示备案信息
|
|
IcpName string `yaml:"icp_name"` // 备案信息
|
|
IcpLink string `yaml:"icp_link"` // 备案链接
|
|
CdnEnable bool `yaml:"cdn_enable"` // 开启cdn
|
|
CdnName string `yaml:"cdn_name"` // cdn名字
|
|
CdnImage string `yaml:"cdn_image"` // cdn图片
|
|
CdnLink string `yaml:"cdn_link"` // cdn链接
|
|
Paginate bool `yaml:"paginate"` // 是否开启分页
|
|
PageSize int64 `yaml:"page_size"` // 每页数
|
|
}
|
|
|
|
type Person struct {
|
|
Author string `yaml:"author"` // 作者
|
|
Summary string `yaml:"summary"` // 首页描述
|
|
Email string `yaml:"email"` // 邮件地址
|
|
GithubName string `yaml:"github_name"` // github名
|
|
WechatQrcode string `yaml:"wechat_qrcode"` // 微信名片二维码
|
|
}
|
|
|
|
type SEO struct {
|
|
Subtitle string `yaml:"subtitle"` // 副标题
|
|
Description string `yaml:"description"` // 描述
|
|
Keywords string `yaml:"keywords"` // 关键字
|
|
}
|
|
|
|
type DeployType string
|
|
|
|
const (
|
|
GitDeploy DeployType = "git"
|
|
UpyunDeploy DeployType = "upyun"
|
|
)
|
|
|
|
type Deploy struct {
|
|
Type DeployType `yaml:"type"`
|
|
UpyunAuth string `yaml:"upyun_auth"`
|
|
}
|
|
|
|
// Post 文章属性
|
|
type Post struct {
|
|
Title string // 文章标题
|
|
FileBasename string // 文件名
|
|
Link string // 链接
|
|
Category string // 分类
|
|
CategoryAlias string // 分类别名
|
|
Tags []string // 标签
|
|
CreatedAt time.Time // 创建时间
|
|
CreatedAtFormat string // 创建时间格式化
|
|
UpdatedAt time.Time // 更新时间
|
|
UpdatedAtFormat string // 更新时间格式化
|
|
MD string // 文章内容
|
|
TOC string // 文章toc
|
|
}
|
|
|
|
// Page 页面属性
|
|
type Page struct {
|
|
Title string // 展示名
|
|
Link string // 链接名
|
|
MD string // 页面内容
|
|
}
|
|
|
|
type Theme struct {
|
|
Name string // 主题名
|
|
BaseLayout []byte // 基本布局
|
|
PostLayout []byte // 文章布局
|
|
PageLayout []byte // 页面布局
|
|
IndexLayout []byte // 首页布局
|
|
ArchiveLayout []byte // 文章归档布局
|
|
TagLayout []byte // 标签归档布局
|
|
}
|