parser

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ColorSchemes = map[string]ColorPalette{
	"gruvbox": {
		Light: `--bg-color: #fbf1c7; --bg-secondary: #ebdbb2; --text-main: #3c3836; --text-muted: #7c6f64; --accent: #af3a03; --border: #d5c4a1; --code-bg: #f2e5bc;`,
		Dark:  `--bg-color: #282828; --bg-secondary: #3c3836; --text-main: #ebdbb2; --text-muted: #a89984; --accent: #fe8019; --border: #504945; --code-bg: #1d2021;`,
	},
	"tokyonight": {
		Light: `--bg-color: #e1e2e7; --bg-secondary: #c4c8da; --text-main: #3760bf; --text-muted: #848cb5; --accent: #2e7de9; --border: #a8b5d1; --code-bg: #d0d5e3;`,
		Dark:  `--bg-color: #1a1b26; --bg-secondary: #24283b; --text-main: #c0caf5; --text-muted: #565f89; --accent: #7aa2f7; --border: #414868; --code-bg: #15161e;`,
	},
	"default": {
		Light: `--bg-color: #f4edd8; --bg-secondary: #fdfaf3; --text-main: #3b2f2f; --text-muted: #796e65; --accent: #8b5a2b; --border: #d5c4a1; --code-bg: #eae3d0;`,
		Dark:  `--bg-color: #1e1915; --bg-secondary: #2c2421; --text-main: #e6dfcc; --text-muted: #9b8c7d; --accent: #d3864b; --border: #4a3d34; --code-bg: #15110e;`,
	},
	"dracula": {
		Light: `--bg-color: #f8f8f2; --bg-secondary: #e9e9f4; --text-main: #282a36; --text-muted: #6272a4; --accent: #8b48f5; --border: #d7d7eb; --code-bg: #f0f0f8;`,
		Dark:  `--bg-color: #282a36; --bg-secondary: #44475a; --text-main: #f8f8f2; --text-muted: #6272a4; --accent: #bd93f9; --border: #44475a; --code-bg: #21222c;`,
	}}

Functions

func MakeIndex

func MakeIndex(posts []PostInfo, tmpl *template.Template, cfg *config.Config) error

func MakeRSS

func MakeRSS(posts []PostInfo, tmpl *textTmpl.Template, cfg *config.Config) error

func MakeRobotsTxt added in v1.2.1

func MakeRobotsTxt(cfg *config.Config) error

func MakeSearchIndex added in v1.2.0

func MakeSearchIndex(posts []PostInfo, cfg *config.Config) error

func MakeSitemap added in v1.2.1

func MakeSitemap(posts []PostInfo, cfg *config.Config) error

Types

type ColorPalette added in v1.2.0

type ColorPalette struct {
	Light string
	Dark  string
}

type Frontmatter

type Frontmatter struct {
	Title   string   `yaml:"title" json:"title"`
	Date    YamlDate `yaml:"date" json:"date"`
	Author  string   `yaml:"author" json:"author"`
	Draft   bool     `yaml:"draft" json:"-"`
	Summary string   `yaml:"summary" json:"summary"`
}

type IndexData

type IndexData struct {
	Posts           []PostInfo
	Config          *config.Config
	BlogUrl         string
	FeedTitle       string
	FeedDescription string
	FeedLanguage    string
	SchemeCSS       template.CSS
}

type PageData

type PageData struct {
	Meta      Frontmatter
	Content   template.HTML
	Config    *config.Config
	URL       string
	SchemeCSS template.CSS
}

type PostInfo

type PostInfo struct {
	Meta Frontmatter `json:",inline"`
	URL  string      `json:"url"`
}

func ProcessFile

func ProcessFile(filename string, tmpl *template.Template, cfg *config.Config) (PostInfo, error)

type SearchData added in v1.2.0

type SearchData struct {
	Posts []PostInfo `json:"posts"`
}

type YamlDate

type YamlDate struct {
	time.Time
}

func (*YamlDate) UnmarshalYAML

func (d *YamlDate) UnmarshalYAML(value *yaml.Node) error

Jump to

Keyboard shortcuts

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