post

package
v0.0.0-...-069cfaf Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2021 License: Unlicense Imports: 4 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 {
	ID             string `schema:"id,required"`
	Title          string
	Content        string
	ContentPreview string
	CustomFields   map[string]interface{}
	Slug           string
	IsDraft        bool
	Published      bool
	ItemType       string
	Template       string
	CreatedAt      time.Time
	UpdatedAt      time.Time
}

Post contains articles and pages used by the CMS

func (*Post) GetContentPreview

func (p *Post) GetContentPreview(max int) string

GetContentPreview strips markdown from the content string, trims and returns it

func (*Post) GetHTMLContent

func (p *Post) GetHTMLContent() template.HTML

GetHTMLContent returns the post's markdown content as HTML

Jump to

Keyboard shortcuts

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