sagemathinc / cocalc

CoCalc: Collaborative Calculation in the Cloud
https://CoCalc.com
Other
1.15k stars 209 forks source link

7473: Added `meta` tags to support the Open Graph protocol when sharing news links. #7499

Closed schrodingersket closed 3 months ago

schrodingersket commented 3 months ago

Description

This pull requests adds a slew of meta tags to each news item. Here's an example of what those look like:

<head>
...
        <meta property="og:type" content="article"/>
        <meta property="og:title" content="Another News Test"/>
        <meta property="og:url" content="https://localhost/news/another-news-test-8"/>
        <meta property="og:image" content="https://picsum.photos/536/354"/>
        <meta property="article:published_time" content="2024-04-14T02:46:27.000Z"/>
        <meta property="article:modified_time" content="2024-04-28T22:13:25.000Z"/>
...
</head>

...and LinkedIn's Post Inspector seems to pick up these tags as expected:

image

Test Instructions

If you're developing on a publicly-available server, you can simply click the LinkedIn "share" link on a news item with an embedded image. Otherwise, you'll probably need to use something like ngrok to forward your local development port so that 's servers can see your news post.