You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I'd like to use Javascript Functions to return a shortcode so that it may be rendered in a layout.
I can use Eleventy Computed to return a hardcoded template string data variable that renders as expected: {% now %} renders Thu Nov 04 2021 17:46:05 GMT-0400 (GMT-04:00).
However, an Eleventy Computed Function that returns the equivalent, does not render the shortcode. {% now %} renders {% now %}.
Expected behavior
Javascript Function return values containing shortcodes should get processed.
Screenshots
Environment:
Mac OS Version 10.13.6 (17G14042)
Eleventy Version 0.12.1
Additional context
This issue is related to #2019, #2025 and #2057.
I came across this problem while trying to use https://www.11ty.dev/docs/plugins/serverless/ (version 1.0.0-canary.44) to develop a live custom preview for Netlify CMS. I went back to Version 0.12.1 hoping the root cause was a beta thing.
Possible Regression in version 1.0.0-canary.44
A Global Data JSON globalDataJsonNow.now renders the shortcode as expected in 0.12.1 but not in 1.0.0-canary.44.
The text was updated successfully, but these errors were encountered:
Describe the bug
I'd like to use Javascript Functions to return a shortcode so that it may be rendered in a layout.
I can use Eleventy Computed to return a hardcoded template string data variable that renders as expected:
{% now %}
rendersThu Nov 04 2021 17:46:05 GMT-0400 (GMT-04:00)
.However, an Eleventy Computed Function that returns the equivalent, does not render the shortcode.
{% now %}
renders{% now %}
.Despite my best efforts following the examples provided on https://www.11ty.dev/docs/data-computed/#using-javascript, I could still be missing something very basic. But I don't think this is related to markdown-It.render().
To Reproduce
You can clone the repo https://github.com/stevenmilstein/11ty-js-functions-and-shortcodes, try it on Stackblitz, or,
1. Update /.eleventy.js accordingly
2. Create ./src/_includes/base.njk
3. Create
/src/index.njk
Expected behavior
Javascript Function return values containing shortcodes should get processed.
Screenshots
Environment:
Additional context
This issue is related to #2019, #2025 and #2057.
I came across this problem while trying to use https://www.11ty.dev/docs/plugins/serverless/ (version 1.0.0-canary.44) to develop a live custom preview for Netlify CMS. I went back to Version 0.12.1 hoping the root cause was a beta thing.
Possible Regression in version 1.0.0-canary.44
A Global Data JSON
globalDataJsonNow.now
renders the shortcode as expected in 0.12.1 but not in 1.0.0-canary.44.The text was updated successfully, but these errors were encountered: