mirror of
https://github.com/lancatlin/mdsh.git
synced 2026-11-05 19:30:12 +08:00
17 lines
265 B
Go
17 lines
265 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"gopkg.in/yaml.v3"
|
|
)
|
|
|
|
func parseFrontmatter(input string) (meta TemplateMeta, err error) {
|
|
err = yaml.Unmarshal([]byte(input), &meta)
|
|
if err != nil {
|
|
err = fmt.Errorf("Failed to parse frontmatter: %w", err)
|
|
return
|
|
}
|
|
return
|
|
}
|