Skip to content

Allow partials to work as decorators #13193

@bep

Description

@bep

This is a feature that I have been wanting, but always assumed would not be possible with Go templates. Now I think that it could be implemented.

Example:

single.html:

<div>
  {{ with partial "boldtitle.html" . }}
      {{ .Title }}
  {{ end }}
</div>

boldtitle.html:

<h1 class="bold">{{ inner }}</h1>

The above example is obviously very simple, but I suspect people can imagine their own use of this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions