Documentation ¶
Index ¶
- func SaveFile(config *Config, path string)
- type AuthConfig
- type BasicAuthConfig
- type CommentChanifyPushConfig
- type CommentConfig
- type CommentPushConfig
- type CommentTemplatesConfig
- type Config
- type DataConfig
- type DatabaseConfig
- type DatabaseSQLiteConfig
- type FileDataConfig
- type GithubAuthConfig
- type GoogleAuthConfig
- type MailerServerConfig
- type MaintenanceConfig
- type MenuItem
- type RSSConfig
- type SearchConfig
- type Segment
- type ServerConfig
- type SiteConfig
- type SitemapConfig
- type ThemeConfig
- type ThemeStylesheetsConfig
- type Updater
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthConfig ¶
type AuthConfig struct { Key string `yaml:"key"` Basic BasicAuthConfig `yaml:"basic"` Github GithubAuthConfig `yaml:"github"` Google GoogleAuthConfig `yaml:"google"` AdminName string AdminEmails []string }
AuthConfig ...
type BasicAuthConfig ¶
BasicAuthConfig ...
func DefaultBasicBasicAuthConfig ¶
func DefaultBasicBasicAuthConfig() BasicAuthConfig
DefaultBasicBasicAuthConfig ...
type CommentChanifyPushConfig ¶
type CommentChanifyPushConfig struct {
Token string `yaml:"token"`
}
CommentChanifyPushConfig ...
func DefaultCommentChanifyPushConfig ¶
func DefaultCommentChanifyPushConfig() CommentChanifyPushConfig
DefaultCommentChanifyPushConfig ...
type CommentConfig ¶
type CommentConfig struct { Author string `yaml:"author"` Emails []string `yaml:"emails"` Notify bool `yaml:"notify"` NotAllowedEmails []string `yaml:"not_allowed_emails"` NotAllowedAuthors []string `yaml:"not_allowed_authors"` Templates CommentTemplatesConfig `yaml:"templates"` Push CommentPushConfig `yaml:"push"` }
CommentConfig ...
type CommentPushConfig ¶
type CommentPushConfig struct {
Chanify CommentChanifyPushConfig `yaml:"chanify"`
}
CommentPushConfig ...
func DefaultCommentPushConfig ¶
func DefaultCommentPushConfig() CommentPushConfig
DefaultCommentPushConfig ...
type CommentTemplatesConfig ¶
CommentTemplatesConfig ...
func DefaultCommentTemplatesConfig ¶
func DefaultCommentTemplatesConfig() CommentTemplatesConfig
DefaultCommentTemplatesConfig ...
type Config ¶
type Config struct { Database DatabaseConfig `yaml:"database"` Server ServerConfig `yaml:"server"` Data DataConfig `yaml:"data"` Maintenance MaintenanceConfig `yaml:"maintenance"` Auth AuthConfig `yaml:"auth"` Menus []MenuItem `yaml:"menus"` Site SiteConfig `yaml:"site"` Comment CommentConfig `yaml:"comment"` Search search_config.Config `yaml:"search"` // contains filtered or unexported fields }
Config ...
type DatabaseConfig ¶
type DatabaseConfig struct { // 只支持 sqlite3 Engine string `yaml:"engine"` SQLite DatabaseSQLiteConfig `yaml:"sqlite"` }
DatabaseConfig ...
type DatabaseSQLiteConfig ¶
type DatabaseSQLiteConfig struct { // 数据库文件路径。 // 如果不指定,使用内存数据库。 Path string `yaml:"path"` }
DatabaseSQLiteConfig ...
func DefaultDatabaseSQLiteConfig ¶
func DefaultDatabaseSQLiteConfig() DatabaseSQLiteConfig
DefaultDatabaseSQLiteConfig ...
type GithubAuthConfig ¶
type GithubAuthConfig struct { ClientID string `yaml:"client_id"` ClientSecret string `yaml:"client_secret"` UserID int64 `yaml:"user_id"` }
GithubAuthConfig ...
func DefaultGithubAuthConfig ¶
func DefaultGithubAuthConfig() GithubAuthConfig
DefaultGithubAuthConfig ...
type GoogleAuthConfig ¶
GoogleAuthConfig ...
func DefaultGoogleAuthConfig ¶
func DefaultGoogleAuthConfig() GoogleAuthConfig
DefaultGoogleAuthConfig ...
type MailerServerConfig ¶
type MailerServerConfig struct { Server string `yaml:"server"` Account string `yaml:"account"` Password string `yaml:"password"` }
MailerServerConfig ...
func DefaultMaiMailerServerConfig ¶
func DefaultMaiMailerServerConfig() MailerServerConfig
DefaultMaiMailerServerConfig ...
type MaintenanceConfig ¶
type MaintenanceConfig struct { DisableAdmin bool `yaml:"disable_admin"` Webhook struct { ReloaderPath string `yaml:"reloader_path"` GitHub struct { Secret string `yaml:"secret"` } `yaml:"github"` } `yaml:"webhook"` }
MaintenanceConfig ...
func DefaultMainMaintenanceConfig ¶
func DefaultMainMaintenanceConfig() MaintenanceConfig
DefaultMainMaintenanceConfig ...
type MenuItem ¶
type MenuItem struct { Name string `yaml:"name"` Link string `yaml:"link"` Blank bool `yaml:"blank"` Items []MenuItem `yaml:"items"` }
MenuItem ...
type ServerConfig ¶
type ServerConfig struct { HTTPListen string `yaml:"http_listen"` GRPCListen string `yaml:"grpc_listen"` Mailer MailerServerConfig `yaml:"mailer"` }
ServerConfig ...
type SiteConfig ¶
type SiteConfig struct { Home string `yaml:"home"` Name string `yaml:"name"` Description string `yaml:"description"` Since _Since `yaml:"since,omitempty"` ShowDescription bool `yaml:"show_description"` ShowStatus bool `yaml:"show_status"` ShowRelatedPosts bool `yaml:"show_related_posts"` Search SearchConfig `yaml:"search"` RSS RSSConfig `yaml:"rss"` Sitemap SitemapConfig `yaml:"sitemap"` // 尽管站点字体应该由各主题提供,但是为了能跨主题共享字体(减少配置麻烦), // 所以我就在这里定义了针对所有站点适用的自定义样式表(或主题)集合。 Theme ThemeConfig `yaml:"theme"` }
SiteConfig ...
type ThemeConfig ¶
type ThemeConfig struct {
Stylesheets ThemeStylesheetsConfig `yaml:"stylesheets"`
}
func DefaultThemeConfig ¶
func DefaultThemeConfig() ThemeConfig
type ThemeStylesheetsConfig ¶
type ThemeStylesheetsConfig struct { Template string `yaml:"template"` Stylesheets []struct { Source string `yaml:"source"` } `yaml:"stylesheets"` }
func DefaultThemeStylesheetsConfig ¶
func DefaultThemeStylesheetsConfig() ThemeStylesheetsConfig
func (*ThemeStylesheetsConfig) Render ¶
func (c *ThemeStylesheetsConfig) Render() string
Click to show internal directories.
Click to hide internal directories.