render

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AssetRefs

type AssetRefs struct {
	CSS        string
	JSHead     string
	JS         string
	FlexSearch string
	KaTeX      string
	ChromaCSS  string
	Extra      map[string]string // original basename → fingerprinted URL
}

AssetRefs holds fingerprinted asset URLs.

type HugoPage added in v0.2.0

type HugoPage struct {
	*content.Page
	Site *SiteData
	// contains filtered or unexported fields
}

HugoPage wraps *content.Page with Site for use inside range loops in Hugo themes. Hugo themes do {{range .Pages}}...{{.Site.Params.x}}...{{end}} expecting .Site on each page.

func (*HugoPage) AllTranslations added in v0.2.0

func (hp *HugoPage) AllTranslations() []any

AllTranslations returns empty.

func (*HugoPage) AlternativeOutputFormats added in v0.2.0

func (hp *HugoPage) AlternativeOutputFormats() *outputFormatsStub

AlternativeOutputFormats returns a stub.

func (*HugoPage) Ancestors added in v0.2.0

func (hp *HugoPage) Ancestors() PageList

Ancestors returns ancestor pages.

func (*HugoPage) BundleType added in v0.2.0

func (hp *HugoPage) BundleType() string

BundleType returns empty (stub).

func (*HugoPage) Content added in v0.2.0

func (hp *HugoPage) Content() template.HTML

Content returns the rendered page content.

func (*HugoPage) Data added in v0.2.0

func (hp *HugoPage) Data() *PageData

Data returns page data (for taxonomy pages).

func (*HugoPage) Date added in v0.2.0

func (hp *HugoPage) Date() HugoTime

Date returns HugoTime for flexible Format calls in templates.

func (*HugoPage) Description added in v0.2.0

func (hp *HugoPage) Description() string

Description returns the page description.

func (*HugoPage) Draft added in v0.2.0

func (hp *HugoPage) Draft() bool

Draft returns whether the page is a draft.

func (*HugoPage) ExpiryDate added in v0.2.0

func (hp *HugoPage) ExpiryDate() HugoTime

ExpiryDate returns HugoTime.

func (*HugoPage) File added in v0.2.0

func (hp *HugoPage) File() *pageFileStub

File returns a stub file info object.

func (*HugoPage) FuzzyWordCount added in v0.2.0

func (hp *HugoPage) FuzzyWordCount() int

FuzzyWordCount returns word count rounded to nearest 100.

func (*HugoPage) GetPage added in v0.2.0

func (hp *HugoPage) GetPage(args ...any) *HugoPage

func (*HugoPage) GitInfo added in v0.2.0

func (hp *HugoPage) GitInfo() any

GitInfo returns nil (stub).

func (*HugoPage) HasShortcode added in v0.2.0

func (hp *HugoPage) HasShortcode(name string) bool

func (*HugoPage) IsHome added in v0.2.0

func (hp *HugoPage) IsHome() bool

IsHome returns true if page kind is "home".

func (*HugoPage) IsNode added in v0.2.0

func (hp *HugoPage) IsNode() bool

IsNode returns true if this is a list/section/home page.

func (*HugoPage) IsPage added in v0.2.0

func (hp *HugoPage) IsPage() bool

IsPage returns true if page kind is "page".

func (*HugoPage) IsSection added in v0.2.0

func (hp *HugoPage) IsSection() bool

IsSection returns true if page kind is "section".

func (*HugoPage) IsTranslated added in v0.2.0

func (hp *HugoPage) IsTranslated() bool

IsTranslated returns false.

func (*HugoPage) Keywords added in v0.2.0

func (hp *HugoPage) Keywords() []string

func (*HugoPage) Kind added in v0.2.0

func (hp *HugoPage) Kind() string

Kind returns the page kind.

func (*HugoPage) Lang added in v0.2.0

func (hp *HugoPage) Lang() string

Lang returns the language code.

func (*HugoPage) Language added in v0.2.0

func (hp *HugoPage) Language() *SiteLanguage

Language returns the site language.

func (*HugoPage) Lastmod added in v0.2.0

func (hp *HugoPage) Lastmod() HugoTime

Lastmod returns HugoTime.

func (*HugoPage) LinkTitle added in v0.2.0

func (hp *HugoPage) LinkTitle() string

LinkTitle returns the link title.

func (*HugoPage) Next added in v0.2.0

func (hp *HugoPage) Next() *content.Page

Next returns next sibling page.

func (*HugoPage) OutputFormats added in v0.2.0

func (hp *HugoPage) OutputFormats() *outputFormatsStub

OutputFormats returns a stub.

func (*HugoPage) Pages added in v0.2.0

func (hp *HugoPage) Pages() HugoPageList

Pages returns the direct children of this page, wrapped for template use. Mirrors Hugo's .Pages: on a section it is the pages and subsections directly under it, in tree order.

func (*HugoPage) Param added in v0.2.0

func (hp *HugoPage) Param(key string) any

Param looks up a param key in page params, then site params.

func (*HugoPage) Params added in v0.2.0

func (hp *HugoPage) Params() map[string]any

Params returns the page's front matter params map.

func (*HugoPage) Parent added in v0.2.0

func (hp *HugoPage) Parent() *content.Page

Parent returns the parent page.

func (*HugoPage) Path added in v0.2.0

func (hp *HugoPage) Path() string

Path returns the page URL path.

func (hp *HugoPage) Permalink() string

Permalink returns the full URL.

func (*HugoPage) Prev added in v0.2.0

func (hp *HugoPage) Prev() *content.Page

Prev returns previous sibling page.

func (*HugoPage) PublishDate added in v0.2.0

func (hp *HugoPage) PublishDate() HugoTime

PublishDate returns HugoTime.

func (*HugoPage) RawContent added in v0.2.0

func (hp *HugoPage) RawContent() string

func (*HugoPage) ReadingTime added in v0.2.0

func (hp *HugoPage) ReadingTime() int

ReadingTime returns estimated reading time in minutes.

func (*HugoPage) RegularPages added in v0.2.0

func (hp *HugoPage) RegularPages() HugoPageList

RegularPages returns the direct children of kind "page" (Hugo's .RegularPages).

func (*HugoPage) RegularPagesRecursive added in v0.3.0

func (hp *HugoPage) RegularPagesRecursive() HugoPageList

RegularPagesRecursive returns every descendant of kind "page", at any depth (Hugo's .RegularPagesRecursive): the pages in this section and all of its subsections.

func (hp *HugoPage) RelPermalink() string

RelPermalink returns the relative URL.

func (*HugoPage) Render added in v0.2.0

func (hp *HugoPage) Render(layout string) template.HTML

Render renders the page with an alternative layout (stub — returns empty).

func (*HugoPage) Resources added in v0.2.0

func (hp *HugoPage) Resources() stubResourceSlice

Resources returns an empty page resources stub.

func (*HugoPage) Scratch added in v0.2.0

func (hp *HugoPage) Scratch() *Scratch

Scratch returns a persistent scratch pad for the page.

func (*HugoPage) Section added in v0.2.0

func (hp *HugoPage) Section() string

Section returns the root section.

func (*HugoPage) Sections added in v0.3.0

func (hp *HugoPage) Sections() HugoPageList

Sections returns the direct children of kind "section" (Hugo's .Sections).

func (*HugoPage) Store added in v0.2.0

func (hp *HugoPage) Store() *Scratch

Store returns a persistent scratch pad (Hugo 0.117+: .Store).

func (*HugoPage) Summary added in v0.2.0

func (hp *HugoPage) Summary() string

Summary returns the page summary.

func (*HugoPage) TableOfContents added in v0.2.0

func (hp *HugoPage) TableOfContents() template.HTML

TableOfContents returns empty (stub).

func (*HugoPage) Translations added in v0.2.0

func (hp *HugoPage) Translations() []any

Translations returns empty (no multilingual support).

func (*HugoPage) Truncated added in v0.2.0

func (hp *HugoPage) Truncated() bool

Truncated returns whether the page content was truncated for summary.

func (*HugoPage) Type added in v0.2.0

func (hp *HugoPage) Type() string

Type returns the content type.

func (*HugoPage) Weight added in v0.2.0

func (hp *HugoPage) Weight() int

Weight returns the page weight.

func (*HugoPage) WordCount added in v0.2.0

func (hp *HugoPage) WordCount() int

WordCount returns the word count.

type HugoPageGroup added in v0.2.0

type HugoPageGroup struct {
	Key   string
	Pages HugoPageList
}

HugoPageGroup is a group of pages with a common key (e.g. year).

type HugoPageList added in v0.2.0

type HugoPageList []*HugoPage

func (HugoPageList) ByDate added in v0.2.0

func (pl HugoPageList) ByDate() HugoPageList

Sorting methods — return a sorted copy of the list.

func (HugoPageList) ByLastmod added in v0.2.0

func (pl HugoPageList) ByLastmod() HugoPageList

func (HugoPageList) ByLength added in v0.2.0

func (pl HugoPageList) ByLength() HugoPageList

func (HugoPageList) ByPublishDate added in v0.2.0

func (pl HugoPageList) ByPublishDate() HugoPageList

func (HugoPageList) ByTitle added in v0.2.0

func (pl HugoPageList) ByTitle() HugoPageList

func (HugoPageList) ByWeight added in v0.2.0

func (pl HugoPageList) ByWeight() HugoPageList

func (HugoPageList) Filter added in v0.2.0

func (pl HugoPageList) Filter(fn any) HugoPageList

Filter returns pages matching the predicate (stub — returns all pages).

func (HugoPageList) First added in v0.2.0

func (pl HugoPageList) First(n int) HugoPageList

func (HugoPageList) GroupByDate added in v0.2.0

func (pl HugoPageList) GroupByDate(layout string) []HugoPageGroup

GroupByDate groups pages by a date format string, returning [{Key, Pages}] in the order the keys are first seen. It does not sort: feed it a list already ordered the way you want the groups to come out (for newest-first groups, pass .ByDate.Reverse).

func (HugoPageList) GroupByLastmod added in v0.2.0

func (pl HugoPageList) GroupByLastmod(layout string) []HugoPageGroup

GroupByLastmod groups pages by lastmod date.

func (HugoPageList) GroupByParam added in v0.2.0

func (pl HugoPageList) GroupByParam(key string) []HugoPageGroup

GroupByParam groups pages by a param key.

func (HugoPageList) GroupByPublishDate added in v0.2.0

func (pl HugoPageList) GroupByPublishDate(layout string) []HugoPageGroup

GroupByPublishDate groups pages by publish date.

func (HugoPageList) Last added in v0.2.0

func (pl HugoPageList) Last(n int) HugoPageList

func (HugoPageList) Len added in v0.2.0

func (pl HugoPageList) Len() int

func (HugoPageList) Limit added in v0.2.0

func (pl HugoPageList) Limit(n int) HugoPageList

Limit returns the first n pages (alias for First).

func (HugoPageList) Related added in v0.2.0

func (pl HugoPageList) Related(page any) HugoPageList

Related returns empty list (stub for Hugo .Site.RegularPages.Related — requires index config).

func (HugoPageList) Reverse added in v0.2.0

func (pl HugoPageList) Reverse() HugoPageList

type HugoTime added in v0.2.0

type HugoTime struct {
	time.Time
}

HugoTime wraps time.Time with a Format method that accepts any (string or nil). Hugo themes use .Date.Format .Site.Params.dateformShort where the format is interface{}.

func (HugoTime) Format added in v0.2.0

func (ht HugoTime) Format(layout any) string

Format overrides time.Time.Format to accept any format value (string, nil, etc.).

type PageData added in v0.2.0

type PageData struct {
	Pages    HugoPageList
	Terms    *TermsData
	Singular string // taxonomy type singular name, e.g. "tag"
	Plural   string // taxonomy type plural name, e.g. "tags"
	Term     string // for term pages: the specific term (e.g. "go")
}

PageData mirrors Hugo's .Data field on taxonomy/term pages (provides .Pages and .Terms).

type PageList added in v0.2.0

type PageList []*content.Page

PageList is a slice of pages with Hugo-compatible methods.

func (PageList) First added in v0.2.0

func (pl PageList) First(n int) PageList

func (PageList) Last added in v0.2.0

func (pl PageList) Last(n int) PageList

func (PageList) Reverse added in v0.2.0

func (pl PageList) Reverse() PageList

type Renderer

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

Renderer handles template rendering.

func New

func New(site *SiteData, assets AssetRefs, layoutsDir string, liveReload bool, paginateBy int, paginateMode string) *Renderer

New creates a new Renderer.

func (*Renderer) InvalidateCache

func (r *Renderer) InvalidateCache()

InvalidateCache clears the template cache (useful after layout file changes).

func (*Renderer) Prewarm added in v0.2.0

func (r *Renderer) Prewarm()

Prewarm executes each known template kind once with empty data to trigger html/template's lazy auto-escaping initialization. After this, concurrent Execute calls on the same template are safe without Clone().

func (*Renderer) Render404

func (r *Renderer) Render404(outputDir string, allPages []*content.Page) error

Render404 renders a 404.html page to outputDir/404.html.

func (*Renderer) RenderPage

func (r *Renderer) RenderPage(page *content.Page, allPages []*content.Page) error

RenderPage renders a single page to its OutputPath.

func (*Renderer) RenderSearchPage

func (r *Renderer) RenderSearchPage(outputDir string) error

RenderSearchPage renders the /search/ page.

func (*Renderer) RenderTagPage

func (r *Renderer) RenderTagPage(tag string, pages []*content.Page, outputDir string) error

func (*Renderer) RenderTaxonomyPage

func (r *Renderer) RenderTaxonomyPage(tags []TagCount, outputDir string) error

RenderTaxonomyPage renders the /tags/ overview page.

type Scratch added in v0.2.0

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

Scratch implements Hugo's .Scratch / site.Store / .Page.Store mutable scratch pad.

func (*Scratch) Add added in v0.2.0

func (s *Scratch) Add(key string, val any) string

func (*Scratch) Delete added in v0.2.0

func (s *Scratch) Delete(key string) string

func (*Scratch) Get added in v0.2.0

func (s *Scratch) Get(key string) any

func (*Scratch) GetSortedMapValues added in v0.2.0

func (s *Scratch) GetSortedMapValues(key string) []any

func (*Scratch) Set added in v0.2.0

func (s *Scratch) Set(key string, val any) string

func (*Scratch) SetInMap added in v0.2.0

func (s *Scratch) SetInMap(key, mapKey string, val any) string

func (*Scratch) Values added in v0.2.0

func (s *Scratch) Values() map[string]any

type SidebarItem

type SidebarItem struct {
	Title     string
	URL       string
	Active    bool
	HasActive bool
	IsParent  bool
	Children  []*SidebarItem
}

SidebarItem is a pre-built sidebar navigation node.

type SiteData

type SiteData struct {
	Title           string
	BaseURL         string
	Description     string
	EditURLBase     string
	Params          map[string]any  // .Site.Params — from [params] in tago.toml
	AllPages        []*content.Page // all pages (internal; use Pages() method for templates)
	AllRegularPages []*content.Page // kind=page only (internal; use RegularPages() method)

	// Hugo-compatible fields
	LanguageCode string        // e.g. "en-us"
	Language     *SiteLanguage // language metadata object
	Copyright    string
	Author       map[string]any
	Menus        map[string][]SiteMenuItem // .Site.Menus.main etc.
}

SiteData holds site-wide metadata available to all templates.

func (*SiteData) BuildDrafts added in v0.2.0

func (s *SiteData) BuildDrafts() bool

func (*SiteData) Config added in v0.2.0

func (s *SiteData) Config() *siteConfigStub

Config returns a stub for site config (e.g. site.Config.Services.RSS.Limit).

func (*SiteData) Data added in v0.2.0

func (s *SiteData) Data() safeDataMap

Data returns the site data directory contents (or an empty safe map if not loaded).

func (*SiteData) DisablePathToLower added in v0.2.0

func (s *SiteData) DisablePathToLower() bool

func (*SiteData) DisqusShortname added in v0.2.0

func (s *SiteData) DisqusShortname() string

DisqusShortname returns empty string (stub).

func (*SiteData) EnableRobotsTXT added in v0.2.0

func (s *SiteData) EnableRobotsTXT() bool

func (*SiteData) GetPage added in v0.2.0

func (s *SiteData) GetPage(args ...string) *siteHomeStub

GetPage returns a stub page for the given path (used by themes to get section/taxonomy pages).

func (*SiteData) GoogleAnalytics added in v0.2.0

func (s *SiteData) GoogleAnalytics() string

GoogleAnalytics returns empty string (stub).

func (*SiteData) Home added in v0.2.0

func (s *SiteData) Home() *siteHomeStub

Home returns a fake home page stub for .Site.Home.RelPermalink etc.

func (*SiteData) Hugo added in v0.2.0

func (s *SiteData) Hugo() *hugoNamespace

Hugo returns the hugo namespace (allows {{ .Site.Hugo.Version }} in templates).

func (*SiteData) IsMinifyOutput added in v0.2.0

func (s *SiteData) IsMinifyOutput() bool

func (*SiteData) IsMultilingual added in v0.2.0

func (s *SiteData) IsMultilingual() bool

func (*SiteData) IsServer added in v0.2.0

func (s *SiteData) IsServer() bool

func (*SiteData) LanguagePrefix added in v0.2.0

func (s *SiteData) LanguagePrefix() string

LanguagePrefix returns an empty string (tago is single-language).

func (*SiteData) LastChange added in v0.2.0

func (s *SiteData) LastChange() time.Time

LastChange returns zero time (stub for .Site.LastChange).

func (*SiteData) Lastmod added in v0.2.0

func (s *SiteData) Lastmod() HugoTime

func (*SiteData) Pages added in v0.2.0

func (s *SiteData) Pages() HugoPageList

Pages returns all site pages as HugoPageList (with sorting methods).

func (*SiteData) Param added in v0.2.0

func (s *SiteData) Param(key string) any

Param looks up a param in Site.Params (Hugo .Param method falls through to site).

func (s *SiteData) RSSLink() string

RSSLink returns the RSS feed URL for the site.

func (*SiteData) RegularPages added in v0.2.0

func (s *SiteData) RegularPages() HugoPageList

RegularPages returns kind=page pages as HugoPageList (with sorting methods).

func (*SiteData) Social added in v0.2.0

func (s *SiteData) Social() map[string]string

func (*SiteData) Store added in v0.2.0

func (s *SiteData) Store() *Scratch

func (*SiteData) Taxonomies added in v0.2.0

func (s *SiteData) Taxonomies() map[string]any

Taxonomies builds a Hugo-compatible taxonomy map from site pages. Returns map[taxName]map[termName]TermEntry.

type SiteLanguage added in v0.2.0

type SiteLanguage struct {
	Lang              string // language code (e.g. "en")
	LanguageCode      string
	LanguageName      string
	LanguageDirection string
	Weight            int
	Locale            string // BCP 47 locale string (e.g. "en-US")
	Direction         string // "ltr" or "rtl"
}

SiteLanguage holds language-specific site metadata for .Site.Language

func (*SiteLanguage) Get added in v0.2.0

func (l *SiteLanguage) Get(key string) any

Get returns a language param (stub for Hugo .Site.Language.Get "key").

func (*SiteLanguage) IsRTL added in v0.2.0

func (l *SiteLanguage) IsRTL() bool

IsRTL returns true if the language direction is rtl.

func (*SiteLanguage) Name added in v0.2.0

func (l *SiteLanguage) Name() string

Name returns the language name (alias for LanguageName).

func (*SiteLanguage) Params added in v0.2.0

func (l *SiteLanguage) Params() map[string]any

Params returns an empty map (stub for language params).

func (*SiteLanguage) String added in v0.2.0

func (l *SiteLanguage) String() string
type SiteMenuItem struct {
	Name        string
	URL         string
	Weight      int
	Identifier  string
	HasChildren bool
	Children    []SiteMenuItem
}

SiteMenuItem represents a single navigation menu item.

type TagCount

type TagCount struct {
	Name  string
	Count int
}

TagCount holds a tag and its page count.

type TemplateData

type TemplateData struct {
	Page             *content.Page
	Site             *SiteData
	Assets           AssetRefs
	Pages            HugoPageList   // for list pages: children or tag members
	Tags             []TagCount     // for taxonomy page
	GraphDataJSON    string         // JSON string, embedded inline for type=graph
	TreeDataJSON     string         // JSON string, embedded inline for type=tree
	CalendarDataJSON string         // JSON string, embedded inline for type=calendar
	SidebarItems     []*SidebarItem // pre-built sidebar nav tree
	SidebarRoot      *content.Page  // page whose subtree is shown in sidebar
	SidebarBack      *content.Page  // back-link target (nil = no back link)
	PrevPage         *content.Page  // previous sibling (for pager)
	NextPage         *content.Page  // next sibling (for pager)
	TermTotal        int            // total members of a term (before capping); 0 = not a capped term page
	TermShown        int            // members actually listed on this term page
	// contains filtered or unexported fields
}

TemplateData is the data passed to all templates.

func (*TemplateData) AllTranslations added in v0.2.0

func (d *TemplateData) AllTranslations() []any

AllTranslations returns empty slice (stub).

func (*TemplateData) AlternativeOutputFormats added in v0.2.0

func (d *TemplateData) AlternativeOutputFormats() []any

AlternativeOutputFormats returns empty slice (stub for Hugo compatibility).

func (*TemplateData) Ancestors added in v0.2.0

func (d *TemplateData) Ancestors() PageList

func (*TemplateData) BundleType added in v0.2.0

func (d *TemplateData) BundleType() string

BundleType returns empty string (stub).

func (*TemplateData) Content added in v0.2.0

func (d *TemplateData) Content() template.HTML

func (*TemplateData) CurrentSection added in v0.2.0

func (d *TemplateData) CurrentSection() *TemplateData

CurrentSection returns the current page for section context.

func (*TemplateData) Data added in v0.2.0

func (d *TemplateData) Data() *PageData

Data returns Hugo-compatible .Data field (for taxonomy/term pages).

func (*TemplateData) Date added in v0.2.0

func (d *TemplateData) Date() HugoTime

func (*TemplateData) Description added in v0.2.0

func (d *TemplateData) Description() string

func (*TemplateData) Draft added in v0.2.0

func (d *TemplateData) Draft() bool

func (*TemplateData) ExpiryDate added in v0.2.0

func (d *TemplateData) ExpiryDate() HugoTime

func (*TemplateData) File added in v0.2.0

func (d *TemplateData) File() *pageFileStub

File returns a stub file info object (stub for Hugo .File).

func (*TemplateData) FuzzyWordCount added in v0.2.0

func (d *TemplateData) FuzzyWordCount() int

func (*TemplateData) GetPage added in v0.2.0

func (d *TemplateData) GetPage(args ...any) *TemplateData

GetPage returns a stub (tago does not resolve cross-page references at template time).

func (*TemplateData) GetTerms added in v0.2.0

func (d *TemplateData) GetTerms(taxonomy string) []any

func (*TemplateData) GitInfo added in v0.2.0

func (d *TemplateData) GitInfo() any

GitInfo returns nil (stub for Hugo .GitInfo; nil makes {{- if .GitInfo }} false).

func (*TemplateData) HasShortcode added in v0.2.0

func (d *TemplateData) HasShortcode(name string) bool

HasShortcode returns false (stub for Hugo .HasShortcode check).

func (*TemplateData) IsHome added in v0.2.0

func (d *TemplateData) IsHome() bool

func (*TemplateData) IsNode added in v0.2.0

func (d *TemplateData) IsNode() bool

func (*TemplateData) IsPage added in v0.2.0

func (d *TemplateData) IsPage() bool

func (*TemplateData) IsSection added in v0.2.0

func (d *TemplateData) IsSection() bool

func (*TemplateData) IsTranslated added in v0.2.0

func (d *TemplateData) IsTranslated() bool

IsTranslated returns false (stub for multilingual support).

func (*TemplateData) Keywords added in v0.2.0

func (d *TemplateData) Keywords() []string

Keywords returns the page's tags/keywords for use in meta tags.

func (*TemplateData) Kind added in v0.2.0

func (d *TemplateData) Kind() string

func (*TemplateData) Lang added in v0.2.0

func (d *TemplateData) Lang() string

func (*TemplateData) Language added in v0.2.0

func (d *TemplateData) Language() *SiteLanguage

Language returns the site language object.

func (*TemplateData) Lastmod added in v0.2.0

func (d *TemplateData) Lastmod() HugoTime

func (*TemplateData) Layout added in v0.2.0

func (d *TemplateData) Layout() string

func (*TemplateData) LinkTitle added in v0.2.0

func (d *TemplateData) LinkTitle() string

func (*TemplateData) Name added in v0.2.0

func (d *TemplateData) Name() string

func (*TemplateData) Next added in v0.2.0

func (d *TemplateData) Next() *content.Page

Next returns the next page in the sequence (Hugo: .Next).

func (*TemplateData) NextInSection added in v0.2.0

func (d *TemplateData) NextInSection() *content.Page

NextInSection returns the next page in the section (alias for .Next).

func (*TemplateData) OutputFormats added in v0.2.0

func (d *TemplateData) OutputFormats() *outputFormatsStub

OutputFormats returns a stub output formats object.

func (*TemplateData) Paginate added in v0.2.0

func (d *TemplateData) Paginate(pages any, args ...any) *paginatorStub

Paginate returns the real Paginator when set, otherwise a fallback stub.

func (*TemplateData) Paginator added in v0.2.0

func (d *TemplateData) Paginator(args ...any) *paginatorStub

Paginator returns the real Paginator when set, otherwise a fallback stub.

func (*TemplateData) Param added in v0.2.0

func (d *TemplateData) Param(key string) any

func (*TemplateData) Params added in v0.2.0

func (d *TemplateData) Params() map[string]any

func (*TemplateData) Parent added in v0.2.0

func (d *TemplateData) Parent() *safePageRef
func (d *TemplateData) Permalink() string

func (*TemplateData) Prev added in v0.2.0

func (d *TemplateData) Prev() *content.Page

Prev returns the previous page in the sequence (Hugo: .Prev).

func (*TemplateData) PrevInSection added in v0.2.0

func (d *TemplateData) PrevInSection() *content.Page

PrevInSection returns the prev page in the section (alias for .Prev).

func (*TemplateData) PublishDate added in v0.2.0

func (d *TemplateData) PublishDate() HugoTime

func (*TemplateData) ReadingTime added in v0.2.0

func (d *TemplateData) ReadingTime() int

func (*TemplateData) RegularPages added in v0.2.0

func (d *TemplateData) RegularPages() HugoPageList

RegularPages returns only kind=page children (for section/home templates).

func (*TemplateData) RegularPagesRecursive added in v0.2.0

func (d *TemplateData) RegularPagesRecursive() HugoPageList
func (d *TemplateData) RelPermalink() string

func (*TemplateData) Render added in v0.2.0

func (d *TemplateData) Render(layout string) template.HTML

func (*TemplateData) Resources added in v0.2.0

func (d *TemplateData) Resources() stubResourceSlice

Resources returns an empty page resources stub (stub for Hugo .Resources).

func (*TemplateData) Scratch added in v0.2.0

func (d *TemplateData) Scratch() *Scratch

Scratch returns a persistent scratch pad for Hugo's .Scratch.

func (*TemplateData) Section added in v0.2.0

func (d *TemplateData) Section() string

func (*TemplateData) Sections added in v0.2.0

func (d *TemplateData) Sections() HugoPageList

func (*TemplateData) Slug added in v0.2.0

func (d *TemplateData) Slug() string

func (*TemplateData) Store added in v0.2.0

func (d *TemplateData) Store() *Scratch

Store returns a persistent scratch pad (Hugo 0.117+: .Store).

func (*TemplateData) Summary added in v0.2.0

func (d *TemplateData) Summary() string

func (*TemplateData) TableOfContents added in v0.2.0

func (d *TemplateData) TableOfContents() template.HTML

TableOfContents returns empty string (stub for Hugo .TableOfContents).

func (*TemplateData) Title added in v0.2.0

func (d *TemplateData) Title() string

func (*TemplateData) TranslationKey added in v0.2.0

func (d *TemplateData) TranslationKey() string

TranslationKey returns empty string (stub).

func (*TemplateData) Translations added in v0.2.0

func (d *TemplateData) Translations() []any

Translations returns empty slice (stub).

func (*TemplateData) Truncated added in v0.2.0

func (d *TemplateData) Truncated() bool

Truncated returns false (stub for Hugo .Truncated; true means Summary != full content).

func (*TemplateData) Type added in v0.2.0

func (d *TemplateData) Type() string

func (*TemplateData) Weight added in v0.2.0

func (d *TemplateData) Weight() int

func (*TemplateData) WordCount added in v0.2.0

func (d *TemplateData) WordCount() int

type TermEntry added in v0.2.0

type TermEntry struct {
	Name  string
	Count int
	Term  string // alias for Name, used by some themes as .Term
}

TermEntry is a single taxonomy term with name and count.

func (TermEntry) Page added in v0.2.0

func (t TermEntry) Page() *content.Page

func (TermEntry) Pages added in v0.2.0

func (t TermEntry) Pages() HugoPageList

type TermsData added in v0.2.0

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

TermsData wraps taxonomy terms and provides Hugo-compatible methods.

func (*TermsData) Alphabetical added in v0.2.0

func (td *TermsData) Alphabetical() []TermEntry

Alphabetical returns terms sorted alphabetically with Name and Count.

func (*TermsData) ByCount added in v0.2.0

func (td *TermsData) ByCount() []TermEntry

ByCount returns terms sorted by count (descending).

Jump to

Keyboard shortcuts

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