Documentation ¶
Index ¶
- func OpenFileForWriting(fs afero.Fs, filename string) (afero.File, error)
- type Collator
- type Language
- func (l *Language) Collator() *collate.Collator
- func (l *Language) CurrentLanguageIndex() int
- func (l *Language) Lang() string
- func (l *Language) LanguageCode() string
- func (l *Language) LanguageDirection() string
- func (l *Language) LanguageName() string
- func (l *Language) LanguagePrefix() string
- func (l *Language) Languages() []Language
- func (l *Language) Location() *time.Location
- type Navigation
- type Page
- func (p *Page) Content() (any, error)
- func (p *Page) Data() map[string]any
- func (p *Page) Date() time.Time
- func (p *Page) ExpiryDate() time.Time
- func (p *Page) File() contenthub.File
- func (p *Page) GitInfo() valueobject.GitInfo
- func (p *Page) IsAncestor(other any) bool
- func (p *Page) Language() struct{ ... }
- func (p *Page) Lastmod() time.Time
- func (p *Page) OutputFormats() valueobject.OutputFormats
- func (p *Page) Pages() []*Page
- func (p *Page) Params() maps.Params
- func (p *Page) Permalink() string
- func (p *Page) PublishDate() time.Time
- func (p *Page) RelPermalink() string
- func (p *Page) Resources() PageResources
- func (p *Page) Section() string
- func (p *Page) Sites() *sites
- func (p *Page) Title() string
- func (p *Page) Translations() []*Page
- type PageResources
- type Pages
- type Publisher
- type Render
- type Site
- func (s *Site) AbsURL(in string) string
- func (s *Site) Build(t site.Template) error
- func (s *Site) GetPage(ref ...string) (*Page, error)
- func (s *Site) Home() *Page
- func (s *Site) IsMultiLingual() bool
- func (s *Site) Menus() valueobject.Menus
- func (s *Site) Pages() []*Page
- func (s *Site) Params() maps.Params
- func (s *Site) PrepareLazyLoads()
- func (s *Site) RegularPages() []*Page
- func (s *Site) RelURL(in string) string
- func (s *Site) Taxonomies() TaxonomyList
- type Taxonomy
- type TaxonomyList
- type URL
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Collator ¶
func (*Collator) CompareStrings ¶
CompareStrings compares a and b. It returns -1 if a < b, 1 if a > b and 0 if a == b. Note that the Collator is not thread safe, so you may want to acquire a lock on it before calling this method.
type Language ¶
type Language struct { LangSvc site.LanguageService // contains filtered or unexported fields }
func (*Language) CurrentLanguageIndex ¶
func (*Language) LanguageCode ¶
func (*Language) LanguageDirection ¶
func (*Language) LanguageName ¶
func (*Language) LanguagePrefix ¶
type Navigation ¶
type Navigation struct {
// contains filtered or unexported fields
}
type Page ¶
type Page struct { contenthub.Page contenthub.PageOutput *Site // contains filtered or unexported fields }
func (*Page) ExpiryDate ¶
func (*Page) File ¶
func (p *Page) File() contenthub.File
func (*Page) GitInfo ¶
func (p *Page) GitInfo() valueobject.GitInfo
func (*Page) IsAncestor ¶
func (*Page) OutputFormats ¶
func (p *Page) OutputFormats() valueobject.OutputFormats
func (*Page) PublishDate ¶
func (*Page) RelPermalink ¶
func (*Page) Resources ¶
func (p *Page) Resources() PageResources
func (*Page) Translations ¶
type PageResources ¶
func (PageResources) ByType ¶
func (r PageResources) ByType(typ any) PageResources
ByType returns resources of a given resource type (e.g. "image").
type Publisher ¶
func (*Publisher) Publish ¶
func (p *Publisher) Publish(d site.Descriptor) error
Publish applies any relevant transformations and writes the file to its destination, e.g. /public.
func (*Publisher) PublishFiles ¶
func (p *Publisher) PublishFiles(fr io.ReadSeekCloser, filenames ...string) error
type Site ¶
type Site struct { ConfigSvc site.ConfigService ContentSvc site.ContentService ResourcesSvc site.ResourceService LanguageSvc site.LanguageService GitSvc *valueobject.GitMap Publisher *Publisher Template site.Template *valueobject.Author *valueobject.Compiler Title string *URL *Language Log loggers.Logger `json:"-"` // contains filtered or unexported fields }
func (*Site) IsMultiLingual ¶
func (*Site) Menus ¶
func (s *Site) Menus() valueobject.Menus
func (*Site) PrepareLazyLoads ¶
func (s *Site) PrepareLazyLoads()
func (*Site) RegularPages ¶ added in v0.0.5
func (*Site) Taxonomies ¶
func (s *Site) Taxonomies() TaxonomyList
type Taxonomy ¶
type Taxonomy map[string]contenthub.OrdinalWeightPage
A Taxonomy is a map of keywords to a list of pages. For example
TagTaxonomy['technology'] = WeightedPages TagTaxonomy['go'] = WeightedPages
type TaxonomyList ¶
The TaxonomyList is a list of all taxonomies and their values e.g. List['tags'] => TagTaxonomy (from above)
type URL ¶
type URL struct { Base string Canonical bool *valueobject.BaseURL }
func (*URL) BasePathNoSlash ¶
func (*URL) MakePath ¶
MakePath takes a string with any characters and replace it so the string could be used in a path. It does so by creating a Unicode-sanitized string, with the spaces replaced, whilst preserving the original casing of the string. E.g. Social Media -> Social-Media
func (*URL) MakePathSanitized ¶
MakePathSanitized creates a Unicode-sanitized string, with the spaces replaced