Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Content ¶
type Content struct { Title *string `yaml:"title"` Summary *string `yaml:"summary"` Path *string Published *bool `yaml:"published"` PublishDate *string `yaml:"date"` Tags *string `yaml:"tags"` Body []byte }
func GetAll ¶
Get all content from a directory in env.CONTENT_DIR. If no sub-directories are given will get all content in env.CONTENT_DIR.
@params
nil - get all content from env.CONTENT_DIR and its sub-directories subDirs []string - sub-directories in env.CONTENT_DIR to get content from
@return
[]Content - Content objects for each file in subdirs error - problem reading directory, returns all entries it could read up until error
func NewPage ¶
Parse a pages markdown file as a Content object. Markdown is transpiled to HTML and stored as []byte.
@params
path string - path to the content file to parse, relative to env.CONTENT_DIR
@return
*Content - on successful parsing of Content error - if file cannot be found or metadata cannot be parsed
func NewPost ¶
Parse a posts markdown file as a Content object. Markdown is transpiled to HTML and stored as []byte.
@params
path string - path to the content file to parse, relative to env.CONTENT_DIR
@return
*Content - on successful parsing of Content error - if file cannot be found or metadata cannot be parsed
Click to show internal directories.
Click to hide internal directories.