diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-01-15 20:40:39 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-01-17 16:22:33 +0100 |
commit | 20c9b6ec81171d1c586ea31d5d08b40b0edaffc6 (patch) | |
tree | 990d2709c1333663dce2ff97f16f8791fef3bac9 /hugolib/pagination.go | |
parent | f8a119b606d55aa4f31f16e5a3cadc929c99e4f8 (diff) |
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
Diffstat (limited to 'hugolib/pagination.go')
-rw-r--r-- | hugolib/pagination.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hugolib/pagination.go b/hugolib/pagination.go index 6d27f65ca..86113271b 100644 --- a/hugolib/pagination.go +++ b/hugolib/pagination.go @@ -270,7 +270,7 @@ func (p *Page) Paginator(options ...interface{}) (*Pager, error) { // If it's not, one will be created with all pages in Data["Pages"]. func (p *PageOutput) Paginator(options ...interface{}) (*Pager, error) { if !p.IsNode() { - return nil, fmt.Errorf("Paginators not supported for pages of type %q (%q)", p.Kind, p.Title) + return nil, fmt.Errorf("Paginators not supported for pages of type %q (%q)", p.Kind, p.title) } pagerSize, err := resolvePagerSize(p.s.Cfg, options...) @@ -321,7 +321,7 @@ func (p *Page) Paginate(seq interface{}, options ...interface{}) (*Pager, error) // Note that repeated calls will return the same result, even if the sequence is different. func (p *PageOutput) Paginate(seq interface{}, options ...interface{}) (*Pager, error) { if !p.IsNode() { - return nil, fmt.Errorf("Paginators not supported for pages of type %q (%q)", p.Kind, p.Title) + return nil, fmt.Errorf("Paginators not supported for pages of type %q (%q)", p.Kind, p.title) } pagerSize, err := resolvePagerSize(p.s.Cfg, options...) |