summaryrefslogtreecommitdiffstats
path: root/hugolib/site_output_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-07-10 11:55:22 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-07-10 22:13:52 +0200
commitb874a1ba7ab8394dc741c8c70303a30a35b63e43 (patch)
tree756a5869cf623ace8387fcf6166a831c052f0ae7 /hugolib/site_output_test.go
parent4108705934846f2b7cae2602ce14aeee17139608 (diff)
media: Allow multiple file suffixes per media type
Before this commit, `Suffix` on `MediaType` was used both to set a custom file suffix and as a way to augment the mediatype definition (what you see after the "+", e.g. "image/svg+xml"). This had its limitations. For one, it was only possible with one file extension per MIME type. Now you can specify multiple file suffixes using "suffixes", but you need to specify the full MIME type identifier: [mediaTypes] [mediaTypes."image/svg+xml"] suffixes = ["svg", "abc ] In most cases, it will be enough to just change: [mediaTypes] [mediaTypes."my/custom-mediatype"] suffix = "txt" To: [mediaTypes] [mediaTypes."my/custom-mediatype"] suffixes = ["txt"] Hugo will still respect values set in "suffix" if no value for "suffixes" is provided, but this will be removed in a future release. Note that you can still get the Media Type's suffix from a template: {{ $mediaType.Suffix }}. But this will now map to the MIME type filename. Fixes #4920
Diffstat (limited to 'hugolib/site_output_test.go')
-rw-r--r--hugolib/site_output_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/hugolib/site_output_test.go b/hugolib/site_output_test.go
index 5f864538e..0677dfbfb 100644
--- a/hugolib/site_output_test.go
+++ b/hugolib/site_output_test.go
@@ -179,7 +179,7 @@ Len Pages: {{ .Kind }} {{ len .Site.RegularPages }} Page Number: {{ .Paginator.P
th.assertFileContent("public/index.html",
// The HTML entity is a deliberate part of this test: The HTML templates are
// parsed with html/template.
- `List HTML|JSON Home|<atom:link href=http://example.com/blog/ rel="self" type="text/html&#43;html" />`,
+ `List HTML|JSON Home|<atom:link href=http://example.com/blog/ rel="self" type="text/html" />`,
"en: Elbow",
"ShortHTML",
"OtherShort: <h1>Hi!</h1>",
@@ -195,7 +195,7 @@ Len Pages: {{ .Kind }} {{ len .Site.RegularPages }} Page Number: {{ .Paginator.P
th.assertFileContent("public/index.json",
"Output/Rel: JSON/canonical|",
// JSON is plain text, so no need to safeHTML this and that
- `<atom:link href=http://example.com/blog/index.json rel="self" type="application/json+json" />`,
+ `<atom:link href=http://example.com/blog/index.json rel="self" type="application/json" />`,
"ShortJSON",
"OtherShort: <h1>Hi!</h1>",
)