file

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoMetadataFound = errors.New("No metadata found!")

Functions

func CategoryFromPath

func CategoryFromPath(path string) string

func HTML

func HTML(content string) template.HTML

func IsMarkdown

func IsMarkdown(path string) bool

func IsPage

func IsPage(path string) bool

Types

type ParsedFile

type ParsedFile struct {
	Author  string
	Title   string
	Slug    string
	Content template.HTML
	Summary template.HTML

	IsPage   bool
	Category string
	Tags     []string
	Date     time.Time
	// contains filtered or unexported fields
}

ParsedFile holds the struct of a file after we parsed the metadata and its content.

func New

func New(path string) (*ParsedFile, error)

New return a new ParsedFile after load it from disk.

func (ParsedFile) IsPublished

func (f ParsedFile) IsPublished() bool

IsPublished will return true if the status is not draft TODO: I wonder if `draft: true` could be a better way of doing this.

Jump to

Keyboard shortcuts

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