Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-12-17 11:33:26 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-12-18 00:20:12 +0300
commit81975f847dc19c21c2321207645807771db97fab (patch)
tree6658282e788f305d5c3a6c55692921ff317732f5 /hugolib
parent8103188b9b9e8eeb3bcb53c8b64e2b83397e82ae (diff)
Fix Resource.ResourceType so it always returns MIME's main type
The one exception being for the Page, which does not have a MIME type, in which you will get the value `page`. Fixes #8052
Diffstat (limited to 'hugolib')
-rw-r--r--hugolib/content_map_test.go4
-rw-r--r--hugolib/pagebundler_test.go4
-rw-r--r--hugolib/resource_chain_test.go2
3 files changed, 5 insertions, 5 deletions
diff --git a/hugolib/content_map_test.go b/hugolib/content_map_test.go
index 9d7212735..e5ba983a4 100644
--- a/hugolib/content_map_test.go
+++ b/hugolib/content_map_test.go
@@ -423,9 +423,9 @@ Draft5: {{ if (.Site.GetPage "blog/draftsection/sub/page") }}FOUND{{ end }}|
Home: Hugo Home|/|2019-06-08|Current Section: |Resources:
Blog Section: Blogs|/blog/|2019-06-08|Current Section: blog|Resources:
- Blog Sub Section: Page 3|/blog/subsection/|2019-06-03|Current Section: blog/subsection|Resources: json: /blog/subsection/subdata.json|
+ Blog Sub Section: Page 3|/blog/subsection/|2019-06-03|Current Section: blog/subsection|Resources: application: /blog/subsection/subdata.json|
Page: Page 1|/blog/page1/|2019-06-01|Current Section: blog|Resources:
- Bundle: Page 12|/blog/bundle/|0001-01-01|Current Section: blog|Resources: json: /blog/bundle/data.json|page: |
+ Bundle: Page 12|/blog/bundle/|0001-01-01|Current Section: blog|Resources: application: /blog/bundle/data.json|page: |
IsDescendant: true: true true: true true: true true: true true: true true: true false: false
IsAncestor: true: true true: true true: true true: true true: true true: true true: true false: false false: false false: false
IsDescendant overlap1: false: false
diff --git a/hugolib/pagebundler_test.go b/hugolib/pagebundler_test.go
index 5589a3e32..fc02d5857 100644
--- a/hugolib/pagebundler_test.go
+++ b/hugolib/pagebundler_test.go
@@ -707,7 +707,7 @@ func newTestBundleSources(t testing.TB) (*hugofs.Fs, *viper.Viper) {
cfg.Set("contentDir", "base")
cfg.Set("baseURL", "https://example.com")
cfg.Set("mediaTypes", map[string]interface{}{
- "text/bepsays": map[string]interface{}{
+ "bepsays/bep": map[string]interface{}{
"suffixes": []string{"bep"},
},
})
@@ -1234,7 +1234,7 @@ title: %q
b.Build(BuildCfg{})
b.AssertFileContent("public/bundle/index.html", `
- json|sub/data.json|
+ application|sub/data.json|
page|bundle p1|
page|bundle sub index|
page|bundle sub p2|
diff --git a/hugolib/resource_chain_test.go b/hugolib/resource_chain_test.go
index 5ee62254a..4f93115f9 100644
--- a/hugolib/resource_chain_test.go
+++ b/hugolib/resource_chain_test.go
@@ -383,7 +383,7 @@ End.`)
b.AssertFileContent("public/index.html",
`Start.
HELLO: /hello.min.a2d1cb24f24b322a7dad520414c523e9.html|Integrity: md5-otHLJPJLMip9rVIEFMUj6Q==|MediaType: text/html
-HELLO2: Name: hello.html|Content: <h1>Hello World!</h1>|Title: hello.html|ResourceType: html
+HELLO2: Name: hello.html|Content: <h1>Hello World!</h1>|Title: hello.html|ResourceType: text
End.`)
b.AssertFileContent("public/page1/index.html", `HELLO: /hello.min.a2d1cb24f24b322a7dad520414c523e9.html`)