entry

package
v3.0.1-0...-781ade8 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2022 License: MIT Imports: 18 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) Audience

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

func (*Entry) DisplayDescription

func (e *Entry) DisplayDescription() string

func (*Entry) DisplayTitle

func (e *Entry) DisplayTitle() string

func (*Entry) Excerpt

func (e *Entry) Excerpt() string

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) Tags

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

func (*Entry) TextContent

func (e *Entry) TextContent() string

func (*Entry) Update

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

func (*Entry) Visibility

func (e *Entry) Visibility() Visibility

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"`
	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"`
	IsListing          bool                   `yaml:"isListing,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)

type Read

type Read struct {
	ID     string    `json:"id"`
	Date   time.Time `json:"date"`
	Name   string    `json:"name"`
	Author string    `json:"author"`
}

type ReadList

type ReadList []*Read

func (ReadList) ByYear

func (rd ReadList) ByYear() *ReadsByYear

func (ReadList) SortByName

func (rd ReadList) SortByName()

type ReadsByYear

type ReadsByYear struct {
	Years []int
	Map   map[int]ReadList
}

type ReadsSummary

type ReadsSummary struct {
	ToRead   ReadList    `json:"to-read"`
	Reading  ReadList    `json:"reading"`
	Finished ReadsByYear `json:"finished"`
}

type Visibility

type Visibility string
const (
	VisibilityPrivate  Visibility = "private"
	VisibilityUnlisted Visibility = "unlisted"
	VisibilityPublic   Visibility = "public"
)

type Watch

type Watch struct {
	ID   string    `json:"id"`
	Date time.Time `json:"date"`
	Name string    `json:"name"`
}

type WatchesSummary

type WatchesSummary struct {
	Series []*Watch `json:"series"`
	Movies []*Watch `json:"movies"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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