Skip to content

Commit

Permalink
review fix
Browse files Browse the repository at this point in the history
  • Loading branch information
isstuev committed Sep 21, 2023
1 parent 8f779bf commit 71c96f9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
6 changes: 4 additions & 2 deletions configs/app/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ const defaultImageUrl = app.baseUrl + '/static/og_placeholder.png';

const meta = Object.freeze({
promoteBlockscout: getEnvValue(process.env.NEXT_PUBLIC_PROMOTE_BLOCKSCOUT_IN_TITLE) || 'true',
ogDescription: getEnvValue(process.env.NEXT_PUBLIC_OG_DESCRIPTION) || '',
ogImageUrl: getEnvValue(process.env.NEXT_PUBLIC_OG_IMAGE_URL) || defaultImageUrl,
og: {
description: getEnvValue(process.env.NEXT_PUBLIC_OG_DESCRIPTION) || '',
imageUrl: getEnvValue(process.env.NEXT_PUBLIC_OG_IMAGE_URL) || defaultImageUrl,
},
});

export default meta;
8 changes: 5 additions & 3 deletions docs/ENVS.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,13 @@ By default, the app has generic favicon. You can override this behavior by provi

### Meta

Settings for meta tags and OG tags

| Variable | Type| Description | Compulsoriness | Default value | Example value |
| --- | --- | --- | --- | --- | --- |
| NEXT_PUBLIC_PROMOTE_BLOCKSCOUT_IN_TITLE | `boolean` | Set to `true` to promote Blockscout in page titles | - | `true` | `true` |
| NEXT_PUBLIC_OG_DESCRIPTION | `string` | OG description for the homepage | - | - | `Blockscout is the #1 open-source blockchain explorer available today. 100+ chains and counting rely on Blockscout data availability, APIs, and ecosystem tools to support their networks.` |
| NEXT_PUBLIC_OG_IMAGE_URL | `string` | OG image url for homepage and root pages. Minimum image size is 200 x 20 pixels; maximum supported file size is 8 MB; 1.91:1 aspect ratio; supported formats: image/jpeg, image/gif, image/png | - | `static/og_placeholder.png` | `https://placekitten.com/1200/600` |
| NEXT_PUBLIC_PROMOTE_BLOCKSCOUT_IN_TITLE | `boolean` | Set to `true` to promote Blockscout in meta and OG titles | - | `true` | `true` |
| NEXT_PUBLIC_OG_DESCRIPTION | `string` | OG description for for homepage and root pages | - | - | `Blockscout is the #1 open-source blockchain explorer available today. 100+ chains and counting rely on Blockscout data availability, APIs, and ecosystem tools to support their networks.` |
| NEXT_PUBLIC_OG_IMAGE_URL | `string` | OG image url for homepage and root pages. Minimum image size is 200 x 20 pixels (recommended: 1200 x 600); maximum supported file size is 8 MB; 2:1 aspect ratio; supported formats: image/jpeg, image/gif, image/png | - | `static/og_placeholder.png` | `https://placekitten.com/1200/600` |

 

Expand Down
4 changes: 2 additions & 2 deletions lib/metadata/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export default function generate<R extends Route>(route: R, apiData?: ApiData<R>
description,
opengraph: {
title: title,
description: pageOgType !== 'Regular page' ? config.meta.ogDescription : '',
imageUrl: pageOgType !== 'Regular page' ? config.meta.ogImageUrl : '',
description: pageOgType !== 'Regular page' ? config.meta.og.description : '',
imageUrl: pageOgType !== 'Regular page' ? config.meta.og.imageUrl : '',
},
};
}

0 comments on commit 71c96f9

Please sign in to comment.