Skip to content

Allow partials to work as decorators #13193

Open
@bep

Description

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 us of this.

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions