Skip to content

Commit

Permalink
Fix extraction of parameters in content
Browse files Browse the repository at this point in the history
  • Loading branch information
jlelse committed Dec 19, 2023
1 parent 7c6d035 commit 12657e5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion micropub.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,11 +333,12 @@ func (a *goBlog) extractParamsFromContent(p *post) error {
// Copy frontmatter to parameters
for key, value := range meta {
if a, ok := value.([]any); ok {
p.Parameters[key] = []string{}
for _, ae := range a {
p.Parameters[key] = append(p.Parameters[key], cast.ToString(ae))
}
} else {
p.Parameters[key] = append(p.Parameters[key], cast.ToString(value))
p.Parameters[key] = []string{cast.ToString(value)}
}
}

Expand Down

0 comments on commit 12657e5

Please sign in to comment.