mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-04 17:25:59 +02:00
fix: improve SEO types
This commit is contained in:
@@ -3,13 +3,20 @@ import Helmet from "react-helmet"
|
||||
import { useStaticQuery, graphql } from "gatsby"
|
||||
|
||||
interface SEOProps {
|
||||
readonly description: string
|
||||
readonly lang: string
|
||||
readonly meta: object[]
|
||||
readonly description?: string
|
||||
readonly lang?: string
|
||||
readonly meta?: any[]
|
||||
readonly keywords?: string[]
|
||||
readonly title: string
|
||||
}
|
||||
|
||||
const SEO = ({ description = "", lang = "en", meta = [], title }: SEOProps) => {
|
||||
const SEO = ({
|
||||
description,
|
||||
lang = "en",
|
||||
meta = [],
|
||||
keywords = [],
|
||||
title,
|
||||
}: SEOProps) => {
|
||||
const { site } = useStaticQuery(
|
||||
graphql`
|
||||
query {
|
||||
@@ -66,7 +73,16 @@ const SEO = ({ description = "", lang = "en", meta = [], title }: SEOProps) => {
|
||||
name: `twitter:description`,
|
||||
content: metaDescription,
|
||||
},
|
||||
]}
|
||||
]
|
||||
.concat(
|
||||
keywords.length > 0
|
||||
? {
|
||||
name: `keywords`,
|
||||
content: keywords.join(`, `),
|
||||
}
|
||||
: []
|
||||
)
|
||||
.concat(meta)}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user