gfscott / eleventy-plugin-embed-twitter Goto Github PK
View Code? Open in Web Editor NEWAn Eleventy plugin to automatically embed Tweets in posts
Home Page: https://gfscott.com/embed-everything/
An Eleventy plugin to automatically embed Tweets in posts
Home Page: https://gfscott.com/embed-everything/
Dumping the plugin config to console is not an expected behavior on each build.
https://github.com/gfscott/eleventy-plugin-embed-twitter/blob/main/.eleventy.js#L9
Hi @gfscott !
Great plugin here.
I was wondering if you'd be open for a PR that adds three options.
dnt
. I think in a privacy world it's great to have DNT enabled by default.I've seen you have an unmerged PR so I'm not sure if you're maintaining this! If you're not let me know too!
Hey @gfscott !
I've found that this and YouTube misbehave a lot with Eleventy 1.0.0-beta2 I'm unsure right now of what could be the root cause and will dig into it a bit.
To summarise what happens is that content just banishes between the embeds for some reason. I thought it could be malformed content but it's not that. The output is just not there.
See below.
This could obviously be something else but I only changed Eleventy's version. I'd need a much more narrowed-down test case to be certain of what the issue could be. I'm wondering if you've considered making it so tests run Eleventy instead of "just the function".
Hey! I'd love to see some other options to customize the embed, in addition to #17! According to Twitter, there are options to define the alignment and hide cards or conversations with attributes at the blockquote
element, just like data-theme
and data-dnt
.
Btw, I really appreciate the embed-everything plugins - it helps me a lot!
OK
eleventyConfig.addPlugin(embedTwitter, {
cacheText: false,
})
OK
eleventyConfig.addPlugin(embedTwitter, {})
FAILS (This is what's shown in the README)
eleventyConfig.addPlugin(embedTwitter)
Error output:
❯ npm start
> @ start REDACTED
> ELEVENTY_ENV=development eleventy --serve & postcss styles/tailwind.css --o _tmp/style.css --watch
Unhandled rejection in promise ([object Promise]): (more in DEBUG output)
> Cannot convert undefined or null to object
`TypeError` was thrown:
TypeError: Cannot convert undefined or null to object
at Function.keys (<anonymous>)
at getKeys (/Users/glenn/src/github.com/REDACTED-www-tailwind/node_modules/deepmerge/dist/cjs.js:61:16)
at mergeObject (/Users/glenn/src/github.com/REDACTED-www-tailwind/node_modules/deepmerge/dist/cjs.js:86:2)
at deepmerge (/Users/glenn/src/github.com/REDACTED-www-tailwind/node_modules/deepmerge/dist/cjs.js:117:10)
at module.exports (/Users/glenn/src/github.com/REDACTED-www-tailwind/node_modules/eleventy-plugin-embed-twitter/.eleventy.js:8:23)
at UserConfig.addPlugin (/Users/glenn/src/github.com/REDACTED-www-tailwind/node_modules/@11ty/eleventy/src/UserConfig.js:273:7)
at module.exports (/Users/glenn/src/github.com/REDACTED-www-tailwind/.eleventy.js:50:18)
at TemplateConfig.mergeConfig (/Users/glenn/src/github.com/REDACTED-www-tailwind/node_modules/@11ty/eleventy/src/TemplateConfig.js:91:25)
at new TemplateConfig (/Users/glenn/src/github.com/REDACTED-www-tailwind/node_modules/@11ty/eleventy/src/TemplateConfig.js:25:24)
at Object.<anonymous> (/Users/glenn/src/github.com/REDACTED-www-tailwind/node_modules/@11ty/eleventy/src/Config.js:5:14)
warn - You have enabled experimental features: extendedSpacingScale, defaultLineHeights, extendedFontSizeScale
warn - Experimental features are not covered by semver, may introduce breaking changes, and can change at any time.
risk - There are upcoming breaking changes: purgeLayersByDefault
risk - We highly recommend opting-in to these changes now to simplify upgrading Tailwind in the future.
risk - https://tailwindcss.com/docs/upcoming-changes
REDACTED
Benchmark (Configuration): "svgContents" Nunjucks Filter took 461ms (21.5%, called 1602×, 0.3ms each)
Copied 465 files / Wrote 53 files in 1.91 seconds (36.0ms each, v0.11.0)
Watching…
[Browsersync] Access URLs:
-------------------------------------
Local: http://localhost:8080
External: http://10.147.20.71:8080
-------------------------------------
UI: http://localhost:3001
UI External: http://localhost:3001
-------------------------------------
[Browsersync] Serving files from: _site
File changed: _tmp/style.css
File changed: _tmp/style.css
REDACTED
[Browsersync] Reloading files that match: *.css
Benchmark (Configuration): "svgContents" Nunjucks Filter took 266ms (21.5%, called 1602×, 0.2ms each)
Copied 465 files / Wrote 53 files in 1.23 seconds (23.2ms each, v0.11.0)
Watching…
[Browsersync] Reloading files that match: *.css
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.