Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow partials to work as decorators #13193

Open
bep opened this issue Dec 24, 2024 · 0 comments
Open

Allow partials to work as decorators #13193

bep opened this issue Dec 24, 2024 · 0 comments
Labels
Milestone

Comments

@bep
Copy link
Member

bep commented Dec 24, 2024

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.

@bep bep added the Proposal label Dec 24, 2024
@bep bep added this to the Unscheduled milestone Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant