Skip to content

Commit 47affc1

Browse files
authored
Merge pull request #2 from donseba/css
fix importmap render
2 parents f1b654b + 743d2a3 commit 47affc1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

importmap.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,14 @@ func (im *ImportMap) Render() (template.HTML, error) {
300300
if len(im.Structure.Imports) > 0 {
301301
out += `<script type="importmap">
302302
`
303-
b, err := json.MarshalIndent(im.Structure.Imports, "", " ")
303+
304+
data := struct {
305+
Imports map[string]string `json:"imports"`
306+
}{
307+
Imports: im.Structure.Imports,
308+
}
309+
310+
b, err := json.MarshalIndent(data, "", " ")
304311
if err != nil {
305312
return "", err
306313
}

0 commit comments

Comments
 (0)