blog

package
v0.0.0-...-ff631b2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2023 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PostDateFormat = "2006-01-02"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Author

type Author struct {
	Name  string `yaml:"name"`
	Email string `yaml:"email"`
	About string `yaml:"about"`
}

type Blog

type Blog struct {
	// contains filtered or unexported fields
}

func New

func New(config Config, dir string, logger *log.Logger) (*Blog, error)

func (*Blog) Generate

func (b *Blog) Generate(dir string) error

type Config

type Config struct {
	ExcludeDrafts bool
	VersionInfo   string
	Title         string   `yaml:"title"`
	Description   string   `yaml:"description"`
	URL           string   `yaml:"url"`
	PageSize      int      `yaml:"page_size"`
	Features      []string `yaml:"features"`
	Files         []string `yaml:"files"`
	Author        Author   `yaml:"author"`
	License       License  `yaml:"license"`
}

type IndexInfo

type IndexInfo struct {
	*PageInfo
	Posts      []*Post
	Page       int
	TotalPages int
}

type License

type License struct {
	Name string `yaml:"name"`
	URL  string `yaml:"url"`
	Year int    `yaml:"year"`
}
type Link struct {
	URL         string `yaml:"url"`
	Text        string `yaml:"text"`
	Description string `yaml:"description"`
	Icon        string `yaml:"icon"`
}

type PageInfo

type PageInfo struct {
	PageName string
	Blog     *Config
}

type Post

type Post struct {
	Name        string
	Filename    string
	Title       string   `yaml:"title"`
	Date        PostDate `yaml:"date"`
	Draft       bool     `yaml:"draft"`
	TOC         template.HTML
	Content     template.HTML
	Summary     template.HTML
	SummaryText string
}

type PostDate

type PostDate time.Time

func (PostDate) Format

func (d PostDate) Format(layout string) string

func (PostDate) MarshalText

func (d PostDate) MarshalText() ([]byte, error)

func (PostDate) RFC3339

func (d PostDate) RFC3339() string

func (*PostDate) UnmarshalText

func (d *PostDate) UnmarshalText(data []byte) error

func (PostDate) Year

func (d PostDate) Year() int

type PostInfo

type PostInfo struct {
	*PageInfo
	Post *Post
}

type Social

type Social struct {
	URL  string `yaml:"url"`
	Text string `yaml:"text"`
	Icon string `yaml:"icon"`
}

type Style

type Style struct {
	Syntax *Syntax `yaml:"syntax"`
	Input  string  `yaml:"input"`
	Output string  `yaml:"output"`
}

type Syntax

type Syntax struct {
	Default  string         `yaml:"default"`
	Styles   []*SyntaxStyle `yaml:"styles"`
	Numbered bool           `yaml:"numbered"`
}

type SyntaxStyle

type SyntaxStyle struct {
	Name   string `yaml:"name"`
	Scheme string `yaml:"scheme"`
}

type Theme

type Theme struct {
	Name   string   `yaml:"name"`
	Static []string `yaml:"static"`
	Style  Style    `yaml:"style"`
	// contains filtered or unexported fields
}

func (*Theme) Generate

func (t *Theme) Generate(dir string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL