Skip to content

Inline partials do not fully support live reload #13753

@ZhenShuo2021

Description

@ZhenShuo2021

What version of Hugo are you using (hugo version)?

$ hugo version
v0.147.6

Does this issue reproduce with the latest release?

Yes

Description

When the inline partial is defined and used within the same file, live reload works as expected:

{{ define "partials/test" }}
{{ $value := "AAA" }}
{{ return $value }}
{{ end }}

{{ $foo := partial "test" }}
{{ printf "%s %s" "Inline partial:" $foo }}

Since inline partials are globally scoped, I prefer to move the define block to a separate file, such as partials/inline.html. In this case, live reload does not work properly.

If I remove the inline partial call, save the file, then add the call back and save again, the updated value is reflected.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions