-
-
Notifications
You must be signed in to change notification settings - Fork 557
Open
Description
Operating system
Fedora 42 KDE
Eleventy
3.1.2
Describe the bug
Define an async shortcode:
eleventyConfig.addAsyncShortcode("testShortcodeAsync", async function () {
return "Value from async shortcode";
});Create a main test file main.njk:
<h2>Test2</h2>
{% set data = [1, 2, 3] %}
{% for item in data %}
<p>Item {{ item }}</p>
<p>{% include "./subpage.njk" %}</p>
<hr/>
{% endfor %}Create a subpage.njk file, that calls async shortcode:
Yay!
{% testShortcodeAsync %}Expected result something like:
Item 1
Yay! Value from async shortcode
---
Item 2
Yay! Value from async shortcode
---
Item 3
Yay! Value from async shortcode
---
Actual result something like this:
Item 1
Item 2
Item 3
It seems to be quite broken. Not only isn't the subpage.njk content rendered, it breaks the whole loop iteration, as the <hr/> is also missing, that comes from the main.njk.
For the longest time I was thinking I just am not able to understand how the shortcodes work. Until I now dug in thoroughly to figure out what am I doing wrong - seems that I really stumbled on a nasty bug.
Reproduction Source Code URL
No response
Screenshots
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels