entry

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewID

func NewID(slug string, t time.Time) string

func NewSlug

func NewSlug() string

Types

type Entry

type Entry struct {
	Frontmatter
	ID        string
	Permalink string
	Content   string
	// contains filtered or unexported fields
}

func (*Entry) FlatMF2

func (e *Entry) FlatMF2() map[string]interface{}

func (*Entry) Helper

func (e *Entry) Helper() *mf2.FlatHelper

func (*Entry) InSection

func (e *Entry) InSection(section string) bool

func (*Entry) MF2

func (e *Entry) MF2() map[string]interface{}

func (*Entry) String

func (e *Entry) String() (string, error)

func (*Entry) Summary

func (e *Entry) Summary() string

func (*Entry) Tags

func (e *Entry) Tags() []string

func (*Entry) TextContent

func (e *Entry) TextContent() string

func (*Entry) Update

func (e *Entry) Update(mf2Data map[string][]interface{}) error

type Frontmatter

type Frontmatter struct {
	Title              string                 `yaml:"title,omitempty"`
	Description        string                 `yaml:"description,omitempty"`
	Draft              bool                   `yaml:"draft,omitempty"`
	Deleted            bool                   `yaml:"deleted,omitempty"`
	Private            bool                   `yaml:"private,omitempty"`
	Published          time.Time              `yaml:"published,omitempty"`
	Updated            time.Time              `yaml:"updated,omitempty"`
	Sections           []string               `yaml:"section,omitempty"`
	Template           string                 `yaml:"template,omitempty"`
	CreatedWith        string                 `yaml:"createdWith,omitempty"`
	NoShowInteractions bool                   `yaml:"noShowInteractions,omitempty"`
	NoSendInteractions bool                   `yaml:"noSendInteractions,omitempty"`
	PhotoClass         string                 `yaml:"photoClass,omitempty"`
	Properties         map[string]interface{} `yaml:"properties,omitempty"` // "Flat" MF2 Properties.
}

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

func NewParser

func NewParser(baseURL string) *Parser

func (*Parser) FromMF2

func (p *Parser) FromMF2(mf2Data map[string][]interface{}, slug string) (*Entry, error)

func (*Parser) FromRaw

func (p *Parser) FromRaw(id, raw string) (*Entry, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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