Skip to content

Commit

Permalink
fix importmap render
Browse files Browse the repository at this point in the history
  • Loading branch information
donseba committed Mar 25, 2024
1 parent fd52c17 commit 743d2a3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion importmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,14 @@ func (im *ImportMap) Render() (template.HTML, error) {
if len(im.Structure.Imports) > 0 {
out += `<script type="importmap">
`
b, err := json.MarshalIndent(im.Structure.Imports, "", " ")

data := struct {
Imports map[string]string `json:"imports"`
}{
Imports: im.Structure.Imports,
}

b, err := json.MarshalIndent(data, "", " ")
if err != nil {
return "", err
}
Expand Down

0 comments on commit 743d2a3

Please sign in to comment.