hugocontent

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: MIT Imports: 6 Imported by: 1

README

simple-hugo-content-parse

go codecov go-report

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrFileContentMismatch on specified filepath
	ErrFileContentMismatch = failure.StringCode("file content mismatch")
)

Functions

This section is empty.

Types

type FrontMatter

type FrontMatter map[string]interface{}

FrontMatter is metadata for MarkdownContent

func (FrontMatter) GetInt

func (f FrontMatter) GetInt(fieldname string) int

func (FrontMatter) GetString

func (f FrontMatter) GetString(fieldname string) string

func (FrontMatter) GetStrings

func (f FrontMatter) GetStrings(fieldname string) []string

type MarkdownContent

type MarkdownContent struct {
	// FrontMatter is metadata for this content
	FrontMatter FrontMatter
	// Body for this content
	Body string
}

MarkdownContent for hugo https://gohugo.io/content-management/formats/

func ParseMarkdownWithYaml

func ParseMarkdownWithYaml(r io.Reader) (*MarkdownContent, error)

ParseMarkdownWithYaml from any reader to make MarkdownContent struct

func (*MarkdownContent) Dump

func (m *MarkdownContent) Dump() (string, error)

Dump to string from this content

Jump to

Keyboard shortcuts

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