blog

package
v0.0.0-...-26f551a Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blog

type Blog struct {
	Posts map[string]Post // map of strings to blog posts
	// contains filtered or unexported fields
}

func (*Blog) Add

func (b *Blog) Add(r io.Reader) error

Add post at path to blog

type Handler

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

func ParseFS

func ParseFS(f fs.FS) (*Handler, error)

type Post

type Post struct {
	Author    string    `json:"author"`    // Author of post
	Title     string    `json:"title"`     // Title of blog post
	Path      string    `json:"path"`      // Path
	Tags      []string  `json:"tags"`      // Tags
	Published time.Time `json:"published"` // Time blog should be published
	Written   time.Time `json:"written"`   // Time blog was written
	Body      string
}

func (*Post) Parse

func (p *Post) Parse(r io.Reader) error

func (*Post) Render

func (p *Post) Render(w io.Writer) error

Jump to

Keyboard shortcuts

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