-
Notifications
You must be signed in to change notification settings - Fork 20
Pull high resolution image URL for meta tags #4767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
498d939 to
52fddb2
Compare
mike3985
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 nice approach to the problem of the existing meta tags shared examples being so specific to Content Store
52fddb2 to
337b953
Compare
hannako
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Perhaps you could join up the dots for how high_resolution_url is used in either the commit message or PR description. ie
https://github.com/alphagov/govuk_publishing_components/blob/a48903d9b24dc47b1434ee89200c8077bdc6bf48/lib/govuk_publishing_components/presenters/machine_readable/page.rb#L35
frontend/app/views/news_article/show.html.erb
Lines 3 to 6 in 50901ed
| <%= render "govuk_publishing_components/components/machine_readable_metadata", | |
| schema: :news_article, | |
| content_item: content_item.to_h %> | |
| <% end %> |
337b953 to
24a75de
Compare
leenagupte
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good.
However, I agree with Jess's suggestion about adding how high resolution images work and why these tests needed be to the commit message and PR description.
There's also a minor inline suggestion.
This is [used by govuk_publishing_components][image_url] to populate the `og:image` and `twitter:image` meta tags if it's present. When absent, the standard URL of the image will be used. In order to provide consistency between when the data comes from Content Store versus GraphQL, we need to include the field in the GraphQL query This adds a test covering this for both the Content Store and GraphQL contexts. There is a similar shared example in spec/support/meta_tags.rb, but it wasn't being used in this spec before, and the approach here allows us to use a short shared example for both contexts [image_url]: https://github.com/alphagov/govuk_publishing_components/blob/a48903d9b24dc47b1434ee89200c8077bdc6bf48/lib/govuk_publishing_components/presenters/machine_readable/page.rb#L34-L36
|
@hannako @leenagupte re: joining the dots, I've added a link to the method in govuk_publishing_components in the commit message to make it more explicit, per Jess' suggestion |
leenagupte
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for expanding the commit message 👍
This is used by govuk_publishing_components to populate the
og:imageandtwitter:imagemeta tags if it's present. When absent, the standard URL of the image will be used. In order to provide consistency between when the data comes from Content Store versus GraphQL, we need to include the field in the GraphQL queryTrello