All Projects → daviddarnes → eleventy-plugin-unfurl

daviddarnes / eleventy-plugin-unfurl

Licence: other
Unfurl links into rich cards, as seen in places like Slack and Twitter

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to eleventy-plugin-unfurl

eleventy-plugin-prismic
Eleventy plugin and shortcodes to fetch and present Prismic content
Stars: ✭ 39 (+5.41%)
Mutual labels:  eleventy, eleventy-plugin
eleventy-plugin-social-images
Create dynamic images sized for social media tags for your Eleventy content.
Stars: ✭ 35 (-5.41%)
Mutual labels:  eleventy, eleventy-plugin
eleventy-plugin-toc
11ty plugin to generate a TOC from page content
Stars: ✭ 45 (+21.62%)
Mutual labels:  eleventy, eleventy-plugin
eleventy-load
Resolve dependencies and post-process files in your Eleventy project
Stars: ✭ 28 (-24.32%)
Mutual labels:  eleventy, eleventy-plugin
eleventy-plugin-metagen
An Eleventy shortcode that generates metadata for Open Graph, Twitter card, generic meta tags and a canonical link.
Stars: ✭ 28 (-24.32%)
Mutual labels:  eleventy, eleventy-plugin
eleventy-upgrade-help
Helper plugin when upgrading your Eleventy project to a new major version.
Stars: ✭ 33 (-10.81%)
Mutual labels:  eleventy, eleventy-plugin
eleventy-plugin-embed-tweet
A plugin for embedding tweets on the server side during build time
Stars: ✭ 24 (-35.14%)
Mutual labels:  eleventy, eleventy-plugin
eleventy-navigation
A plugin for creating hierarchical navigation in Eleventy projects. Supports breadcrumbs too!
Stars: ✭ 88 (+137.84%)
Mutual labels:  eleventy, eleventy-plugin
eleventy-plugin-inclusive-language
A linter plugin to check for inclusive language in markdown files.
Stars: ✭ 32 (-13.51%)
Mutual labels:  eleventy, eleventy-plugin
eleventy-plugin-pwa
An eleventy plugin to generate service-worker for PWA. Powered by Google Workbox
Stars: ✭ 46 (+24.32%)
Mutual labels:  eleventy, eleventy-plugin
eleventy-plugin-svelte
Eleventy plugin to support svelte templates
Stars: ✭ 40 (+8.11%)
Mutual labels:  eleventy, eleventy-plugin
eleventy-plugin-cloudinary
An Eleventy shortcode that allows you to add an image from your cloudinary account
Stars: ✭ 28 (-24.32%)
Mutual labels:  eleventy, eleventy-plugin
stacks-11ty
Open source 11ty theme with personality
Stars: ✭ 21 (-43.24%)
Mutual labels:  eleventy
11ty-tailwind-jit
Try editing some Tailwind in this repo while running in dev. It's SO FAST!
Stars: ✭ 17 (-54.05%)
Mutual labels:  eleventy
htmlrecipes
A collection of quick copy HTML snippets for a variety of common scenarios.
Stars: ✭ 113 (+205.41%)
Mutual labels:  eleventy
data-11ty
An open source 11ty theme designed for reporting & data-visualization
Stars: ✭ 19 (-48.65%)
Mutual labels:  eleventy
alexcarpenter-11ty
📝 Source files for my personal website built with Eleventy and hosted with Netlify.
Stars: ✭ 89 (+140.54%)
Mutual labels:  eleventy
demo-eleventy-serverless
Run Eleventy in a serverless function
Stars: ✭ 53 (+43.24%)
Mutual labels:  eleventy
Formation
💻 macOS setup script for front-end development
Stars: ✭ 1,706 (+4510.81%)
Mutual labels:  eleventy
Eleventy
A simpler static site generator. An alternative to Jekyll. Transforms a directory of templates (of varying types) into HTML.
Stars: ✭ 10,867 (+29270.27%)
Mutual labels:  eleventy

eleventy-plugin-unfurl

npm

Turn URLs into rich cards. Show a preview image, page title, description and other meta information all inside a neatly presented card. Collaborative effort between Sara Soueidan and myself.

See the live demo and the demo directory in the repo to see it all in action.

Installation

  1. Install plugin using npm:

    npm install eleventy-plugin-unfurl
    
  2. Add plugin to your .eleventy.js config:

    const pluginUnfurl = require("eleventy-plugin-unfurl");
    
    module.exports = (eleventyConfig) => {
      eleventyConfig.addPlugin(pluginUnfurl);
    };
  3. Use the shortcode in your templates (.md, .njk, .liquid or .js) like so:

    {% unfurl "https://www.sarasoueidan.com/blog/prefers-color-scheme-browser-vs-os/" %}

Options

The HTML of the unfurled links can be amended using the template option like so:

eleventyConfig.addPlugin(pluginUnfurl, {
  template: ({ title, url }) => `<a href="${url}">${title}</a>`,
});

The following data points are available:

  • title
  • description
  • lang
  • author
  • publisher
  • image
    • url
    • type
    • size
    • height
    • width
    • size_pretty
  • date (Note: Currently not returning the published date, removed from plugin HTML template)
  • url
  • logo
    • url
    • type
    • size
    • height
    • width
    • size_pretty

🎨 Looking for some CSS like in the demo? Check out the demo file in the repo.

Development

  1. Amend the .eleventy.js file within demo so it points to the source code in the parent directory:

    // const pluginUnfurl = require("../");
    const pluginUnfurl = require("eleventy-plugin-unfurl");
  2. Install the demo dependencies:

    cd demo
    npm install
    
  3. Run the demo locally:

    npm run dev
    

Credits

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].