extractSource extracts the source field from frontmatter
(frontmatter map[string]any)
| 57 | |
| 58 | // extractSource extracts the source field from frontmatter |
| 59 | func (c *Compiler) extractSource(frontmatter map[string]any) string { |
| 60 | value, exists := frontmatter["source"] |
| 61 | if !exists { |
| 62 | return "" |
| 63 | } |
| 64 | |
| 65 | // Convert the value to string |
| 66 | if strValue, ok := value.(string); ok { |
| 67 | return strings.TrimSpace(strValue) |
| 68 | } |
| 69 | |
| 70 | return "" |
| 71 | } |
| 72 | |
| 73 | // extractRedirect extracts the redirect field from frontmatter |
| 74 | func (c *Compiler) extractRedirect(frontmatter map[string]any) string { |
no outgoing calls