post

package
v0.0.0-...-e3291e6 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2017 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BPost

type BPost struct {
	Title           string        `json:"title"`
	Description     string        `json:"description"`
	Author          string        `json:"author"`
	UrlPermalink    string        `json:"url"`
	DateCreated     time.Time     `json:"date_created"`
	DateEdited      time.Time     `json:"date_edited"`
	ContentMarkdown string        `json:"content_markdown"`
	ContentHtml     template.HTML `json:"content_html"`
}

func FromJson

func FromJson(b []byte) *BPost

func FromMarkdown

func FromMarkdown(pathname string) (*BPost, error)

FromMarkdown reads a post folder (that follows our special structure) and creates a new post structure with fields filled from the file loaded.

func (*BPost) FormattedCreatedTime

func (p *BPost) FormattedCreatedTime() string

func (*BPost) FormattedCreatedTimeLong

func (p *BPost) FormattedCreatedTimeLong() string

func (*BPost) FormattedEditedTimeLong

func (p *BPost) FormattedEditedTimeLong() string

func (*BPost) HTML5CreatedTime

func (p *BPost) HTML5CreatedTime() string

type ByDate

type ByDate []*BPost

ByDate implements sort.Interface for []BPost based on the DateCreated field.

func (ByDate) Len

func (a ByDate) Len() int

func (ByDate) Less

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

func (ByDate) Swap

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

Jump to

Keyboard shortcuts

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