-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Issue with webc:for
via Eleventy computed data
#67
Comments
webc:for
and eleventy --serve
Hello i can confirm it still happens even with on my blog i have this snippet: <h2>Contacts</h2>
<fieldset class="contato">
<legend>All relevant presence on internet</legend>
<!-- this one pops undefined on :href="c.link" -->
<div webc:for="c of curriculum.contacts">
<a target="_blank" :href="c.link" :alt="c.label" :title="c.label">
<span :class="c.icon"></span><span @html="c.link"></span>
</a>
</div>
<!-- this one i want to replace -->
<script webc:type="js" webc:raw>
curriculum.contacts.filter(c => c.visible).map(c => `
<div>
<a target="_blank" href="${c.link}" alt="${c.label}" title="${c.label}">
<span class="${c.icon}"></span> ${c.link}
</a>
</div>
`).join("\n")
</script>
</fieldset> It must be something with the plugin, because webc:for itself is working fine |
@sombriks where is |
it comes from a json file: |
if it isn’t computed data (and it looks like it isn’t)—can you file a separate issue @sombriks? Thank you! |
webc:for
and eleventy --serve
webc:for
via Eleventy computed data
Have been using |
[copy/paste from a comment in 11ty/webc#28]
Just doing a quick test (grabbed 11ty webc repo and dropped it into my project, overriding the existing folder at
node_modules/@11ty/webc
-- let me know if there is a better way to do this before tags exist!)✅ This works as expected
src/index.webc
src/_components/card-story.webc
✅ As does this!
src/index.webc
src/_components/card-story-alt.webc
npx @11ty/eleventy --serve
, where the data object seems to get 'lost', which errors the build like:Stopping the server and starting it again sorts it out, but only for the first build. I'm doing tests in an existing project, so will set up a cleaner env to see if I can pin it down.
arrayOfPosts
is being populated via aindex.11tydata.js
, and looks something likeEdit 1: Here is a quick test repo , inspired by @mdarrik in 11ty/webc#115
Edit 2: Fetching of dynamic data doesn't seem to be related. I've got a branch here with a hardcoded file in
_data
which also demonstrates the same behaviour.The text was updated successfully, but these errors were encountered: