facioquo / uswds-design-patterns

Design pattern Idea Book for the U.S. Web Design System
https://uswds.facioquo.com
Creative Commons Zero v1.0 Universal
1 stars 1 forks source link

Meta information not showing for page routes when social sharing #94

Open DaveSkender opened 1 year ago

DaveSkender commented 1 year ago

When social sharing links to pattern pages, the page-specific description and social card are not rendered -- it's showing the site defaults only. I suspect this is partly due to use of Angular SPA, but am hoping it's just a simple fix.

image

Google Search results does pickup the page title okay, but still misses on the provided description and card, and culls a description from the page body.

image

[!NOTE] Prior attempt: I'd done some work with a meta utility that uses a meta resource file, hoping that injecting this information into the HTML <HEAD> DOM might work better, but think it occurs too late in the page load cycle to get scraped by search crawlers and social preview generators.

DaveSkender commented 7 months ago

I started to look into making this an Angular Universal app with server-side rendering (SSR), which I think would solve this issue. I've backed off that approach because it seems like overkill for something so basic; it also adds potentially unneeded complexity for a simple demo site. I feel like I'm missing a really simple solution here. Anybody want to take another look at this problem?