Documentation ¶
Index ¶
- func LoadConfig(d ConfigSourceDescriptor) (config.Provider, []string, error)
- type BuildCfg
- type ConfigSourceDescriptor
- type HugoSites
- type PageCollections
- type Permalinker
- type Site
- type SiteInfo
- func (s *SiteInfo) AllPages() page.Pages
- func (s *SiteInfo) AllRegularPages() page.Pages
- func (s *SiteInfo) BaseURL() template.URL
- func (s *SiteInfo) Current() page.Site
- func (s *SiteInfo) Data() map[string]any
- func (s *SiteInfo) Home() page.Page
- func (s *SiteInfo) Pages() page.Pages
- func (s *SiteInfo) Params() maps.Params
- func (s *SiteInfo) RegularPages() page.Pages
- func (s *SiteInfo) Sections() page.Pages
- func (s *SiteInfo) Site() page.Site
- func (s *SiteInfo) Sites() page.Sites
- func (s *SiteInfo) String() string
- func (s *SiteInfo) Title() string
- type Taxonomy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadConfig ¶
func LoadConfig(d ConfigSourceDescriptor) (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 { // Can be set to build only with a sub set of the content source. ContentInclusionFilter *glob.FilenameFilter }
BuildCfg holds build options used to, as an example, skip the render step.
type ConfigSourceDescriptor ¶
type ConfigSourceDescriptor struct { Fs afero.Fs // Path to the config file to use, e.g. /my/project/config.toml // Multiple config files supported, e.g. 'config.toml, abc.toml' // In our case, one config file is just right Filename string // The project's working dir. Is used to look for additional theme config. WorkingDir string }
ConfigSourceDescriptor describes where to find the config (e.g. config.toml etc.).
type HugoSites ¶
HugoSites represents the sites to build. Each site represents a language.
func NewHugoSites ¶
NewHugoSites creates HugoSites from the given config.
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
AllRegularPages 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 ¶
Permalinker provides permalinks of both the relative and absolute kind.
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.
type SiteInfo ¶
type SiteInfo struct {
// contains filtered or unexported fields
}
func (*SiteInfo) AllRegularPages ¶
func (*SiteInfo) Current ¶
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) RegularPages ¶
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
Source Files ¶
- config.go
- content_map.go
- content_map_page.go
- fileinfo.go
- hugo_sites.go
- hugo_sites_build.go
- multilingual.go
- page.go
- page__common.go
- page__content.go
- page__data.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
- shortcode_page.go
- site.go
- site_output.go
- site_render.go
- site_sections.go
- taxonomy.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. |