page

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterExpr added in v0.1.2

func FilterExpr(filter string) func(*Page) bool

func Paginator

func Paginator(list []interface{}, number int, path string, paginatePath string) []*paginator

func Register

func Register(ext string, c creator)

Types

type Builder

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

func NewBuilder

func NewBuilder(conf config.Config, theme theme.Theme, hooks Hooks) *Builder

func (*Builder) Build

func (b *Builder) Build(ctx context.Context) error

func (*Builder) Write

func (b *Builder) Write() error

type Context added in v0.1.1

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

func (*Context) HiddenPages added in v0.1.1

func (ctx *Context) HiddenPages() Pages

func (*Context) Pages added in v0.1.1

func (ctx *Context) Pages() Pages

func (*Context) SectionPages added in v0.1.1

func (ctx *Context) SectionPages() Pages

func (*Context) Sections added in v0.1.1

func (ctx *Context) Sections() Sections

func (*Context) Taxonomies added in v0.1.1

func (ctx *Context) Taxonomies() Taxonomies

type Format added in v0.1.2

type Format struct {
	Name      string
	Path      string
	Template  string
	Permalink string
}

type Formats added in v0.1.2

type Formats []*Format

func (Formats) Find added in v0.1.2

func (fs Formats) Find(name string) *Format

type Hook

type Hook interface {
	Page(*Page) *Page
	Section(*Section) *Section

	Pages(Pages) Pages
	Sections(Sections) Sections
	Taxonomies(Taxonomies) Taxonomies
	TaxonomyTerms(TaxonomyTerms) TaxonomyTerms
}

type Hooks

type Hooks []Hook

func (Hooks) Page added in v0.1.2

func (hooks Hooks) Page(page *Page) *Page

func (Hooks) Pages added in v0.1.2

func (hooks Hooks) Pages(pages Pages) Pages

func (Hooks) Section added in v0.1.2

func (hooks Hooks) Section(section *Section) *Section

func (Hooks) Sections added in v0.1.2

func (hooks Hooks) Sections(sections Sections) Sections

func (Hooks) Taxonomies added in v0.1.2

func (hooks Hooks) Taxonomies(taxonomies Taxonomies) Taxonomies

func (Hooks) TaxonomyTerms added in v0.1.2

func (hooks Hooks) TaxonomyTerms(terms TaxonomyTerms) TaxonomyTerms

type Meta

type Meta map[string]interface{}

func (Meta) Get

func (m Meta) Get(k string) interface{}

func (Meta) GetBool

func (m Meta) GetBool(k string) bool

func (Meta) GetInt

func (m Meta) GetInt(k string) int

func (Meta) GetSlice

func (m Meta) GetSlice(k string) []string

func (Meta) GetString

func (m Meta) GetString(k string) string

func (Meta) GetStringMap

func (m Meta) GetStringMap(k string) map[string]interface{}

func (Meta) Set

func (m Meta) Set(k, v string)

type Page

type Page struct {
	File     string
	Meta     Meta
	Lang     string
	Date     time.Time
	Modified time.Time

	Slug      string
	Path      string
	Permalink string
	Aliases   []string
	Assets    []string

	Title   string
	Summary string
	Content string

	Prev          *Page
	Next          *Page
	PrevInSection *Page
	NextInSection *Page

	Formats Formats
	Section *Section
}

func (*Page) Get

func (page *Page) Get(k string) interface{}

func (*Page) HasNext

func (page *Page) HasNext() bool

func (*Page) HasPrev

func (page *Page) HasPrev() bool

type Pages

type Pages []*Page

func (Pages) Filter

func (pages Pages) Filter(filter string) Pages

func (Pages) First

func (pages Pages) First() *Page

func (Pages) GroupBy

func (pages Pages) GroupBy(key string) TaxonomyTerms

func (Pages) Last

func (pages Pages) Last() *Page

func (Pages) OrderBy

func (pages Pages) OrderBy(key string) Pages

func (Pages) Paginator

func (pages Pages) Paginator(number int, path string, paginatePath string) []*paginator

type Reader

type Reader interface {
	Read(io.Reader) (Meta, error)
}

type Section

type Section struct {
	Meta         Meta
	Lang         string
	File         string
	Path         string
	Permalink    string
	Slug         string
	Title        string
	Content      string
	Pages        Pages
	HiddenPages  Pages
	SectionPages Pages
	Assets       []string
	Formats      Formats
	Parent       *Section
	Children     Sections
}

func (*Section) FirstName

func (sec *Section) FirstName() string

func (*Section) Paginator

func (sec *Section) Paginator() []*paginator

func (*Section) RealName added in v0.1.2

func (sec *Section) RealName() string

func (*Section) Root

func (sec *Section) Root() *Section

type Sections

type Sections []*Section

func (Sections) OrderBy added in v0.1.2

func (secs Sections) OrderBy(key string) Sections

type Taxonomies

type Taxonomies []*Taxonomy

func (Taxonomies) OrderBy added in v0.1.2

func (ts Taxonomies) OrderBy(key string) Taxonomies

type Taxonomy

type Taxonomy struct {
	// slug:
	// weight:
	// path:
	// template:
	// orderby:
	Meta      Meta
	Name      string
	Lang      string
	Path      string
	Permalink string
	Terms     TaxonomyTerms
}

type TaxonomyTerm

type TaxonomyTerm struct {
	// term_path: /{taxonomy}/{slug}/index.html
	// term_template:
	// term_filter:
	// term_orderby:
	// term_paginate:
	// term_paginate_path: {name}{number}{extension}
	// feed_path:
	// feed_template:
	Meta      Meta
	Name      string
	Slug      string
	Path      string
	Permalink string

	List     Pages
	Parent   *TaxonomyTerm
	Children TaxonomyTerms

	Formats  Formats
	Taxonomy *Taxonomy
}

func (*TaxonomyTerm) Paginator

func (term *TaxonomyTerm) Paginator() []*paginator

func (*TaxonomyTerm) RealName added in v0.1.2

func (term *TaxonomyTerm) RealName() string

type TaxonomyTerms

type TaxonomyTerms []*TaxonomyTerm

func (TaxonomyTerms) Find

func (terms TaxonomyTerms) Find(name string) *TaxonomyTerm

func (TaxonomyTerms) Has

func (terms TaxonomyTerms) Has(name string) bool

func (TaxonomyTerms) OrderBy

func (terms TaxonomyTerms) OrderBy(key string) TaxonomyTerms

func (TaxonomyTerms) Paginator

func (terms TaxonomyTerms) Paginator(number int, path string, paginatePath string) []*paginator

Directories

Path Synopsis
markup

Jump to

Keyboard shortcuts

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