11ty / eleventy-plugin-webc

Adds support for WebC *.webc files to Eleventy
https://www.11ty.dev/docs/languages/webc/
119 stars 10 forks source link

test(global-data): Add test for using global data #80

Open Zearin opened 1 year ago

Zearin commented 1 year ago

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