extractSkipField extracts a named field from the 'on:' section of frontmatter. Returns nil if the field is not configured.
(frontmatter map[string]any, fieldName string)
| 534 | // extractSkipField extracts a named field from the 'on:' section of frontmatter. |
| 535 | // Returns nil if the field is not configured. |
| 536 | func extractSkipField(frontmatter map[string]any, fieldName string) []string { |
| 537 | onValue, exists := frontmatter["on"] |
| 538 | if !exists || onValue == nil { |
| 539 | return nil |
| 540 | } |
| 541 | if on, ok := onValue.(map[string]any); ok { |
| 542 | if val, exists := on[fieldName]; exists && val != nil { |
| 543 | return parseOptionalStringSliceField(val, fieldName) |
| 544 | } |
| 545 | } |
| 546 | return nil |
| 547 | } |
| 548 | |
| 549 | // extractSkipRoles extracts the 'skip-roles' field from the 'on:' section of frontmatter |
| 550 | // Returns nil if skip-roles is not configured |
no test coverage detected