Documentation ¶
Index ¶
- Constants
- Variables
- func PaginateTransform[S ~[]E, E any, F any](collection S, perPage int, transformer func(input E) F) [][]F
- type ContentHierarchy
- func (ph *ContentHierarchy) AddPage(page *content.WebPage)
- func (ph *ContentHierarchy) AddStaticFile(relPath, fullPath string)
- func (ph *ContentHierarchy) Clear(args ...interface{})
- func (ph *ContentHierarchy) GatherContent(contentDir string) error
- func (ph *ContentHierarchy) GetChildren(page content.WebPage) []*content.WebPage
- func (ph *ContentHierarchy) GetNextPage(parent *content.WebPage, child *content.WebPage) *content.WebPage
- func (ph *ContentHierarchy) GetPage(path string) *content.WebPage
- func (ph *ContentHierarchy) GetParent(page content.WebPage) *content.WebPage
- func (ph *ContentHierarchy) GetPrevPage(parent *content.WebPage, child *content.WebPage) *content.WebPage
- func (ph *ContentHierarchy) GetTaxonomyPage(taxonomy string) *content.WebPage
- func (ph *ContentHierarchy) GetTaxonomyTerms(taxonomy string) TermMap
- func (ph *ContentHierarchy) Printf(format string, args ...interface{})
- func (ph *ContentHierarchy) Println(args ...interface{})
- func (ph *ContentHierarchy) Retree()
- func (ph *ContentHierarchy) SortedPages() []*content.WebPage
- type ContentNode
- type Feed
- type FeedAuthor
- type FeedContent
- type FeedDateTime
- type FeedEntry
- type FeedEntrySummary
- type FeedGenerator
- type FeedLink
- type Generator
- func (g *Generator) Build(now time.Time) error
- func (g *Generator) ClearOutputDirectory() error
- func (g *Generator) CopyStaticFiles() error
- func (g *Generator) FullUrl(path string) string
- func (g *Generator) GenerateFeed(now time.Time) error
- func (g *Generator) GeneratePage(page *content.WebPage) (err error)
- func (g *Generator) GenerateSitemap() error
- func (g *Generator) GetAllTaxonomyTerms(taxonomy string) (termTemplates []*TaxonomyTermContent)
- func (g *Generator) GetSectionPages(indexPath string, max int, offset int) (sectionPages []TemplateContent)
- func (g *Generator) GetTaxonomyTermsForPage(rootPath string, taxonomy string) (termTemplates []*TaxonomyTermContent)
- func (g *Generator) GetTemplateToUse(page *content.WebPage) string
- func (g *Generator) OutputPath(endPath string) string
- func (g *Generator) PageToTemplateContent(page *content.WebPage) TemplateContent
- func (g *Generator) PagesToTemplateContents(indexPage *content.WebPage) [][]TemplateContent
- func (g *Generator) Printf(format string, args ...interface{})
- func (g *Generator) Println(args ...interface{})
- func (g *Generator) SiteUrlNoTrailingslash() string
- func (g *Generator) SiteUrlWithTrailingSlash() string
- type IndexTemplateContent
- type PaginatedTemplateContent
- type Sitemap
- type SitemapUrl
- type TaxonomyTermContent
- type TemplateContent
- type TermIndexTemplateContent
- type TermMap
- type TermTTC
Constants ¶
View Source
const DEFAULT_TEMPLATE = "default.html"
Variables ¶
View Source
var LinkEndRegexp = regexp.MustCompile(`></link>`)
Functions ¶
func PaginateTransform ¶
Types ¶
type ContentHierarchy ¶
type ContentHierarchy struct { Pages map[string]*ContentNode Taxonomies map[string]TermMap TaxonomyPage map[string]*content.WebPage StaticFiles map[string]string // contains filtered or unexported fields }
func NewPageHierarchy ¶
func NewPageHierarchy(verbose bool) *ContentHierarchy
func (*ContentHierarchy) AddPage ¶
func (ph *ContentHierarchy) AddPage(page *content.WebPage)
func (*ContentHierarchy) AddStaticFile ¶
func (ph *ContentHierarchy) AddStaticFile(relPath, fullPath string)
func (*ContentHierarchy) Clear ¶
func (ph *ContentHierarchy) Clear(args ...interface{})
func (*ContentHierarchy) GatherContent ¶
func (ph *ContentHierarchy) GatherContent(contentDir string) error
func (*ContentHierarchy) GetChildren ¶
func (ph *ContentHierarchy) GetChildren(page content.WebPage) []*content.WebPage
func (*ContentHierarchy) GetNextPage ¶
func (*ContentHierarchy) GetPage ¶
func (ph *ContentHierarchy) GetPage(path string) *content.WebPage
func (*ContentHierarchy) GetParent ¶
func (ph *ContentHierarchy) GetParent(page content.WebPage) *content.WebPage
func (*ContentHierarchy) GetPrevPage ¶
func (*ContentHierarchy) GetTaxonomyPage ¶
func (ph *ContentHierarchy) GetTaxonomyPage(taxonomy string) *content.WebPage
func (*ContentHierarchy) GetTaxonomyTerms ¶
func (ph *ContentHierarchy) GetTaxonomyTerms(taxonomy string) TermMap
func (*ContentHierarchy) Printf ¶
func (ph *ContentHierarchy) Printf(format string, args ...interface{})
func (*ContentHierarchy) Println ¶
func (ph *ContentHierarchy) Println(args ...interface{})
func (*ContentHierarchy) Retree ¶
func (ph *ContentHierarchy) Retree()
func (*ContentHierarchy) SortedPages ¶
func (ph *ContentHierarchy) SortedPages() []*content.WebPage
type ContentNode ¶
type Feed ¶
type FeedAuthor ¶
type FeedContent ¶
type FeedDateTime ¶
func (FeedDateTime) MarshalXML ¶
func (t FeedDateTime) MarshalXML(e *xml.Encoder, start xml.StartElement) error
type FeedEntry ¶
type FeedEntry struct { XMLName xml.Name `xml:"entry"` Lang string `xml:"xml:lang,attr"` Title string `xml:"title"` Id string `xml:"id"` Published FeedDateTime `xml:"published"` Updated FeedDateTime `xml:"updated"` Content *FeedContent `xml:"content,omitempty"` Summary *FeedEntrySummary `xml:"summary,omitempty"` Authors []*FeedAuthor Links []*FeedLink }
type FeedEntrySummary ¶
type FeedGenerator ¶
type Generator ¶
type Generator struct { Config *config.Config Tmpl *template.Engine // contains filtered or unexported fields }
func (*Generator) ClearOutputDirectory ¶
func (*Generator) CopyStaticFiles ¶
func (*Generator) GeneratePage ¶
func (*Generator) GenerateSitemap ¶
func (*Generator) GetAllTaxonomyTerms ¶
func (g *Generator) GetAllTaxonomyTerms(taxonomy string) (termTemplates []*TaxonomyTermContent)
func (*Generator) GetSectionPages ¶
func (g *Generator) GetSectionPages(indexPath string, max int, offset int) (sectionPages []TemplateContent)
func (*Generator) GetTaxonomyTermsForPage ¶
func (g *Generator) GetTaxonomyTermsForPage(rootPath string, taxonomy string) (termTemplates []*TaxonomyTermContent)
func (*Generator) GetTemplateToUse ¶
func (*Generator) OutputPath ¶
func (*Generator) PageToTemplateContent ¶
func (g *Generator) PageToTemplateContent(page *content.WebPage) TemplateContent
func (*Generator) PagesToTemplateContents ¶
func (g *Generator) PagesToTemplateContents(indexPage *content.WebPage) [][]TemplateContent
func (*Generator) SiteUrlNoTrailingslash ¶
func (*Generator) SiteUrlWithTrailingSlash ¶
type IndexTemplateContent ¶
type IndexTemplateContent struct { TemplateContent Pages []TemplateContent Prev string Next string CurrentPage int TotalPages int }
type PaginatedTemplateContent ¶
type PaginatedTemplateContent struct { TemplateContent Prev string PrevPage TemplateContent Next string NextPage TemplateContent }
type Sitemap ¶
type Sitemap struct { XMLName xml.Name `xml:"urlset"` Xmlns string `xml:"xmlns,attr"` Urls []*SitemapUrl }
Sitemap represents the sitemap of the site.
type SitemapUrl ¶
SitemapUrl represents a URL in the sitemap.
type TaxonomyTermContent ¶
type TemplateContent ¶
type TemplateContent struct { content.FrontMatter Content htmltpl.HTML Config config.Config Path string RootPath string Permalink string Summary htmltpl.HTML }
func (TemplateContent) GetExtra ¶
func (t TemplateContent) GetExtra(key string) any
func (TemplateContent) HasExtra ¶
func (t TemplateContent) HasExtra(key string) bool
type TermIndexTemplateContent ¶
type TermIndexTemplateContent struct { TaxonomyTermContent IndexTemplateContent }
type TermTTC ¶
type TermTTC map[string]*TaxonomyTermContent
Click to show internal directories.
Click to hide internal directories.