content

package
v0.0.0-...-36c91e0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CollectTags

func CollectTags(posts []*Page) map[string][]*Page

func PageToMap

func PageToMap(p *Page, dateFormat string) map[string]any

Types

type BannerFrontmatter

type BannerFrontmatter struct {
	Text      string   `yaml:"text"`
	Font      string   `yaml:"font"`
	Colors    []string `yaml:"colors"`
	ColorType string   `yaml:"color_type"`
}

type Frontmatter

type Frontmatter struct {
	Title       string             `yaml:"title"`
	Date        time.Time          `yaml:"date"`
	Tags        []string           `yaml:"tags"`
	Draft       bool               `yaml:"draft"`
	Description string             `yaml:"description"`
	Slug        string             `yaml:"slug"`
	Template    string             `yaml:"template"`
	Banner      *BannerFrontmatter `yaml:"banner"`
}

type Page

type Page struct {
	Frontmatter Frontmatter
	RawContent  string
	HTMLContent template.HTML
	BannerHTML  template.HTML
	FilePath    string
	URL         string
	ReadingTime int
}

func LoadBlogPosts

func LoadBlogPosts(blogDir string, renderer *markdown.Renderer, includeDrafts bool, postsDir string) ([]*Page, error)

func LoadPage

func LoadPage(filePath string, renderer *markdown.Renderer) (*Page, error)

func LoadPages

func LoadPages(contentDir string, renderer *markdown.Renderer, blogDir string) ([]*Page, error)

Jump to

Keyboard shortcuts

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