template

package
v0.0.0-...-faaa73c Latest Latest
Warning

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

Go to latest
Published: May 10, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EstimateReadingTime

func EstimateReadingTime(text string) string

func GetAuthorById

func GetAuthorById(authors []models.Author, id string) (models.Author, error)

func GetNextPost

func GetNextPost() models.Post

func GetPostById

func GetPostById(posts []models.Post, id string) (models.Post, error)

func GetPreviousPost

func GetPreviousPost() models.Post

func GetTagById

func GetTagById(tags []models.Tag, id string) (models.Tag, error)

func Unescape

func Unescape(text string) template.HTML

Types

type Template

type Template struct {
	Name     string
	Input    string
	Output   string
	Partials []string
	Data     []TemplateData
}

func NewFromMapping

func NewFromMapping(mapping *config.Mapping, data ...TemplateData) *Template

func (*Template) Save

func (t *Template) Save(basePath string) error

type TemplateData

type TemplateData struct {
	Name string
	Data any
}

Jump to

Keyboard shortcuts

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