1
0
mirror of https://github.com/gohugoio/hugo.git synced 2024-05-11 05:54:58 +00: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:
Bjørn Erik Pedersen
2018-01-15 20:40:39 +01:00
parent f8a119b606
commit 20c9b6ec81
27 changed files with 627 additions and 187 deletions

View File

@@ -129,7 +129,7 @@ func (p Pages) ByTitle() Pages {
key := "pageSort.ByTitle"
title := func(p1, p2 *Page) bool {
return p1.Title < p2.Title
return p1.title < p2.title
}
pages, _ := spc.get(key, p, pageBy(title).Sort)