genicsblog / theme-files

Theme files for genicsblog.com
https://staging.genicsblog.com
Other
8 stars 11 forks source link

Add link preview component #55

Closed gouravkhunger closed 2 years ago

gouravkhunger commented 2 years ago

Fixes #3

This PR adds a new link preview component that can be embedded to posts via:

{% include linkpreview.html url = "https://genicsblog.com" title = "Genics Blog: An open source developer publication" %}

Where url is a mandatory field and title is optional.

There's an additional rel attribute (optional) that specifies the link type for the preview. By default its value is nofollow noopener noreferrer.

Sometimes, websites dynamically change the <title> tag on page load, through javascript. In that case, if title prop is passed to the include specifically, it is preferred over the extracted <title> tag from the website.

Preview (desktop):

image

Preview (mobile):

image
vercel[bot] commented 2 years ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
theme-files ✅ Ready (Inspect) Visit Preview Jul 31, 2022 at 4:46PM (UTC)