mirror of
https://github.com/coollabsio/coolify-examples.git
synced 2026-02-21 23:08:56 +00:00
new examples
This commit is contained in:
45
node/gatsby/src/components/seo.js
Normal file
45
node/gatsby/src/components/seo.js
Normal file
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* SEO component that queries for data with
|
||||
* Gatsby's useStaticQuery React hook
|
||||
*
|
||||
* See: https://www.gatsbyjs.com/docs/how-to/querying-data/use-static-query/
|
||||
*/
|
||||
|
||||
import * as React from "react"
|
||||
import { useStaticQuery, graphql } from "gatsby"
|
||||
|
||||
function Seo({ description, title, children }) {
|
||||
const { site } = useStaticQuery(
|
||||
graphql`
|
||||
query {
|
||||
site {
|
||||
siteMetadata {
|
||||
title
|
||||
description
|
||||
author
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
)
|
||||
|
||||
const metaDescription = description || site.siteMetadata.description
|
||||
const defaultTitle = site.siteMetadata?.title
|
||||
|
||||
return (
|
||||
<>
|
||||
<title>{defaultTitle ? `${title} | ${defaultTitle}` : title}</title>
|
||||
<meta name="description" content={metaDescription} />
|
||||
<meta property="og:title" content={title} />
|
||||
<meta property="og:description" content={metaDescription} />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta name="twitter:card" content="summary" />
|
||||
<meta name="twitter:creator" content={site.siteMetadata?.author || ``} />
|
||||
<meta name="twitter:title" content={title} />
|
||||
<meta name="twitter:description" content={metaDescription} />
|
||||
{children}
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default Seo
|
||||
Reference in New Issue
Block a user