Skip to content

Commit

Permalink
OG description bug for NFT instances
Browse files Browse the repository at this point in the history
Fixes #1578
  • Loading branch information
tom2drum committed Feb 23, 2024
1 parent cf6fb44 commit 452bcc4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/metadata/templates/title.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const TEMPLATE_MAP: Record<Route['pathname'], string> = {
'/address/[hash]/contract-verification': 'contract verification for %hash%',
'/tokens': 'tokens',
'/token/[hash]': '%symbol% token details',
'/token/[hash]/instance/[id]': 'token instance for %symbol%',
'/token/[hash]/instance/[id]': 'NFT instance',
'/apps': 'apps marketplace',
'/apps/[id]': '- %app_name%',
'/stats': 'statistics',
Expand Down
5 changes: 1 addition & 4 deletions lib/metadata/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@ import type { Route } from 'nextjs-routes';
import generate from './generate';

export default function update<R extends Route>(route: R, apiData: ApiData<R>) {
const { title, description, opengraph } = generate(route, apiData);
const { title, description } = generate(route, apiData);

window.document.title = title;
window.document.querySelector('meta[name="description"]')?.setAttribute('content', description);
window.document.querySelector('meta[property="og:title"]')?.setAttribute('content', opengraph.title);
opengraph.description &&
window.document.querySelector('meta[property="og:description"]')?.setAttribute('content', opengraph.description);
}

0 comments on commit 452bcc4

Please sign in to comment.