toString coerces a scalar frontmatter value to string. Values originate as strings in practice; non-strings are rendered defensively.
(v any)
| 92 | // toString coerces a scalar frontmatter value to string. Values originate as |
| 93 | // strings in practice; non-strings are rendered defensively. |
| 94 | func toString(v any) string { |
| 95 | switch s := v.(type) { |
| 96 | case string: |
| 97 | return s |
| 98 | case nil: |
| 99 | return "" |
| 100 | default: |
| 101 | return fmt.Sprintf("%v", v) |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | // normalizeArguments coerces the arguments value into []map[string]any so it |
| 106 | // serializes as a stable YAML sequence of maps. Accepts []map[string]any or |