Skip to content

Conversation

@djschilling
Copy link
Contributor

The spec allows both but popular messenger prefer the property without :url

Every messenger i tested ignored the property og:image:url and only used og:image.

Tested Messengers:

  • Telegram
  • Rocket.Chat
  • Riot/Element
  • Facebook

The spec allows both but popular messenger prefer the property without `:url`
@djschilling
Copy link
Contributor Author

It seems like my changes are not causing the ci failures.

@Gummibeer
Copy link
Member

Gummibeer commented Sep 14, 2020

Hey,

thanks for your work! 🙂

this was already solved in #5 - as long as you only pass a simple string it will also only render a simple og:image.
Following the specs at https://ogp.me/ it would be wrong to use og:image without :url if there's additional data.

@Gummibeer Gummibeer closed this Sep 14, 2020
@djschilling
Copy link
Contributor Author

@Gummibeer

Maybe the spec does say that.

But the reality is that the platforms react different to the properties.

I want to define the dimensions of the image and still want only to use og:image for the url because the platforms respect that.

Another possibility would be to add bot og:image and og:image:url.

Using og:image:url might be more spec conform but it does not work in practice.

This is an example of how wordpress does it:

<meta property="og:image" content="https://blog.church.tools/wp-content/uploads/2018/12/App-Mockup_ChurchTools.jpg">
<meta property="og:image:width" content="1536">
<meta property="og:image:height" content="1024">

The Facebook Sharing Debugger shows no errors despite a missing id for facebook: https://developers.facebook.com/tools/debug/?q=https%3A%2F%2Fblog.church.tools%2Fblog%2Fniederschwellige-digitale-werbung%2F

@Gummibeer
Copy link
Member

Would you be fine with a withoutUrlSuffix() (real name tbd) method on the structured classes? 🤔
We had something similar in the spatie/schema-org package that Google does something different than the spec.

And because it's open-graph and not telegram-graph I would like to stick to the spec and not incomplete real world implementations.
But I would be okay with a workaround like the named method. Could also be a construct argument or both. This way you could even add your own class that disables the suffix by default.

@djschilling
Copy link
Contributor Author

@Gummibeer both of your solutions sounds good to me

@Gummibeer
Copy link
Member

Okay, will work on this today - should be released end of the day. 🙂

@Gummibeer
Copy link
Member

Gummibeer commented Sep 15, 2020

I've decided for the construct argument because it was easier to do the split the moment the URL is assigned and not afterwards.^^

https://github.com/Astrotomic/php-open-graph/releases/tag/0.5.0

@djschilling
Copy link
Contributor Author

thanks, i tested it and it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants