mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
output: Rework the base template logic
Extract the logic to a testable function and add support for custom output types. Fixes #2995
This commit is contained in:
@@ -34,10 +34,10 @@ func TestDefaultTypes(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestGetType(t *testing.T) {
|
||||
tp, _ := GetType("html")
|
||||
tp, _ := GetFormat("html")
|
||||
require.Equal(t, HTMLType, tp)
|
||||
tp, _ = GetType("HTML")
|
||||
tp, _ = GetFormat("HTML")
|
||||
require.Equal(t, HTMLType, tp)
|
||||
_, found := GetType("FOO")
|
||||
_, found := GetFormat("FOO")
|
||||
require.False(t, found)
|
||||
}
|
||||
|
Reference in New Issue
Block a user