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

Blocks should be possible within partials #7936

Open
janlimpens opened this issue Nov 5, 2020 · 5 comments
Open

Blocks should be possible within partials #7936

janlimpens opened this issue Nov 5, 2020 · 5 comments
Labels
Milestone

Comments

@janlimpens
Copy link

In a baseof setting, I have a partials/head.html partial. There I have a

<head>
{{ block "head" . }} {{ end -}}
</head>

When I try to write something to it from layout/single.html,
like this:

{{- define "head" }}
<script>
alert('Hello World!');
</script>
{{- end }}

this supposedly inserted section does not render.

I built a small site to show it. it is on github.
link, branch blocks-and-partials

I put a block in layouts/partial/head.html (at the bottom) and reference to it from layouts/index.html.

The content never shows up.

It would be great if this was possible.

@bep
Copy link
Member

bep commented Nov 5, 2020

It would be great if this was possible.

It would, but it isn't. An I don't know how to do it, either.

@bep bep modified the milestones: v0.79, v0.80 Nov 27, 2020
@bep bep modified the milestones: v0.80, v0.81 Jan 2, 2021
@bep bep modified the milestones: v0.81, v0.82 Feb 19, 2021
@timurguseynov
Copy link

That would be an awesome feature, as that way, it's possible to put everything related to partial in one place, like a component in modern frameworks.

@bep bep modified the milestones: v0.82, v0.83 Mar 21, 2021
@bep bep modified the milestones: v0.83, v0.84 May 1, 2021
@bep bep modified the milestones: v0.84, v0.85 Jun 18, 2021
@bep bep modified the milestones: v0.85, v0.86 Jul 5, 2021
@bep bep modified the milestones: v0.86, v0.87, v0.88 Jul 26, 2021
@bep bep modified the milestones: v0.88, v0.89 Sep 2, 2021
@bep bep modified the milestones: v0.89, v0.90 Nov 2, 2021
@bep bep modified the milestones: v0.90, v0.91.0 Dec 13, 2021
@bep bep removed this from the v0.91.0 milestone Dec 22, 2021
@bep bep added this to the v0.118.0 milestone Aug 30, 2023
@bep bep modified the milestones: v0.118.0, v0.119.0 Sep 15, 2023
@bep bep modified the milestones: v0.119.0, v0.120.0 Oct 4, 2023
@bep bep modified the milestones: v0.120.0, v0.121.0 Oct 31, 2023
@bep bep modified the milestones: v0.121.0, v0.122.0 Dec 6, 2023
@bep bep modified the milestones: v0.122.0, v0.123.0, v0.124.0 Jan 27, 2024
@bep bep modified the milestones: v0.124.0, v0.125.0 Mar 4, 2024
@bep bep modified the milestones: v0.125.0, v0.126.0 Apr 23, 2024
@bep bep modified the milestones: v0.126.0, v0.127.0 May 15, 2024
@bep bep modified the milestones: v0.127.0, v0.128.0 Jun 8, 2024
@bep bep modified the milestones: v0.128.0, v0.129.0 Jun 21, 2024
@bep bep modified the milestones: v0.129.0, v0.131.0 Jul 22, 2024
@bep bep modified the milestones: v0.131.0, v0.133.0 Aug 9, 2024
@bep bep modified the milestones: v0.133.0, Unscheduled Aug 29, 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

6 participants