Documentation
¶
Index ¶
- func FilterExpr(filter string) func(*Page) bool
- type Asset
- type Assets
- type File
- type Format
- type Formats
- type FrontMatter
- func (fm *FrontMatter) Get(key string, defaults ...any) any
- func (fm *FrontMatter) GetBool(key string, defaults ...bool) bool
- func (fm *FrontMatter) GetInt(key string, defaults ...int) int
- func (fm *FrontMatter) GetInt32(key string, defaults ...int32) int32
- func (fm *FrontMatter) GetInt64(key string, defaults ...int64) int64
- func (fm *FrontMatter) GetString(key string, defaults ...string) string
- func (fm *FrontMatter) GetStringMap(key string, defaults ...map[string]any) map[string]any
- func (fm *FrontMatter) GetStringSlice(key string, defaults ...[]string) []string
- func (fm *FrontMatter) MergeFrom(m map[string]any)
- type Heading
- type Node
- type Page
- type Pages
- func (pages Pages) FilterBy(filter string) Pages
- func (pages Pages) First() *Page
- func (pages Pages) GroupBy(key string) TaxonomyTerms
- func (pages Pages) Last() *Page
- func (pages Pages) OrderBy(key string) Pages
- func (pages Pages) PaginateBy(number int, path string, paginatePath string) []*Paginator[*Page]
- func (pages Pages) Related() *RelatedPages
- func (pages Pages) SortBy(key string)
- type Paginator
- type Processor
- func (d *Processor) IsPage(fullpath string) bool
- func (d *Processor) IsPageBundle(fullpath string) ([]string, bool)
- func (d *Processor) IsSection(fullpath string) ([]string, bool)
- func (d *Processor) ParsePage(fullpath string, isBundle bool) (*Page, error)
- func (d *Processor) ParsePageAssets(fullpath string, page *Page) (Assets, error)
- func (d *Processor) ParsePageFormats(page *Page) Formats
- func (d *Processor) ParseRootSection(fullpath string) (Sections, error)
- func (d *Processor) ParseSection(fullpath string) (*Section, error)
- func (d *Processor) ParseSectionAssets(fullpath string, section *Section) Assets
- func (d *Processor) ParseSectionFormats(section *Section) Formats
- func (d *Processor) ParseTaxonomies(pages Pages, lang string) Taxonomies
- func (d *Processor) ParseTaxonomyTermFormats(term *TaxonomyTerm, lang string) Formats
- func (d *Processor) ParseTaxonomyTerms(taxonomy *Taxonomy, pages Pages, lang string) TaxonomyTerms
- func (d *Processor) RenderPage(page *Page, tplset template.TemplateSet, writer core.Writer) error
- func (d *Processor) RenderSection(section *Section, tplset template.TemplateSet, writer core.Writer) error
- func (d *Processor) RenderTaxonomy(taxonomy *Taxonomy, tplset template.TemplateSet, writer core.Writer) error
- func (d *Processor) RenderTaxonomyTerm(term *TaxonomyTerm, tplset template.TemplateSet, writer core.Writer) error
- func (d *Processor) RenderTemplate(path string, tpl template.Template, vars map[string]any, writer core.Writer) error
- type ProcessorOption
- type RelatedPages
- type Section
- type Sections
- type Taxonomies
- type Taxonomy
- type TaxonomyTerm
- type TaxonomyTerms
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterExpr ¶
Types ¶
type File ¶
type File struct {
Path string // tech/develop/rust/rust-note.fr.md
Dir string // tech/develop/rust
Name string // rust-note.fr.md
BaseName string // rust-note
LanguageName string // fr
Ext string // md
}
func (*File) GetFullPath ¶
func (*File) GetSectionPath ¶
type FrontMatter ¶
func NewFrontMatter ¶
func NewFrontMatter(m map[string]any) *FrontMatter
func (*FrontMatter) Get ¶ added in v0.1.6
func (fm *FrontMatter) Get(key string, defaults ...any) any
func (*FrontMatter) GetBool ¶ added in v0.1.6
func (fm *FrontMatter) GetBool(key string, defaults ...bool) bool
func (*FrontMatter) GetInt ¶ added in v0.1.6
func (fm *FrontMatter) GetInt(key string, defaults ...int) int
func (*FrontMatter) GetInt32 ¶ added in v0.1.6
func (fm *FrontMatter) GetInt32(key string, defaults ...int32) int32
func (*FrontMatter) GetInt64 ¶ added in v0.1.6
func (fm *FrontMatter) GetInt64(key string, defaults ...int64) int64
func (*FrontMatter) GetString ¶ added in v0.1.6
func (fm *FrontMatter) GetString(key string, defaults ...string) string
func (*FrontMatter) GetStringMap ¶ added in v0.1.6
func (*FrontMatter) GetStringSlice ¶ added in v0.1.6
func (fm *FrontMatter) GetStringSlice(key string, defaults ...[]string) []string
func (*FrontMatter) MergeFrom ¶
func (fm *FrontMatter) MergeFrom(m map[string]any)
type Pages ¶
type Pages []*Page
func (Pages) GroupBy ¶
func (pages Pages) GroupBy(key string) TaxonomyTerms
func (Pages) PaginateBy ¶
func (Pages) Related ¶
func (pages Pages) Related() *RelatedPages
type Paginator ¶
type Paginator[T any] struct { Next *Paginator[T] Prev *Paginator[T] Total int PageNum int List []T Path string All []*Paginator[T] }
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
func NewProcessor ¶
func NewProcessor(ctx *core.Context, opts ...ProcessorOption) *Processor
func (*Processor) ParsePageAssets ¶
func (*Processor) ParsePageFormats ¶
func (*Processor) ParseRootSection ¶
func (*Processor) ParseSection ¶
func (*Processor) ParseSectionAssets ¶
func (*Processor) ParseSectionFormats ¶
func (*Processor) ParseTaxonomies ¶
func (d *Processor) ParseTaxonomies(pages Pages, lang string) Taxonomies
func (*Processor) ParseTaxonomyTermFormats ¶
func (d *Processor) ParseTaxonomyTermFormats(term *TaxonomyTerm, lang string) Formats
func (*Processor) ParseTaxonomyTerms ¶
func (d *Processor) ParseTaxonomyTerms(taxonomy *Taxonomy, pages Pages, lang string) TaxonomyTerms
func (*Processor) RenderPage ¶
func (*Processor) RenderSection ¶
func (*Processor) RenderTaxonomy ¶
func (*Processor) RenderTaxonomyTerm ¶
func (d *Processor) RenderTaxonomyTerm(term *TaxonomyTerm, tplset template.TemplateSet, writer core.Writer) error
type ProcessorOption ¶
type ProcessorOption func(*Processor)
func WithParser ¶
func WithParser(p parser.Parser) ProcessorOption
type RelatedPages ¶
type RelatedPages struct {
// contains filtered or unexported fields
}
func (*RelatedPages) Next ¶
func (r *RelatedPages) Next(page *Page) *Page
func (*RelatedPages) Prev ¶
func (r *RelatedPages) Prev(page *Page) *Page
type Taxonomies ¶
type Taxonomies []*Taxonomy
func (Taxonomies) SortBy ¶
func (ts Taxonomies) SortBy(key string)
type TaxonomyTerm ¶
type TaxonomyTerm struct {
Name string
Slug string
Path string
Permalink string
Parent *TaxonomyTerm
Children TaxonomyTerms
Pages Pages
Formats Formats
Taxonomy *Taxonomy
}
func (*TaxonomyTerm) FindChild ¶
func (term *TaxonomyTerm) FindChild(name string) *TaxonomyTerm
func (*TaxonomyTerm) GetFullName ¶
func (term *TaxonomyTerm) GetFullName() string
type TaxonomyTerms ¶
type TaxonomyTerms []*TaxonomyTerm
func (TaxonomyTerms) OrderBy ¶
func (terms TaxonomyTerms) OrderBy(key string) TaxonomyTerms
func (TaxonomyTerms) SortBy ¶
func (terms TaxonomyTerms) SortBy(key string)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.