Skip to content

Conversation

@yndajas
Copy link
Member

@yndajas yndajas commented Apr 17, 2025

This is used by govuk_publishing_components 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

Trello

@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4767 April 17, 2025 16:41 Inactive
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4767 April 17, 2025 16:43 Inactive
@yndajas yndajas force-pushed the test-image-caption branch from 498d939 to 52fddb2 Compare April 17, 2025 17:04
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4767 April 17, 2025 17:05 Inactive
Copy link
Contributor

@mike3985 mike3985 left a 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

@yndajas yndajas force-pushed the test-image-caption branch from 52fddb2 to 337b953 Compare April 23, 2025 11:27
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4767 April 23, 2025 11:31 Inactive
Copy link
Contributor

@hannako hannako left a 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

<%= render "govuk_publishing_components/components/machine_readable_metadata",
schema: :news_article,
content_item: content_item.to_h %>
<% end %>

@yndajas yndajas force-pushed the test-image-caption branch from 337b953 to 24a75de Compare April 23, 2025 17:14
Copy link
Contributor

@leenagupte leenagupte left a 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
@govuk-ci govuk-ci temporarily deployed to govuk-frontend-app-pr-4767 April 23, 2025 17:40 Inactive
@yndajas
Copy link
Member Author

yndajas commented Apr 23, 2025

@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

Base automatically changed from test-image-caption to main April 24, 2025 10:18
Copy link
Contributor

@leenagupte leenagupte left a 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 👍

@yndajas yndajas merged commit 6eef538 into main Apr 24, 2025
13 checks passed
@yndajas yndajas deleted the high-res branch April 24, 2025 10:54
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.

6 participants