Skip to content
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

Add image meta tags to De-risking Guide pages #713

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

nateborr
Copy link
Member

@nateborr nateborr commented Sep 12, 2024

Changes proposed in this pull request:

  • In the de-risking guide, replace a PNG image used in software solution pages with an equivalent SVG. This should discourage social sites from pulling the image from the page content and using it within link preview cards.
  • Implement optional og:image and og:image:alt meta tags that are configurable per guide. Details are in the updated development doc.
  • Add an og:image with empty alt text for the de-risking guide.

Resolves #705 .

Testing

Testing is manual and indirect, since image URLs are environment-specific and we don't have direct control over whether platforms use our pages' og:image metadata.

In the PR preview build

  • Confirm that the images on the introduction and software solutions pages are rendered correctly.
  • For any de-risking guide page, open the page source and confirm:
    • A meta og:image tag with content set to a relative path to an image file
    • A meta og:image:alt tag with content set to ""
  • Paste the relative image path onto the base URL for this PR build (https://federalist-8bc0b42c-5fd0-4ae8-9366-cd9c265a4446.sites.pages.cloud.gov/) and confirm that it serves a jpeg image of the De-risking Guide logo on a blue background.
  • For any page in a guide other than de-risking, confirm that no og:image or og:image:alt meta tag is present.

In a local build environment

  • Run NODE_ENV=production npm run dev
  • For any de-risking guide page, view the page source and confirm a meta og:image tag is present and has its content set to an absolute image URL, beginning with https://guides.18f.gov/

security considerations

No security considerations; these changes use the existing Eleventy framework and OpenGraph standards.

In particular, the mechanism for determining whether the build the site for a production environment is already used to generate sitemap.xml.

@nateborr nateborr force-pushed the guides-705-image-meta-tags branch 10 times, most recently from 7f9980e to 325be43 Compare September 18, 2024 23:05
@nateborr nateborr marked this pull request as ready for review September 18, 2024 23:59
@nateborr nateborr requested a review from a team as a code owner September 18, 2024 23:59
@nateborr nateborr changed the title [Draft] Add image meta tags to Guides pages Add image meta tags to De-risking Guide pages Sep 19, 2024
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.

[Request]: Add social meta tags to de-risking guide pages
1 participant