(content []byte, item importQueueItem)
| 338 | } |
| 339 | |
| 340 | func extractImportFrontmatterForNested(content []byte, item importQueueItem) (*FrontmatterResult, error) { |
| 341 | result, err := extractFrontmatterForImport(item.fullPath, content) |
| 342 | if err != nil || result == nil { |
| 343 | return result, err |
| 344 | } |
| 345 | inputsWithDefaults := applyImportSchemaDefaultsFromFrontmatter(result.Frontmatter, item.inputs) |
| 346 | if len(inputsWithDefaults) == 0 { |
| 347 | return result, nil |
| 348 | } |
| 349 | origContent := string(content) |
| 350 | substituted := substituteImportInputsInContent(origContent, inputsWithDefaults) |
| 351 | if substituted == origContent { |
| 352 | return result, nil |
| 353 | } |
| 354 | if reparse, rerr := ExtractFrontmatterFromContent(substituted); rerr == nil { |
| 355 | result = reparse |
| 356 | } |
| 357 | return result, nil |
| 358 | } |
| 359 | |
| 360 | func extractFrontmatterForImport(fullPath string, content []byte) (*FrontmatterResult, error) { |
| 361 | if strings.HasPrefix(fullPath, BuiltinPathPrefix) { |
no test coverage detected