1
0
mirror of https://github.com/gohugoio/hugo.git synced 2024-05-11 05:54:58 +00:00

resource: Implement Resource.Content

Fixes #4622
This commit is contained in:
Bjørn Erik Pedersen
2018-04-15 17:07:49 +02:00
parent 417c5e2b67
commit 0e7716a424
3 changed files with 48 additions and 0 deletions

View File

@@ -322,6 +322,18 @@ func TestSVGImage(t *testing.T) {
assert.NotNil(svg)
}
func TestSVGImageContent(t *testing.T) {
assert := require.New(t)
spec := newTestResourceSpec(assert)
svg := fetchResourceForSpec(spec, assert, "circle.svg")
assert.NotNil(svg)
content, err := svg.Content()
assert.NoError(err)
assert.IsType("", content)
assert.Contains(content.(string), `<svg height="100" width="100">`)
}
func BenchmarkResizeParallel(b *testing.B) {
assert := require.New(b)
img := fetchSunset(assert)