urbit / urbit.org

The source for urbit.org
https://urbit.org
MIT License
91 stars 198 forks source link

Add open graph meta tags #128

Closed flowerornament closed 3 years ago

flowerornament commented 5 years ago

Posts currently lack og meta tags: http://ogp.me/

friederjanmoerman commented 5 years ago

Which one's would you like to have added and with what info? Here's an example:

<meta property="og:title" content="Urbit">
<meta property="og:description" content="A personal server built from scratch.">
<meta property="og:image" content="https://urbit.org//thumbnail.jpg">
<meta property="og:url" content="https://urbit.org/">
<meta name="twitter:card" content="image">

Optional

<meta property="og:site_name" content="Urbit">
<meta name="twitter:image:alt" content="Alt text for image">
flowerornament commented 5 years ago

I need to look into how og works, but something like below. I'd just look at some examples of how major publications do it and copy them.

<meta property="og:title" content="[post-title]">
<meta property="og:description" content="[post-short-description]">
<meta property="og:image" content="[post-header-image]">
<meta property="og:url" content="https://urbit.org/">
<meta name="twitter:card" content="[post-header-image]">
friederjanmoerman commented 5 years ago
<meta property="og:title" content="[post-title]">
<meta property="og:description" content="[post-short-description]">
<meta property="og:url" content="https://urbit.org/">

Have been added in the open-graph-meta branch. To add images, I would need images, so send 'em my way if you find the time.

matildepark commented 5 years ago

I think it’s possible to check, eg just on the blog post template, “if there’s an image, the open graph image is that image url”.

However I believe it would require minor clerical work to add that metadata to the front matter of blog posts.

image: “hereistheurl.jpg”

On Jul 4, 2019, at 4:29 AM, Hardcodepunk notifications@github.com wrote:

Have been added in the open-graph-meta branch. To add images, I would need images, so send 'em my way if you find the time.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

friederjanmoerman commented 5 years ago

I think it’s possible to check, eg just on the blog post template, “if there’s an image, the open graph image is that image url”. However I believe it would require minor clerical work to add that metadata to the front matter of blog posts. image: “hereistheurl.jpg” On Jul 4, 2019, at 4:29 AM, Hardcodepunk @.***> wrote: Have been added in the open-graph-meta branch. To add images, I would need images, so send 'em my way if you find the time. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

Ah yes, good idea, I'll give it a go later today.

friederjanmoerman commented 5 years ago

In the open-graph-meta branch: Now if the template used is page and you've added

[extra.opengraph] ogimg = "https://link.to/img.jpg"

in the page's front matter, it will be added in the head (base template) as follows

<meta property="og:image" content="{% if page.extra.opengraph %}{{ page.extra.opengraph.ogimg }}{% endif %}">
<meta name="twitter:card" content="{% if page.extra.opengraph %}{{ page.extra.opengraph.ogimg }}{% endif %}">

The extra.opengraph front matter is created in the config. I've updated every essay post as an example.

urcades commented 4 years ago

@matildepark curious if we should close this one out, or if we've afforded for its original concerns re: the site restructure?

matildepark commented 4 years ago

We have Twitter card metatags, but not any valid OpenGraph. Ideally this issue would be replacing a lot of the Twitter-specific stuff with the appropriate OpenGraph equivalent.