blogrenderer

package
v0.0.0-...-0be8c72 Latest Latest
Warning

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

Go to latest
Published: May 29, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Post

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

Post is a representation of a post

func (Post) SanitisedTitle

func (p Post) SanitisedTitle() string

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

type PostRenderer

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

PostRenderer renders data into HTML

func NewPostRenderer

func NewPostRenderer() (*PostRenderer, error)

NewPostRenderer creates a new PostRenderer

func (*PostRenderer) Render

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

Render renders post into HTML

func (*PostRenderer) RenderIndex

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

RenderIndex creates an HTML index page given a collection of posts

Jump to

Keyboard shortcuts

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