Skip to content

Compiler: Include {{define}} tags #7

@tylermmorton

Description

@tylermmorton

It would be useful to be able to define sub-templates within a template that is compiled by tmpl

{{ define "greeting" }}
Hello world!
{{ end }}
<p>{{template "greeting"}}</p>

Currently this is not possible because tmpl wraps the template text in its own define tag internally. Instead, these define directives should be extracted and parsed separately, then merged with the main parse tree.

It would also be useful to be able to query the template targets that are available within a compiled template.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions