mirror of
https://github.com/lancatlin/mdsh.git
synced 2026-11-08 03:30:12 +08:00
feat: parse template meta
This commit is contained in:
1 parent
70837bf6b1
commit
99f6e8cefd
5 files changed
+53
-2
No files matched your search
@@ -10,7 +10,12 @@ import (
|
||||
|
||||
var tmpl = `
|
||||
---
|
||||
title: This is the title
|
||||
output: "reports/${from}.md"
|
||||
params:
|
||||
from:
|
||||
required: true
|
||||
file:
|
||||
default: "ledger.j"
|
||||
---
|
||||
Hello this is the text:
|
||||
{{ sh "hledger bal assets" }}
|
||||
@@ -50,7 +55,11 @@ func main() {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Printf("'%s'", frontmatter)
|
||||
templateMeta, err := parseFrontmatter(frontmatter)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Printf("'%s'", templateMeta)
|
||||
t, err := template.New("foo").Funcs(funcMap).Parse(body)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
||||
Reference in new issue
Block a user