package.elm-lang.org icon indicating copy to clipboard operation
package.elm-lang.org copied to clipboard

Open Graph Protocol metadata for version pages

Open iiska opened this issue 7 years ago • 3 comments
trafficstars

Renders OGP metadata for package documentation pages which could be used to enable prettier rendering of Elm package links when shared at social sites, chat rooms and forums.

For example elm/http would have following metadata section:

<meta property="og:site_name" content="Elm Packages">
<meta property="og:title" content="elm/http 1.0.0">
<meta property="og:image" content="https://package.elm-lang.org/assets/elm_logo.svg">
<meta property="og:description" content="Make HTTP requests">

Following screenshot displays how Open Graph Preview extension for Chrome renders that metadata: screenshot from Open Graph Preview extension

This could resolve #236.

iiska avatar Oct 17 '18 17:10 iiska

I think it would probably be good if og:title included the username, since that's how packages are generally referred to both on the package site and when installing them. So for this example, "elm/http 1.0.0" instead of just "http 1.0.0".

avh4 avatar Oct 18 '18 02:10 avh4

@avh4 Great point! That's definitely something I have to do here.

iiska avatar Oct 18 '18 05:10 iiska

I have now made the change suggested by @avh4 to include author name in the og:title, PR description and example screenshot were updated to reflect this change.

I also squashed changes into single commit to keep history clean.

iiska avatar Nov 08 '18 19:11 iiska