Documentation ¶
Index ¶
- Variables
- func LoadConfig(d ConfigSourceDescriptor, doWithConfig ...func(cfg config.Provider) error) (config.Provider, []string, error)
- func LoadConfigDefault(fs afero.Fs) (config.Provider, error)
- type BuildCfg
- type ConfigSourceDescriptor
- type ContentFactory
- func (f ContentFactory) ApplyArchetypeFilename(w io.Writer, p page.Page, archetypeKind, archetypeFilename string) error
- func (f ContentFactory) ApplyArchetypeTemplate(w io.Writer, p page.Page, archetypeKind, templateSource string) error
- func (f ContentFactory) CreateContentPlaceHolder(filename string, force bool) (string, error)
- func (f ContentFactory) SectionFromFilename(filename string) (string, error)
- type HugoSites
- func (h *HugoSites) Build(config BuildCfg, events ...fsnotify.Event) error
- func (h *HugoSites) Data() map[string]any
- func (f HugoSites) Done() <-chan bool
- func (f HugoSites) FatalError(err error)
- func (h *HugoSites) GC() (int, error)
- func (h *HugoSites) GetContentPage(filename string) page.Page
- func (h HugoSites) IncrContentRender()
- func (h HugoSites) IncrPageRender()
- func (h *HugoSites) IsMultihost() bool
- func (h *HugoSites) LanguageSet() map[string]int
- func (h *HugoSites) NumLogErrors() int
- func (h *HugoSites) Pages() page.Pages
- func (h *HugoSites) PrintProcessingStats(w io.Writer)
- func (h *HugoSites) ShouldSkipFileChangeEvent(ev fsnotify.Event) bool
- type IntegrationTestBuilder
- func (s *IntegrationTestBuilder) AddFiles(filenameContent ...string) *IntegrationTestBuilder
- func (s *IntegrationTestBuilder) AssertBuildCountData(count int)
- func (s *IntegrationTestBuilder) AssertBuildCountGitInfo(count int)
- func (s *IntegrationTestBuilder) AssertBuildCountLayouts(count int)
- func (s *IntegrationTestBuilder) AssertBuildCountTranslations(count int)
- func (s *IntegrationTestBuilder) AssertDestinationExists(filename string, b bool)
- func (s *IntegrationTestBuilder) AssertFileContent(filename string, matches ...string)
- func (s *IntegrationTestBuilder) AssertFileContentExact(filename string, matches ...string)
- func (s *IntegrationTestBuilder) AssertIsFileError(err error) herrors.FileError
- func (s *IntegrationTestBuilder) AssertLogContains(text string)
- func (s *IntegrationTestBuilder) AssertLogMatches(expression string)
- func (s *IntegrationTestBuilder) AssertRenderCountContent(count int)
- func (s *IntegrationTestBuilder) AssertRenderCountPage(count int)
- func (s *IntegrationTestBuilder) Build() *IntegrationTestBuilder
- func (s *IntegrationTestBuilder) BuildE() (*IntegrationTestBuilder, error)
- func (s *IntegrationTestBuilder) EditFileReplace(filename string, replacementFunc func(s string) string) *IntegrationTestBuilder
- func (s *IntegrationTestBuilder) EditFiles(filenameContent ...string) *IntegrationTestBuilder
- func (s *IntegrationTestBuilder) FileContent(filename string) string
- func (s *IntegrationTestBuilder) RemoveFiles(filenames ...string) *IntegrationTestBuilder
- func (s *IntegrationTestBuilder) RenameFile(old, new string) *IntegrationTestBuilder
- type IntegrationTestConfig
- type IntegrationTestDebugConfig
- type Multilingual
- type OrderedTaxonomy
- type OrderedTaxonomyEntry
- type PageCollections
- type Permalinker
- type ShortcodeWithPage
- func (scp *ShortcodeWithPage) Get(key any) any
- func (scp *ShortcodeWithPage) InnerDeindent() template.HTML
- func (scp *ShortcodeWithPage) Position() text.Position
- func (scp *ShortcodeWithPage) Ref(args map[string]any) (string, error)
- func (scp *ShortcodeWithPage) RelRef(args map[string]any) (string, error)
- func (scp *ShortcodeWithPage) Scratch() *maps.Scratch
- func (scp *ShortcodeWithPage) Site() page.Site
- type Site
- type SiteConfig
- type SiteInfo
- func (s *SiteInfo) AllPages() page.Pages
- func (s *SiteInfo) AllRegularPages() page.Pages
- func (s *SiteInfo) BaseURL() template.URL
- func (s *SiteInfo) Config() SiteConfig
- func (s *SiteInfo) Current() page.Site
- func (s *SiteInfo) Data() map[string]any
- func (s *SiteInfo) DisqusShortname() string
- func (s *SiteInfo) GetPage(ref ...string) (page.Page, error)
- func (s *SiteInfo) GetPageWithTemplateInfo(info tpl.Info, ref ...string) (page.Page, error)
- func (s *SiteInfo) GoogleAnalytics() string
- func (s *SiteInfo) Home() page.Page
- func (s *SiteInfo) HomeAbsURL() string
- func (s *SiteInfo) Hugo() hugo.Info
- func (s *SiteInfo) IsMultiLingual() bool
- func (s *SiteInfo) IsServer() bool
- func (s *SiteInfo) Language() *langs.Language
- func (s *SiteInfo) LastChange() time.Time
- func (s *SiteInfo) Menus() navigation.Menus
- func (s *SiteInfo) Pages() page.Pages
- func (s *SiteInfo) Param(key any) (any, error)
- func (s *SiteInfo) Params() maps.Params
- func (s *SiteInfo) RegularPages() page.Pages
- func (s *SiteInfo) Sections() page.Pages
- func (s *SiteInfo) ServerPort() int
- func (s *SiteInfo) Site() page.Site
- func (s *SiteInfo) SitemapAbsURL() string
- func (s *SiteInfo) Sites() page.Sites
- func (s *SiteInfo) String() string
- func (s *SiteInfo) Taxonomies() any
- func (s *SiteInfo) Title() string
- type SiteSocial
- type Taxonomy
- type TaxonomyList
Constants ¶
This section is empty.
Variables ¶
var ErrNoConfigFile = errors.New("Unable to locate config file or config directory. Perhaps you need to create a new site.\n Run `hugo help new` for details.\n")
Functions ¶
func LoadConfig ¶ added in v0.20.1
func LoadConfig(d ConfigSourceDescriptor, doWithConfig ...func(cfg config.Provider) error) (config.Provider, []string, error)
LoadConfig loads Hugo configuration into a new Viper and then adds a set of defaults.
Types ¶
type BuildCfg ¶
type BuildCfg struct { // Reset site state before build. Use to force full rebuilds. ResetState bool // If set, we re-create the sites from the given configuration before a build. // This is needed if new languages are added. NewConfig config.Provider // Skip rendering. Useful for testing. SkipRender bool // This is a partial re-render of some selected pages. This means // we should skip most of the processing. PartialReRender bool // Set in server mode when the last build failed for some reason. ErrRecovery bool // Recently visited URLs. This is used for partial re-rendering. RecentlyVisited map[string]bool // Can be set to build only with a sub set of the content source. ContentInclusionFilter *glob.FilenameFilter // Set when the buildlock is already acquired (e.g. the archetype content builder). NoBuildLock bool // contains filtered or unexported fields }
BuildCfg holds build options used to, as an example, skip the render step.
type ConfigSourceDescriptor ¶ added in v0.38.1
type ConfigSourceDescriptor struct { Fs afero.Fs Logger loggers.Logger // Path to the config file to use, e.g. /my/project/config.toml Filename string // The path to the directory to look for configuration. Is used if Filename is not // set or if it is set to a relative filename. Path string // The project's working dir. Is used to look for additional theme config. WorkingDir string // The (optional) directory for additional configuration files. AbsConfigDir string // production, development Environment string // Defaults to os.Environ if not set. Environ []string }
ConfigSourceDescriptor describes where to find the config (e.g. config.toml etc.).
type ContentFactory ¶ added in v0.89.0
type ContentFactory struct {
// contains filtered or unexported fields
}
ContentFactory creates content files from archetype templates.
func NewContentFactory ¶ added in v0.89.0
func NewContentFactory(h *HugoSites) ContentFactory
NewContentFactory creates a new ContentFactory for h.
func (ContentFactory) ApplyArchetypeFilename ¶ added in v0.95.0
func (f ContentFactory) ApplyArchetypeFilename(w io.Writer, p page.Page, archetypeKind, archetypeFilename string) error
ApplyArchetypeFilename archetypeFilename to w as a template using the given Page p as the foundation for the data context.
func (ContentFactory) ApplyArchetypeTemplate ¶ added in v0.95.0
func (f ContentFactory) ApplyArchetypeTemplate(w io.Writer, p page.Page, archetypeKind, templateSource string) error
ApplyArchetypeTemplate templateSource to w as a template using the given Page p as the foundation for the data context.
func (ContentFactory) CreateContentPlaceHolder ¶ added in v0.89.0
func (f ContentFactory) CreateContentPlaceHolder(filename string, force bool) (string, error)
CreateContentPlaceHolder creates a content placeholder file inside the best matching content directory.
func (ContentFactory) SectionFromFilename ¶ added in v0.89.0
func (f ContentFactory) SectionFromFilename(filename string) (string, error)
type HugoSites ¶
type HugoSites struct { Sites []*Site *deps.Deps // Keeps track of bundle directories and symlinks to enable partial rebuilding. ContentChanges *contentChangeMap // contains filtered or unexported fields }
HugoSites represents the sites to build. Each site represents a language.
func NewHugoSites ¶ added in v0.20.1
NewHugoSites creates HugoSites from the given config.
func (*HugoSites) Build ¶
Build builds all sites. If filesystem events are provided, this is considered to be a potential partial rebuild.
func (HugoSites) FatalError ¶ added in v0.55.0
func (f HugoSites) FatalError(err error)
FatalError error is used in some rare situations where it does not make sense to continue processing, to abort as soon as possible and log the error.
func (*HugoSites) GC ¶ added in v0.32.1
GC requires a build first and must run on it's own. It is not thread safe.
func (*HugoSites) GetContentPage ¶ added in v0.25.1
GetContentPage finds a Page with content given the absolute filename. Returns nil if none found.
func (HugoSites) IncrContentRender ¶ added in v0.63.0
func (h HugoSites) IncrContentRender()
func (HugoSites) IncrPageRender ¶ added in v0.92.2
func (h HugoSites) IncrPageRender()
func (*HugoSites) IsMultihost ¶ added in v0.31.1
func (*HugoSites) LanguageSet ¶ added in v0.49.1
TODO(bep) consolidate
func (*HugoSites) NumLogErrors ¶ added in v0.42.1
func (*HugoSites) PrintProcessingStats ¶ added in v0.32.1
type IntegrationTestBuilder ¶ added in v0.92.2
type IntegrationTestBuilder struct { *qt.C H *HugoSites Cfg IntegrationTestConfig // contains filtered or unexported fields }
IntegrationTestBuilder is a (partial) rewrite of sitesBuilder. The main problem with the "old" one was that it was that the test data was often a little hidden, so it became hard to look at a test and determine what it should do, especially coming back to the test after a year or so.
func NewIntegrationTestBuilder ¶ added in v0.92.2
func NewIntegrationTestBuilder(conf IntegrationTestConfig) *IntegrationTestBuilder
func (*IntegrationTestBuilder) AddFiles ¶ added in v0.92.2
func (s *IntegrationTestBuilder) AddFiles(filenameContent ...string) *IntegrationTestBuilder
func (*IntegrationTestBuilder) AssertBuildCountData ¶ added in v0.92.2
func (s *IntegrationTestBuilder) AssertBuildCountData(count int)
func (*IntegrationTestBuilder) AssertBuildCountGitInfo ¶ added in v0.92.2
func (s *IntegrationTestBuilder) AssertBuildCountGitInfo(count int)
func (*IntegrationTestBuilder) AssertBuildCountLayouts ¶ added in v0.92.2
func (s *IntegrationTestBuilder) AssertBuildCountLayouts(count int)
func (*IntegrationTestBuilder) AssertBuildCountTranslations ¶ added in v0.92.2
func (s *IntegrationTestBuilder) AssertBuildCountTranslations(count int)
func (*IntegrationTestBuilder) AssertDestinationExists ¶ added in v0.92.2
func (s *IntegrationTestBuilder) AssertDestinationExists(filename string, b bool)
func (*IntegrationTestBuilder) AssertFileContent ¶ added in v0.92.2
func (s *IntegrationTestBuilder) AssertFileContent(filename string, matches ...string)
func (*IntegrationTestBuilder) AssertFileContentExact ¶ added in v0.94.1
func (s *IntegrationTestBuilder) AssertFileContentExact(filename string, matches ...string)
func (*IntegrationTestBuilder) AssertIsFileError ¶ added in v0.92.2
func (s *IntegrationTestBuilder) AssertIsFileError(err error) herrors.FileError
func (*IntegrationTestBuilder) AssertLogContains ¶ added in v0.92.2
func (s *IntegrationTestBuilder) AssertLogContains(text string)
func (*IntegrationTestBuilder) AssertLogMatches ¶ added in v0.96.0
func (s *IntegrationTestBuilder) AssertLogMatches(expression string)
func (*IntegrationTestBuilder) AssertRenderCountContent ¶ added in v0.92.2
func (s *IntegrationTestBuilder) AssertRenderCountContent(count int)
func (*IntegrationTestBuilder) AssertRenderCountPage ¶ added in v0.92.2
func (s *IntegrationTestBuilder) AssertRenderCountPage(count int)
func (*IntegrationTestBuilder) Build ¶ added in v0.92.2
func (s *IntegrationTestBuilder) Build() *IntegrationTestBuilder
func (*IntegrationTestBuilder) BuildE ¶ added in v0.92.2
func (s *IntegrationTestBuilder) BuildE() (*IntegrationTestBuilder, error)
func (*IntegrationTestBuilder) EditFileReplace ¶ added in v0.92.2
func (s *IntegrationTestBuilder) EditFileReplace(filename string, replacementFunc func(s string) string) *IntegrationTestBuilder
func (*IntegrationTestBuilder) EditFiles ¶ added in v0.92.2
func (s *IntegrationTestBuilder) EditFiles(filenameContent ...string) *IntegrationTestBuilder
func (*IntegrationTestBuilder) FileContent ¶ added in v0.92.2
func (s *IntegrationTestBuilder) FileContent(filename string) string
func (*IntegrationTestBuilder) RemoveFiles ¶ added in v0.92.2
func (s *IntegrationTestBuilder) RemoveFiles(filenames ...string) *IntegrationTestBuilder
func (*IntegrationTestBuilder) RenameFile ¶ added in v0.92.2
func (s *IntegrationTestBuilder) RenameFile(old, new string) *IntegrationTestBuilder
type IntegrationTestConfig ¶ added in v0.92.2
type IntegrationTestConfig struct { T testing.TB // The files to use on txtar format, see // https://pkg.go.dev/golang.org/x/exp/cmd/txtar TxtarString string // Whether to simulate server mode. Running bool // Will print the log buffer after the build Verbose bool LogLevel jww.Threshold // Whether it needs the real file system (e.g. for js.Build tests). NeedsOsFS bool // Do not remove the temp dir after the test. PrintAndKeepTempDir bool // Whether to run npm install before Build. NeedsNpmInstall bool WorkingDir string }
type IntegrationTestDebugConfig ¶ added in v0.92.2
type Multilingual ¶
type Multilingual struct { Languages langs.Languages DefaultLang *langs.Language // contains filtered or unexported fields }
Multilingual manages the all languages used in a multilingual site.
type OrderedTaxonomy ¶
type OrderedTaxonomy []OrderedTaxonomyEntry
OrderedTaxonomy is another representation of an Taxonomy using an array rather than a map. Important because you can't order a map.
func (OrderedTaxonomy) Reverse ¶
func (t OrderedTaxonomy) Reverse() OrderedTaxonomy
Reverse reverses the order of the entries in this taxonomy.
type OrderedTaxonomyEntry ¶
type OrderedTaxonomyEntry struct { Name string page.WeightedPages }
OrderedTaxonomyEntry is similar to an element of a Taxonomy, but with the key embedded (as name) e.g: {Name: Technology, page.WeightedPages: TaxonomyPages}
func (OrderedTaxonomyEntry) Count ¶
func (ie OrderedTaxonomyEntry) Count() int
Count returns the count the pages in this taxonomy.
func (OrderedTaxonomyEntry) Pages ¶
func (ie OrderedTaxonomyEntry) Pages() page.Pages
Pages returns the Pages for this taxonomy.
func (OrderedTaxonomyEntry) Term ¶
func (ie OrderedTaxonomyEntry) Term() string
Term returns the name given to this taxonomy.
type PageCollections ¶
type PageCollections struct {
// contains filtered or unexported fields
}
PageCollections contains the page collections for a site.
func (*PageCollections) AllPages ¶
func (c *PageCollections) AllPages() page.Pages
AllPages returns all pages for all languages.
func (*PageCollections) AllRegularPages ¶
func (c *PageCollections) AllRegularPages() page.Pages
AllPages returns all regular pages for all languages.
func (*PageCollections) Pages ¶
func (c *PageCollections) Pages() page.Pages
Pages returns all pages. This is for the current language only.
func (*PageCollections) RegularPages ¶
func (c *PageCollections) RegularPages() page.Pages
RegularPages returns all the regular pages. This is for the current language only.
type Permalinker ¶ added in v0.20.1
Permalinker provides permalinks of both the relative and absolute kind.
type ShortcodeWithPage ¶
type ShortcodeWithPage struct { Params any Inner template.HTML Page page.Page Parent *ShortcodeWithPage Name string IsNamedParams bool // Zero-based ordinal in relation to its parent. If the parent is the page itself, // this ordinal will represent the position of this shortcode in the page content. Ordinal int // contains filtered or unexported fields }
ShortcodeWithPage is the "." context in a shortcode template.
func (*ShortcodeWithPage) Get ¶
func (scp *ShortcodeWithPage) Get(key any) any
Get is a convenience method to look up shortcode parameters by its key.
func (*ShortcodeWithPage) InnerDeindent ¶ added in v0.100.0
func (scp *ShortcodeWithPage) InnerDeindent() template.HTML
InnerDeindent returns the (potentially de-indented) inner content of the shortcode.
func (*ShortcodeWithPage) Position ¶ added in v0.54.0
func (scp *ShortcodeWithPage) Position() text.Position
Position returns this shortcode's detailed position. Note that this information may be expensive to calculate, so only use this in error situations.
func (*ShortcodeWithPage) Ref ¶
func (scp *ShortcodeWithPage) Ref(args map[string]any) (string, error)
Ref is a shortcut to the Ref method on Page. It passes itself as a context to get better error messages.
func (*ShortcodeWithPage) RelRef ¶
func (scp *ShortcodeWithPage) RelRef(args map[string]any) (string, error)
RelRef is a shortcut to the RelRef method on Page. It passes itself as a context to get better error messages.
func (*ShortcodeWithPage) Scratch ¶
func (scp *ShortcodeWithPage) Scratch() *maps.Scratch
Scratch returns a scratch-pad scoped for this shortcode. This can be used as a temporary storage for variables, counters etc.
func (*ShortcodeWithPage) Site ¶
func (scp *ShortcodeWithPage) Site() page.Site
Site returns information about the current site.
type Site ¶
type Site struct { *PageCollections Sections Taxonomy Info *SiteInfo // Logger etc. *deps.Deps `json:"-"` // contains filtered or unexported fields }
Site contains all the information relevant for constructing a static site. The basic flow of information is as follows:
1. A list of Files is parsed and then converted into Pages.
- Pages contain sections (based on the file they were generated from), aliases and slugs (included in a pages frontmatter) which are the various targets that will get generated. There will be canonical listing. The canonical path can be overruled based on a pattern.
- Taxonomies are created via configuration and will present some aspect of the final page and typically a perm url.
- All Pages are passed through a template based on their desired layout based on numerous different elements.
5. The entire collection of files is written to disk.
func NewEnglishSite ¶ added in v0.20.1
func NewEnglishSite(withTemplate ...func(templ tpl.TemplateManager) error) (*Site, error)
NewEnglishSite creates a new site in English language. The site will have a template system loaded and ready to use. Note: This is mainly used in single site tests. TODO(bep) test refactor -- remove
func NewSite ¶ added in v0.20.1
NewSite creates a new site with the given dependency configuration. The site will have a template system loaded and ready to use. Note: This is mainly used in single site tests.
func NewSiteDefaultLang ¶ added in v0.20.1
func NewSiteDefaultLang(withTemplate ...func(templ tpl.TemplateManager) error) (*Site, error)
NewSiteDefaultLang creates a new site in the default language. The site will have a template system loaded and ready to use. Note: This is mainly used in single site tests. TODO(bep) test refactor -- remove
func NewSiteForCfg ¶ added in v0.20.1
NewSiteForCfg creates a new site for the given configuration. The site will have a template system loaded and ready to use. Note: This is mainly used in single site tests.
func (*Site) GetRelatedDocsHandler ¶ added in v0.55.0
func (s *Site) GetRelatedDocsHandler() *page.RelatedDocsHandler
func (*Site) Initialise ¶
func (*Site) Menus ¶
func (s *Site) Menus() navigation.Menus
func (*Site) RegisterMediaTypes ¶ added in v0.20.1
func (s *Site) RegisterMediaTypes()
RegisterMediaTypes will register the Site's media types in the mime package, so it will behave correctly with Hugo's built-in server.
func (*Site) Taxonomies ¶
func (s *Site) Taxonomies() TaxonomyList
type SiteConfig ¶ added in v0.42.1
type SiteConfig struct { // This contains all privacy related settings that can be used to // make the YouTube template etc. GDPR compliant. Privacy privacy.Config // Services contains config for services such as Google Analytics etc. Services services.Config }
SiteConfig represents the config in .Site.Config.
type SiteInfo ¶
type SiteInfo struct { Authors page.AuthorList Social SiteSocial RSSLink string Author map[string]any LanguageCode string Copyright string LanguagePrefix string Languages langs.Languages BuildDrafts bool // contains filtered or unexported fields }
func (*SiteInfo) AllRegularPages ¶ added in v0.55.0
func (*SiteInfo) Config ¶ added in v0.42.1
func (s *SiteInfo) Config() SiteConfig
func (*SiteInfo) Current ¶ added in v0.97.0
Current returns the currently rendered Site. If that isn't set yet, which is the situation before we start rendering, if will return the Site itself.
func (*SiteInfo) DisqusShortname ¶
DisqusShortname is kept here for historic reasons.
func (*SiteInfo) GetPage ¶
GetPage looks up a page of a given type for the given ref. In Hugo <= 0.44 you had to add Page Kind (section, home) etc. as the first argument and then either a unix styled path (with or without a leading slash)) or path elements separated. When we now remove the Kind from this API, we need to make the transition as painless as possible for existing sites. Most sites will use {{ .Site.GetPage "section" "my/section" }}, i.e. 2 arguments, so we test for that.
func (*SiteInfo) GetPageWithTemplateInfo ¶ added in v0.75.0
func (*SiteInfo) GoogleAnalytics ¶
GoogleAnalytics is kept here for historic reasons.
func (*SiteInfo) Home ¶ added in v0.22.1
Home is a shortcut to the home page, equivalent to .Site.GetPage "home".
func (*SiteInfo) HomeAbsURL ¶
HomeAbsURL is a convenience method giving the absolute URL to the home page.
func (*SiteInfo) IsMultiLingual ¶
func (*SiteInfo) LastChange ¶
func (*SiteInfo) Menus ¶
func (s *SiteInfo) Menus() navigation.Menus
func (*SiteInfo) Param ¶
Param is a convenience method to do lookups in SiteInfo's Params map.
This method is also implemented on Page.
func (*SiteInfo) RegularPages ¶ added in v0.55.0
func (*SiteInfo) ServerPort ¶ added in v0.31.1
ServerPort returns the port part of the BaseURL, 0 if none found.
func (*SiteInfo) SitemapAbsURL ¶
SitemapAbsURL is a convenience method giving the absolute URL to the sitemap.
type SiteSocial ¶
SiteSocial is a place to put social details on a site level. These are the standard keys that themes will expect to have available, but can be expanded to any others on a per site basis github facebook facebook_admin twitter twitter_domain pinterest instagram youtube linkedin
type Taxonomy ¶
type Taxonomy map[string]page.WeightedPages
A Taxonomy is a map of keywords to a list of pages. For example
TagTaxonomy['technology'] = page.WeightedPages TagTaxonomy['go'] = page.WeightedPages
func (Taxonomy) Alphabetical ¶
func (i Taxonomy) Alphabetical() OrderedTaxonomy
Alphabetical returns an ordered taxonomy sorted by key name.
func (Taxonomy) ByCount ¶
func (i Taxonomy) ByCount() OrderedTaxonomy
ByCount returns an ordered taxonomy sorted by # of pages per key. If taxonomies have the same # of pages, sort them alphabetical
func (Taxonomy) Get ¶
func (i Taxonomy) Get(key string) page.WeightedPages
Get the weighted pages for the given key.
func (Taxonomy) TaxonomyArray ¶
func (i Taxonomy) TaxonomyArray() OrderedTaxonomy
TaxonomyArray returns an ordered taxonomy with a non defined order.
type TaxonomyList ¶
The TaxonomyList is a list of all taxonomies and their values e.g. List['tags'] => TagTaxonomy (from above)
func (TaxonomyList) String ¶
func (tl TaxonomyList) String() string
Source Files ¶
- alias.go
- codeowners.go
- collections.go
- config.go
- content_factory.go
- content_map.go
- content_map_page.go
- fileInfo.go
- gitinfo.go
- hugo_sites.go
- hugo_sites_build.go
- integrationtest_builder.go
- multilingual.go
- page.go
- page__common.go
- page__content.go
- page__data.go
- page__menus.go
- page__meta.go
- page__new.go
- page__output.go
- page__paginator.go
- page__paths.go
- page__per_output.go
- page__position.go
- page__ref.go
- page__tree.go
- page_kinds.go
- page_unwrap.go
- pagecollections.go
- pages_capture.go
- pages_process.go
- permalinker.go
- prune_resources.go
- shortcode.go
- shortcode_page.go
- site.go
- site_output.go
- site_render.go
- site_sections.go
- taxonomy.go
- translations.go
Directories ¶
Path | Synopsis |
---|---|
Package filesystems provides the fine grained file systems used by Hugo.
|
Package filesystems provides the fine grained file systems used by Hugo. |