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 Open Graph meta tags to each page #900

Closed
Tracked by #894
codemonkey800 opened this issue Feb 9, 2023 · 4 comments
Closed
Tracked by #894

Add Open Graph meta tags to each page #900

codemonkey800 opened this issue Feb 9, 2023 · 4 comments
Assignees
Labels

Comments

@codemonkey800
Copy link
Collaborator

codemonkey800 commented Feb 9, 2023

Open Graph meta tags allow us to enrich the appearance of links on social media. We currently have Open Graph tags implemented for collections: #553

But we do not have it for other pages. The main things we can add to the Open Graph tags are:

  • Title
  • Type
  • URL
  • Image
  • Description

<>
<meta property="og:title" content={collection.title} />
<meta property="og:type" content="article" />
<meta
property="og:url"
content={`https://napari-hub.org/collections/${collection.title}`}
/>
<meta property="og:image" content={collection.cover_image} />
<meta property="og:description" content={collection.summary} />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@napari_imaging" />
<meta name="twitter:title" content={collection.title} />
<meta name="twitter:description" content={collection.summary} />
<meta name="twitter:image" content={collection.cover_image} />
{curatorTwitter && (
<meta name="twitter:creator" content={`@${curatorTwitter}`} />
)}
</>

@EricMaxWang
Copy link

EricMaxWang commented Feb 13, 2023

@codemonkey800 split ticket into different tickets for: metadata vs. image service

TBD on image service effort; @codemonkey800 to follow up w/ @neuromusic

@EricMaxWang EricMaxWang moved this from Backlog to Ready in napari hub backlog Feb 13, 2023
@codemonkey800 codemonkey800 moved this from Ready to In Progress in napari hub backlog Feb 14, 2023
@codemonkey800
Copy link
Collaborator Author

almost done with a PR for this, but currently running into an issue with duplicate meta tags being stuck on the page after initial render:

meta-tags-duplicate-issue.mp4

I'm looking into a fix right now

@codemonkey800
Copy link
Collaborator Author

actually I looked into it more, and I think it's fine if we hold off on fixing the above issue for now. what's important is the meta tags are correct on initial render, and they are:

image

it seems like the duplicates happen after Next.js hydrates the page, but for open graph it doesn't matter since it doesn't use JavaScript to load the tags

@codemonkey800
Copy link
Collaborator Author

created a separate issue to track the above bug:

#912

@codemonkey800 codemonkey800 moved this from In Progress to In Code Review in napari hub backlog Feb 16, 2023
@codemonkey800 codemonkey800 moved this from In Code Review to Pending QA & Release in napari hub backlog Mar 7, 2023
@codemonkey800 codemonkey800 moved this from Pending QA & Release to Done in napari hub backlog Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

2 participants