Tried adding a test for using global data in a WebC component.
I think it’s close, but I can’t quite get it to work.
Background
I love WebC…but I’m having a dickens of a time trying to accomplish simple things in an existing project.
I thought to myself, “Self, you can’t seem to access global data in your existing project. I bet you could look at the tests for the Eleventy WebC plugin and figure out how it works!”
Just looking at the test titles, I couldn’t find a test that did that. (That said, some of the test titles are more descriptive than others, so it’s possible that I missed something.) So I wrote a new test, but I can’t get it to output the data in any useful way. I just keep getting [object Object].
“Help me, Obi Wan @zachleat: You’re my only hope!”
—Me
TL;DR
Tried adding a test for using global data in a WebC component.
I think it’s close, but I can’t quite get it to work.
Background
I love WebC…but I’m having a dickens of a time trying to accomplish simple things in an existing project.
I thought to myself, “Self, you can’t seem to access global data in your existing project. I bet you could look at the tests for the Eleventy WebC plugin and figure out how it works!”
Just looking at the test titles, I couldn’t find a test that did that. (That said, some of the test titles are more descriptive than others, so it’s possible that I missed something.) So I wrote a new test, but I can’t get it to output the data in any useful way. I just keep getting
[object Object]
.“Help me, Obi Wan @zachleat: You’re my only hope!” —Me