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

[HUGO] bookshop_partial guard prevents sending empty partial props #119

Open
samharnack opened this issue Aug 24, 2022 · 0 comments
Open

Comments

@samharnack
Copy link

{{- if and $partial_name $partial_props -}}

Given a content file of:

---
canvas_layers: []
---

and a shared component with a wrapping div and javascript components (alpine in this example):

{{/* templates/component-library/shared/hugo/canvas.hugo.html */}}

<div class="w-full h-full" x-data="canvas()">
  {{ partial "bookshop" . }}
</div>

When using {{ partial "bookshop_partial" (slice "canvas" .Params.canvas_layers) }} the wrapping div is never output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant