resource: Add front matter metadata to Resource
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 15 Jan 2018 19:40:39 +0000 (20:40 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 17 Jan 2018 15:22:33 +0000 (16:22 +0100)
commit20c9b6ec81171d1c586ea31d5d08b40b0edaffc6
tree990d2709c1333663dce2ff97f16f8791fef3bac9
parentf8a119b606d55aa4f31f16e5a3cadc929c99e4f8
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
27 files changed:
hugolib/hugo_sites_build_test.go
hugolib/node_as_page_test.go
hugolib/page.go
hugolib/pageGroup_test.go
hugolib/pageSort.go
hugolib/pageSort_test.go
hugolib/page_bundler_handlers.go
hugolib/page_bundler_test.go
hugolib/page_collections_test.go
hugolib/page_paths.go
hugolib/page_test.go
hugolib/pages_related_test.go
hugolib/pagination.go
hugolib/permalinks.go
hugolib/site.go
hugolib/site_render.go
hugolib/site_sections_test.go
hugolib/site_test.go
hugolib/taxonomy.go
hugolib/taxonomy_test.go
hugolib/testhelpers_test.go
magefile.go
resource/image.go
resource/image_cache.go
resource/image_test.go
resource/resource.go
resource/resource_test.go