blog

package
v0.0.0-...-b520a96 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(posts []Post) server

Types

type Post

type Post struct {
	Title, Description, Body string
	Tags                     []string
}

Post is a representation of a post

func (Post) SanitizeTitle

func (p Post) SanitizeTitle() string

SanitiseTitle returns the title of the post with spaces replaced by dashes for pleasant URLs

type PostRenderer

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

func NewPostRenderer

func NewPostRenderer() (*PostRenderer, error)

func (*PostRenderer) Render

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

func (*PostRenderer) RenderIndex

func (r *PostRenderer) RenderIndex(w io.Writer, posts []Post) error

Jump to

Keyboard shortcuts

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