KyleMit / eleventy-plugin-embed-tweet

A plugin for embedding tweets on the server side during build time
https://www.npmjs.com/package/eleventy-plugin-embed-tweet
25 stars 4 forks source link

Liquid support #6

Open jalberto opened 4 years ago

jalberto commented 4 years ago

Will be great to have Liquid support as well as NJK

Thanks for your work!

KyleMit commented 4 years ago

Seems totally reasonable. The lookups are using async/await, so we're bound to shortcode templating languages that have async support.

Should be available in:

We have to register each language individually, but shouldn't take too much work to add to the .eleventy.js file like this:

eleventyConfig.addNunjucksAsyncShortcode("tweet", async(tweetId) => {
    return await twitter.getTweet(tweetId, options)
});

Thanks for the suggestion!