(directive *ImportDirectiveMatch)
| 102 | } |
| 103 | |
| 104 | func emitIncludeDirectiveDeprecationWarning(directive *ImportDirectiveMatch) { |
| 105 | if !directive.IsLegacy { |
| 106 | return |
| 107 | } |
| 108 | |
| 109 | optionalMarker := "" |
| 110 | if directive.IsOptional { |
| 111 | optionalMarker = "?" |
| 112 | } |
| 113 | |
| 114 | var suggestion string |
| 115 | if strings.HasPrefix(strings.TrimSpace(directive.Original), "{{") { |
| 116 | suggestion = fmt.Sprintf("Use {{#runtime-import%s %s}} for content injection or the 'imports:' frontmatter field for configuration merging.", |
| 117 | optionalMarker, |
| 118 | directive.Path) |
| 119 | } else { |
| 120 | suggestion = fmt.Sprintf("Use {{#runtime-import%s %s}} instead.", |
| 121 | optionalMarker, |
| 122 | directive.Path) |
| 123 | } |
| 124 | fmt.Fprintln(os.Stderr, console.FormatWarningMessage(fmt.Sprintf("Deprecated syntax: %q. %s", |
| 125 | directive.Original, |
| 126 | suggestion))) |
| 127 | } |
| 128 | |
| 129 | func resolveDirectiveWithVisited( |
| 130 | directive *ImportDirectiveMatch, |
no test coverage detected