parseTemplateName
functionfunction parseTemplateName(
relativePath: string
): Pick<
TemplateDescriptor,
"outputPattern" | "format" | "perItem" | "variable"
>;Parse a template's relative path into its descriptor fields.
The @var convention can appear in any path segment — either in the
filename itself or in a directory name:
@slug.md.template→ variableslug(flat, filename)examples/@example/index.md.template→ variableexample(nested, directory)
PARAMETERS
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| relativePath | string | Path relative to the templates root, e.g. `examples/@example/index.md.template` |
RETURNS
Pick<TemplateDescriptor, "outputPattern" | "format" | "perItem" | "variable">