Jump to content

Eaxy fix for the generic User Files link preview texts when pasting to Discord / social media


Recommended Posts

Posted (edited)

Hi,

When pasting a User Files link to a an instant messenger or social media supporting the Open Graph protocol, the preview title and text is always the same, generic text. For example, when pasting this link https://www.digitalcombatsimulator.com/en/files/3328256/ the preview is as the attached screenshot. This makes the previews useless on Discord etc.

The relevant og meta tags on that page are as follows

<meta property="og:title" content="User Files" />
<meta property="og:description" content="Combat Flight Simulator. Realistic simulation of military aircraft, ...snipped for brevity..." />
<meta property="og:title" content="F/A-18C HUD Improvement" />
<meta property="og:description" content="This mod adds more variety of brightness intensity and color of the HUD
More Info on the .lua files in case you want to tweak the HUD to your preference
... snipped for brevity ..." />

As per the Open Graph protocol, when there are multiple tags present, the first one (from top of the page) is given preference. See  https://ogp.me/#array. So per spec, Discord and other apps always show the title "User Files" and the completely generic description, because those are the first tags, and they'll ignore the later ones.

To make User Files link previews actually useful in Discord and other apps, I think you should either remove those generic tags or put them after the mod-specific og:title and og:description on the User Files page code.

Also, you consider shortening the mod-specific og:description so the previews won't get too long. See https://ogp.me/#optional

  • og:description - A one to two sentence description of your object.

Best regards,

itn

image.png

Edited by itn
Edited title
  • Like 2
  • itn changed the title to Eaxy fix for the generic User Files link preview texts when pasting to Discord / social media
Posted

Edited the title to maybe depict the issue better, and to point out the fix should be easy as it's likely two lines on a site template file somewhere.

  • 1 month later...
Posted

Apparently this has been implemented. User Files pages now have only the relevant og tags. This makes the previews much nicer when pasting links to social media. Thanks 🙂

-itn

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...