Skip to content

Blocks should be possible within partials #7936

@janlimpens

Description

@janlimpens

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions