diff --git a/packages/site/gatsby-config.ts b/packages/site/gatsby-config.ts index 8296b9f..5992176 100644 --- a/packages/site/gatsby-config.ts +++ b/packages/site/gatsby-config.ts @@ -1,5 +1,6 @@ import { GatsbyConfig } from 'gatsby'; import dotenv from 'dotenv'; +import { SEO_DATA } from './seo-data'; dotenv.config({ path: `.env.${process.env.NODE_ENV}`, @@ -13,13 +14,6 @@ const config: GatsbyConfig = { 'gatsby-plugin-sharp', 'gatsby-transformer-sharp', 'gatsby-plugin-postcss', - // { - // resolve: 'gatsby-plugin-sri', - // options: { - // hash: 'sha512', - // crossorigin: false, - // }, - // }, { resolve: 'gatsby-plugin-csp', options: { @@ -44,7 +38,7 @@ const config: GatsbyConfig = { { resolve: 'gatsby-plugin-manifest', options: { - name: 'Template Snap', + name: 'RSS3 Social Notifier Snap', icon: 'src/assets/RSS3.svg', theme_color: '#0072FF', background_color: '#FFFFFF', @@ -52,6 +46,7 @@ const config: GatsbyConfig = { }, }, ], + siteMetadata: SEO_DATA, }; export default config; diff --git a/packages/site/seo-data.ts b/packages/site/seo-data.ts new file mode 100644 index 0000000..87c5d23 --- /dev/null +++ b/packages/site/seo-data.ts @@ -0,0 +1,44 @@ +const site = + process.env.NODE_ENV === 'production' + ? 'https://snap.rss3.io' + : 'http://localhost:8000'; + +export const SEO_DATA = { + title: 'RSS3 Snap - The Open Information Snap', + description: + "RSS3 Snap for MetaMask offers a quick and easy way to stay on top of your frens' social activities.", + language: 'en-US', + url: site, + image: `${site}/images/og.png`, + logo: 'https://rss3.io/images/logo.svg', + twitter: '@rss3_', + website: { + context: 'https://schema.org', + type: 'WebSite', + name: 'RSS3', + url: 'https://rss3.io', + }, + organization: { + context: 'https://schema.org', + type: 'Organization', + name: 'RSS3', + url: 'https://rss3.io/', + logo: 'https://rss3.io/images/logo.svg', + sameAs: ['https://twitter.com/rss3_'], + }, + keywords: [ + 'blockchain', + 'notifier', + 'RSS3 Notifier', + 'decentralization', + 'RSS3 Metamask snap', + 'Metamask snap', + 'Open Information', + 'Open Information Layer', + 'Open Web', + 'RSS3', + 'RSS3 Explorer', + 'web3', + 'web3 activities', + ], +}; diff --git a/packages/site/src/components/SEO.tsx b/packages/site/src/components/SEO.tsx new file mode 100644 index 0000000..1443f79 --- /dev/null +++ b/packages/site/src/components/SEO.tsx @@ -0,0 +1,93 @@ +import React from 'react'; +import { useSiteMetadata } from '@/hooks/use-site-metadata'; + +export type ISEOProps = { + title?: string; + description?: string; + pathname?: string; +}; +export const SEO = ({ + title = '', + description = '', + pathname = '', + children, +}: React.PropsWithChildren & ISEOProps) => { + const { + title: defaultTitle, + description: defaultDescription, + language, + url, + image, + logo, + twitter, + website, + organization, + keywords, + } = useSiteMetadata(); + + const seo = { + title: title || defaultTitle, + description: description || defaultDescription, + language, + url: `${url}${pathname}`, + image, + logo, + twitter, + website, + organization, + keywords, + }; + + return ( + <> +