mirror of
https://github.com/UiO-Gaming/uiogaming.no.git
synced 2026-11-05 13:56:47 +01:00
fix image in social cards
This commit is contained in:
2 files changed
+3
-16
No files matched your search
@@ -4,7 +4,6 @@ module.exports = {
|
||||
description: `En hobbyforening som ønsker skape et sosialt miljø rundt gaming og E-sport på UiO!`,
|
||||
author: `@uiogaming`,
|
||||
url: `https://uiogaming.no`,
|
||||
image: `logo.jpg`,
|
||||
},
|
||||
plugins: [
|
||||
`gatsby-plugin-react-helmet`,
|
||||
|
||||
+3
-15
@@ -10,7 +10,7 @@ import PropTypes from "prop-types"
|
||||
import { Helmet } from "react-helmet"
|
||||
import { useStaticQuery, graphql } from "gatsby"
|
||||
|
||||
function Seo({ description, lang, meta, image: metaImage, title, author }) {
|
||||
function Seo({ description, lang, meta, imageURL, title, author }) {
|
||||
const { site } = useStaticQuery(
|
||||
graphql`
|
||||
query {
|
||||
@@ -19,7 +19,6 @@ function Seo({ description, lang, meta, image: metaImage, title, author }) {
|
||||
title
|
||||
description
|
||||
author
|
||||
image
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,8 +28,7 @@ function Seo({ description, lang, meta, image: metaImage, title, author }) {
|
||||
const metaAuthor = author || site.siteMetadata.author
|
||||
const metaDescription = description || site.siteMetadata.description
|
||||
const defaultTitle = site.siteMetadata?.title
|
||||
const image =
|
||||
image || `${site.siteMetadata.siteUrl}/${site.siteMetadata.image}`
|
||||
const image = imageURL || `${site.siteMetadata.siteUrl}/logo.jpg`
|
||||
|
||||
return (
|
||||
<Helmet
|
||||
@@ -82,20 +80,12 @@ function Seo({ description, lang, meta, image: metaImage, title, author }) {
|
||||
},
|
||||
]
|
||||
.concat(
|
||||
metaImage
|
||||
image
|
||||
? [
|
||||
{
|
||||
property: "og:image",
|
||||
content: image,
|
||||
},
|
||||
{
|
||||
property: "og:image:width",
|
||||
content: metaImage.width,
|
||||
},
|
||||
{
|
||||
property: "og:image:height",
|
||||
content: metaImage.height,
|
||||
},
|
||||
{
|
||||
name: "twitter:card",
|
||||
content: "summary_large_image",
|
||||
@@ -117,11 +107,9 @@ Seo.defaultProps = {
|
||||
lang: `no`,
|
||||
meta: [],
|
||||
description: ``,
|
||||
image: null,
|
||||
}
|
||||
|
||||
Seo.propTypes = {
|
||||
image: PropTypes.string,
|
||||
description: PropTypes.string,
|
||||
lang: PropTypes.string,
|
||||
meta: PropTypes.arrayOf(PropTypes.object),
|
||||
|
||||
Reference in new issue
Block a user