Partial If Exists

Template to include the target partial if exists.

Parameters

Name

NameTypeRequiredDefaultSince
Namestring--

The target partial name, extension is required, such as foo.html.

Context

NameTypeRequiredDefaultSince
Contextany--

The context passed to target partial.

Usage

1{{ partial "base/partial-if-exists" (dict "Name" "foo.html" "Context" "bar") }}
1// layouts/partials/foo.html
2Value: {{ . }} {{/* Value: bar */}}