I started to come across this problem a lot. I want to include an element around other elements if a boolean is true. In the example below I make two if statements, but if the code that I want to wrap is big this will make it unclear what is happening. Also, there will be duplicate code. Is there a better way to this solution?
<script>
let boolean = true;
</script>
{#if}
<img src="source" />
{/if}
{#if}
<a href="/home">
<img src="source" />
</a>
{/if}