reconstructContent rebuilds the full markdown content from frontmatter lines and body
(frontmatterLines []string, markdown string)
| 24 | |
| 25 | // reconstructContent rebuilds the full markdown content from frontmatter lines and body |
| 26 | func reconstructContent(frontmatterLines []string, markdown string) string { |
| 27 | var lines []string |
| 28 | lines = append(lines, "---") |
| 29 | lines = append(lines, frontmatterLines...) |
| 30 | lines = append(lines, "---") |
| 31 | if markdown != "" { |
| 32 | lines = append(lines, "") |
| 33 | lines = append(lines, markdown) |
| 34 | } |
| 35 | return strings.Join(lines, "\n") |
| 36 | } |
| 37 | |
| 38 | // parseFrontmatterLines extracts frontmatter lines from content |
| 39 | func parseFrontmatterLines(content string) ([]string, string, error) { |
no outgoing calls