aboutsummaryrefslogtreecommitdiffhomepage
path: root/output/outputFormat.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2017-06-20 17:20:08 +0200
committerBjørn Erik Pedersen <[email protected]>2017-06-20 17:21:31 +0200
commitc43b512b4700f76ac77f12d632bb030c3a241393 (patch)
tree6df60d19c0abd5bd6c971d2cbd941f78223dbb82 /output/outputFormat.go
parent19f2e729135af700c5d4aa06e7b3540e6d4847fd (diff)
downloadhugo-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.go7
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
}