mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 14:10:31 +03:00
resource: Add front matter metadata to Resource
This commit expands the Resource interface with 3 new methods: * Name * Title * Params All of these can be set in the Page front matter. `Name` will get its default value from the base filename, and is the value used in the ByPrefix and GetByPrefix lookup methods. Fixes #4244
This commit is contained in:
parent
f8a119b606
commit
20c9b6ec81
27 changed files with 627 additions and 187 deletions
|
@ -212,7 +212,7 @@ func (s *Site) renderPaginator(p *PageOutput) error {
|
|||
|
||||
if err := s.renderAndWritePage(
|
||||
&s.PathSpec.ProcessingStats.PaginatorPages,
|
||||
pagerNode.Title,
|
||||
pagerNode.title,
|
||||
targetPath, pagerNode, layouts...); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -252,7 +252,7 @@ func (s *Site) renderRSS(p *PageOutput) error {
|
|||
return err
|
||||
}
|
||||
|
||||
return s.renderAndWriteXML(&s.PathSpec.ProcessingStats.Pages, p.Title,
|
||||
return s.renderAndWriteXML(&s.PathSpec.ProcessingStats.Pages, p.title,
|
||||
targetPath, p, layouts...)
|
||||
}
|
||||
|
||||
|
@ -267,7 +267,7 @@ func (s *Site) render404() error {
|
|||
|
||||
p := s.newNodePage(kind404)
|
||||
|
||||
p.Title = "404 Page not found"
|
||||
p.title = "404 Page not found"
|
||||
p.Data["Pages"] = s.Pages
|
||||
p.Pages = s.Pages
|
||||
p.URLPath.URL = "404.html"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue