diff options
author | Bjørn Erik Pedersen <[email protected]> | 2017-06-20 17:20:08 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2017-06-20 17:21:31 +0200 |
commit | c43b512b4700f76ac77f12d632bb030c3a241393 (patch) | |
tree | 6df60d19c0abd5bd6c971d2cbd941f78223dbb82 /output/outputFormat.go | |
parent | 19f2e729135af700c5d4aa06e7b3540e6d4847fd (diff) | |
download | hugo-c43b512b4700f76ac77f12d632bb030c3a241393.tar.gz hugo-c43b512b4700f76ac77f12d632bb030c3a241393.zip |
output: Identify extension-less text types as text
See #3614
Diffstat (limited to 'output/outputFormat.go')
-rw-r--r-- | output/outputFormat.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/output/outputFormat.go b/output/outputFormat.go index 6e5f42930..2b75120f5 100644 --- a/output/outputFormat.go +++ b/output/outputFormat.go @@ -219,7 +219,12 @@ func (formats Formats) FromFilename(filename string) (f Format, found bool) { } if ext != "" { - return formats.GetBySuffix(ext) + f, found = formats.GetBySuffix(ext) + if !found && len(parts) == 2 { + // For extensionless output formats (e.g. Netlify's _redirects) + // we must fall back to using the extension as format lookup. + f, found = formats.GetByName(ext) + } } return } |