mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02: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:
@@ -200,11 +200,11 @@ permalinkeds:
|
||||
if preserveTaxonomyNames {
|
||||
helloWorld := s.getPage(KindTaxonomy, "others", "Hello Hugo world")
|
||||
require.NotNil(t, helloWorld)
|
||||
require.Equal(t, "Hello Hugo world", helloWorld.Title)
|
||||
require.Equal(t, "Hello Hugo world", helloWorld.title)
|
||||
} else {
|
||||
helloWorld := s.getPage(KindTaxonomy, "others", "hello-hugo-world")
|
||||
require.NotNil(t, helloWorld)
|
||||
require.Equal(t, "Hello Hugo World", helloWorld.Title)
|
||||
require.Equal(t, "Hello Hugo World", helloWorld.title)
|
||||
}
|
||||
|
||||
// Issue #2977
|
||||
|
Reference in New Issue
Block a user