model

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const PostStatusDraft = "draft"
View Source
const PostStatusPublished = "published"

Variables

This section is empty.

Functions

This section is empty.

Types

type ByDate

type ByDate []Post

func (ByDate) Len

func (d ByDate) Len() int

func (ByDate) Less

func (d ByDate) Less(i, j int) bool

func (ByDate) Swap

func (d ByDate) Swap(i, j int)

type FrontMatter

type FrontMatter struct {
	Title         string    `mapstructure:"title"`
	Date          time.Time `mapstructure:"date"`
	Tags          []string  `mapstructure:"tags"`
	Draft         bool      `mapstructure:"draft"`
	Description   string    `mapstructure:"description"`
	FeaturedImage string    `mapsstructure:"featuredImage"`
}

type Post

type Post struct {
	Title         string
	Date          time.Time
	Content       string
	Slug          string
	Type          string
	Tags          []string
	Status        string
	Description   string
	FeaturedImage string
}
func (post *Post) Permalink() string

type Posts

type Posts []Post

func (Posts) FindByTag

func (posts Posts) FindByTag(tag string) Posts

type Tag

type Tag struct {
	Name  string
	Slug  string
	Posts []Post
}

func (*Tag) AddPost

func (tag *Tag) AddPost(post Post) []Post
func (tag *Tag) Permalink() string

type Tags

type Tags []Tag

func (Tags) Find

func (tags Tags) Find(key string) Tag

type TagsByName

type TagsByName []Tag

func (TagsByName) Len

func (tags TagsByName) Len() int

func (TagsByName) Less

func (tags TagsByName) Less(i, j int) bool

func (TagsByName) Swap

func (tags TagsByName) Swap(i, j int)

Jump to

Keyboard shortcuts

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