Skip to content

Conversation

iiska
Copy link

@iiska iiska commented Oct 17, 2018

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.

@avh4
Copy link
Member

avh4 commented Oct 18, 2018

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".

@iiska
Copy link
Author

iiska commented Oct 18, 2018

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

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:

```html
<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">
```

Could resolve elm#236.
@iiska
Copy link
Author

iiska commented Nov 8, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OGP / Twitter card
2 participants