Link Card Studio: A Free Tool to Preview and Fix Your Social Share Cards
You publish a post, share it on Facebook, and the card shows the wrong photo, half a title and no description. I built Link Card Studio so you can see and fix that before anyone else does: a free browser tool that previews your link on Google, Facebook, X, LinkedIn and chat apps, checks it, and writes the meta tags for you.
It measures your title in pixels the way Google does, flags images that are too small or the wrong shape, reads the tags of an existing page, and gives you copy-ready code for plain HTML, a dynamic Blogger theme snippet, or a small WordPress mu-plugin. Nothing leaves your browser.
Try It: Edit the Title and Watch the Ruler
This is a small slice of the tool with a sample bakery. Type in the title or tap Too long: the ruler turns amber past Google's 600 px, the search result gets cut, and the card image redraws itself.
Link Card Studio in Pictures
Real screenshots of the finished tool, from the main screen to the phone layout.
Sample 1: The main screen: the editor on the left and live previews on the right, with the title measured against Google's 600 px limit.
Sample 2: A card that needs work: the title is too wide for Google and the image is a relative path, so every preview shows "No image".
Sample 3: Dark mode with the checks list and the dynamic Blogger theme snippet ready to copy.
Sample 4: The phone layout at 390 px wide, in the light and dark themes.
Build Footprint & Quality Checks
No framework and no build step, so the whole app is small enough to load instantly on a phone. Measured on the v1.0.0 files:
Technology Stack & Architecture Layers
Vanilla JavaScript
Pure functions in core.js run the checks, truncation and code generators, and the same file runs in Node for tests.
Canvas, DOMParser, FileReader
Canvas measures text and draws card images, DOMParser reads pasted page source, FileReader previews local images.
Semantic HTML5
One page with landmarks, labelled fields and live regions, so screen readers hear the score and check results.
CSS Tokens & Grid
Custom properties for light and dark themes, a two-column workbench that stacks on phones down to 360 px.
Key Architectural Decisions
Pixels, Not Characters
"60 characters" is a rule of thumb. The tool measures the title in Arial 20px with a canvas and cuts it at the word boundary that fits, like a real result.
One Pure Logic File
core.js never touches the page. The UI just renders its results, and 12 Node tests cover it without a browser.
Platform-Aware Output
Static tags for HTML, Blogger data tags (data:view.featuredImage) for every post, and a WordPress mu-plugin that steps aside for Yoast or Rank Math.
Private by Design
No server, no fetch of your URL, no tracking. Uploaded images stay as in-browser previews, and storage is wrapped so blocked storage never breaks the app.
Truncation, Measuring & the Blogger Snippet
The function that cuts titles like Google, the canvas ruler that feeds it, and the start of the Blogger theme snippet the tool generates.
// js/core.js
/**
* Cut text so it fits maxPx, ending at a word boundary with an ellipsis.
* measure(text) must return the rendered width in pixels.
*/
function truncateToWidth(text, maxPx, measure) {
text = clean(text);
var full = measure(text);
if (full <= maxPx) return { text: text, truncated: false, width: full };
var ell = ' \u2026';
var lo = 0, hi = text.length;
while (lo < hi) { // binary search for the longest prefix that fits
var mid = Math.ceil((lo + hi) / 2);
if (measure(text.slice(0, mid) + ell) <= maxPx) lo = mid; else hi = mid - 1;
}
var cut = text.slice(0, lo);
var space = cut.lastIndexOf(' ');
if (space > lo * 0.6) cut = cut.slice(0, space);
cut = cut.replace(/[\s,.;:\-\u2013\u2014|]+$/, '');
return { text: cut + ell, truncated: true, width: full };
}
// js/app.js: measure text in the same font Google uses
/* ---------- text measuring with a canvas, same fonts Google uses ---------- */
var ctx = document.createElement('canvas').getContext('2d');
function measure(font) {
return function (text) { ctx.font = font; return ctx.measureText(text).width; };
}
var mTitle = measure('20px Arial');
var mDesc = measure('14px Arial');
<!-- Link Card Studio: social cards for Blogger.
Theme > Edit HTML > paste inside <head>, below <b:include data='blog' name='all-head-content'/>.
Back up your theme first. If View Source then shows an og: tag twice, delete one copy. -->
<meta property='og:site_name' expr:content='data:blog.title.escaped'/>
<meta property='og:locale' content='en_PH'/>
<meta property='og:url' expr:content='data:view.url.canonical'/>
<b:if cond='data:view.isSingleItem'>
<meta property='og:type' content='article'/>
<b:else/>
<meta property='og:type' content='website'/>
</b:if>
<meta property='og:title' expr:content='data:view.title.escaped'/>
<meta name='twitter:title' expr:content='data:view.title.escaped'/>
<b:if cond='data:view.description'>
<meta property='og:description' expr:content='data:view.description.escaped'/>
<meta name='twitter:description' expr:content='data:view.description.escaped'/>
<b:else/>
<meta property='og:description' content='Free web development projects, tutorials and tools from Bukidnon.'/>
<meta name='twitter:description' content='Free web development projects, tutorials and tools from Bukidnon.'/>
</b:if>
<b:if cond='data:view.featuredImage'>
<meta property='og:image' expr:content='resizeImage(data:view.featuredImage, 1200, "1200:630")'/>
Development Roadmap & Milestones
Version 1.0.0 is released. These are the next milestones from the project's roadmap:
v1.0.0: Core Tool (Released)
Five live previews, pixel ruler, 11 checks with a score, HTML/Blogger/WordPress output, page-source reader, card image maker, saved cards, light and dark themes.
Next: Check a Live URL
An optional tiny PHP or Cloudflare Worker proxy so you can type a URL instead of pasting the page source.
Planned: Whole-Site Audit
Read a sitemap.xml and list every page with a missing image, a duplicate title or a description that will be cut.
Planned: More Previews
Telegram, Discord, Slack and Pinterest cards, plus a JPG export with a size picker for the generated image.
User Interface & Feature Showcase
Project Links, Code & Documentation
Open the Live Tool
Use it right now in your browser, or download link-card-studio.zip from the release and open index.html.
GitHub Repository
Browse the source, open an issue or suggest a feature. Free and open source under the MIT license.
How It Was Built
The build log lists every language, file, test and step in plain language, plus a tutorial with three exercises.
First Impressions Happen in the Feed
For many customers the link card is the first look at your business. Link Card Studio turns meta tags from guesswork into a quick checklist with code you can paste. Want your site's share cards fixed, or a card image template for every post?
Frequently Asked Questions
Is Link Card Studio free to use?
Yes. It is free and open source under the MIT license, so you can use it, change it and include it in client work.
Does it work with Blogger and WordPress?
Yes. Besides plain HTML tags, it writes a Blogger theme snippet that uses each post's own title, search description and first image, and a small WordPress mu-plugin that uses each post's title, excerpt and featured image.
What do I need to run it?
Only a modern browser. Open index.html or the live demo; there is no install, no npm and no server code.
Is anything I type or upload sent to a server?
No. Everything runs in your browser. Local images are read with FileReader for the preview only, and saved cards stay in your browser's storage.
How does it know when Google will cut my title?
It measures the title in pixels with a canvas, in Arial 20px like Google's results, and compares it with the roughly 600 px limit. The limits are approximate because Google changes its layout from time to time.
Can you set this up for my business website?
Yes. I can add proper share cards and meta tags to your Blogger, WordPress or custom website and make a matching card image for your pages. Contact me here.
The bakery and resort in the demo and screenshots are fictional and use reserved .example addresses. The previews are close approximations of each platform; their layouts and limits change from time to time.





Comments
Post a Comment