frontmatter

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2017 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileHasFrontMatter

func FileHasFrontMatter(filename string) (bool, error)

FileHasFrontMatter returns a bool indicating whether the file looks like it has frontmatter.

func Read

func Read(sourcePtr *[]byte, firstLine *int) (frontMatter templates.VariableMap, err error)

Read reads the frontmatter from a document. It modifies srcPtr to point to the content after the frontmatter, and sets firstLine to its 1-indexed line number.

Types

type FrontMatter

type FrontMatter map[string]interface{}

FrontMatter wraps a map to provide interface functions

func (FrontMatter) SortedStringArray

func (fm FrontMatter) SortedStringArray(key string) []string

SortedStringArray returns a sorts list of strings from a frontmatter variable that is either a string (in which case it is a ws-separated list of words), or a list of strings.

This is the format for page categories and tags.

Jump to

Keyboard shortcuts

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