Documentation
¶
Index ¶
- func CopyBuiltinTheme(name, destDir string) error
- func IsBuiltinTheme(name string) bool
- func ListBuiltinThemes() []string
- func StartProductionServer(cfg ProductionConfig) error
- func StopProductionServer() error
- type Article
- type ArticleParser
- type Author
- type Blog
- type Config
- type Highlight
- type Highlighter
- type PageData
- type ProductionConfig
- type Renderer
- type SEO
- type SEOConfig
- type ThemeInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyBuiltinTheme ¶
func IsBuiltinTheme ¶
func ListBuiltinThemes ¶
func ListBuiltinThemes() []string
func StartProductionServer ¶ added in v0.8.0
func StartProductionServer(cfg ProductionConfig) error
func StopProductionServer ¶ added in v0.8.0
func StopProductionServer() error
Types ¶
type Article ¶
type Article struct {
Title string `json:"title"`
Slug string `json:"slug"`
Published time.Time `json:"published"`
Author string `json:"author"`
Tags []string `json:"tags"`
SEODescription string `json:"seo_description"`
OGImage string `json:"og_image"`
AuthorTwitter string `json:"author_twitter"`
Body template.HTML `json:"body"`
Overview template.HTML `json:"overview"`
Data map[string]string `json:"data"`
ReadingTime int `json:"reading_time"`
File string `json:"file"`
Dir string `json:"dir"`
}
func (Article) FormattedDate ¶
func (Article) IsPublished ¶
type ArticleParser ¶
type ArticleParser struct {
// contains filtered or unexported fields
}
func NewArticleParser ¶
func NewArticleParser(fsys fs.FS, highlighter *Highlighter, baseURL string) *ArticleParser
func (*ArticleParser) ParseArticle ¶
type Blog ¶
type Blog struct {
Config Config
Articles []Article
Highlighter *Highlighter
// contains filtered or unexported fields
}
type Config ¶
type Config struct {
Title string `yaml:"title"`
Description string `yaml:"description"`
BaseURL string `yaml:"baseURL"`
Author Author `yaml:"author"`
Theme string `yaml:"theme"`
Highlight Highlight `yaml:"highlight"`
SEO SEOConfig `yaml:"seo"`
ContentDir string `yaml:"contentDir"`
OutputDir string `yaml:"outputDir"`
ListPages []string `yaml:"listPages"`
}
func DefaultConfig ¶
func DefaultConfig() Config
func LoadConfigFromPath ¶
type Highlighter ¶
type Highlighter struct {
// contains filtered or unexported fields
}
func NewHighlighter ¶
func NewHighlighter(style string, lineNumbers bool) *Highlighter
func (*Highlighter) CSS ¶
func (h *Highlighter) CSS() string
type ProductionConfig ¶ added in v0.8.0
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
func NewRenderer ¶
func (*Renderer) RenderArticle ¶
func (*Renderer) RenderIndex ¶
func (*Renderer) RenderRobots ¶
func (*Renderer) RenderSitemap ¶
type SEO ¶
type SEO struct {
Title string
Description string
URL string
Image string
Type string
Author string
Published string
TwitterCard string
TwitterSite string
}
func (SEO) OpenGraphTags ¶
func (SEO) TwitterCardTags ¶
type ThemeInfo ¶
type ThemeInfo struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
Author string `yaml:"author"`
Version string `yaml:"version"`
Repository string `yaml:"repository"`
Preview string `yaml:"preview"`
Path string `yaml:"-"`
IsBuiltin bool `yaml:"-"`
}
func LoadThemeInfo ¶
Click to show internal directories.
Click to hide internal directories.