mirror of
https://github.com/kremalicious/portfolio.git
synced 2025-01-03 10:25:00 +01:00
favicon & SEO tweaks
This commit is contained in:
parent
0e6a6cdeb9
commit
270abc5551
@ -5,6 +5,7 @@ description: Portfolio of web & ui designer/developer hybrid Matthias Kretsc
|
|||||||
url: https://matthiaskretschmann.com
|
url: https://matthiaskretschmann.com
|
||||||
email: m@kretschmann.io
|
email: m@kretschmann.io
|
||||||
avatar: ../src/images/avatar.jpg
|
avatar: ../src/images/avatar.jpg
|
||||||
|
img: ../src/images/twitter-card.png
|
||||||
|
|
||||||
social:
|
social:
|
||||||
Email: mailto:m@kretschmann.io
|
Email: mailto:m@kretschmann.io
|
||||||
|
@ -13,6 +13,7 @@ module.exports = {
|
|||||||
'gatsby-transformer-yaml',
|
'gatsby-transformer-yaml',
|
||||||
'gatsby-transformer-sharp',
|
'gatsby-transformer-sharp',
|
||||||
'gatsby-plugin-sharp',
|
'gatsby-plugin-sharp',
|
||||||
|
'gatsby-plugin-offline',
|
||||||
{
|
{
|
||||||
resolve: 'gatsby-plugin-sass',
|
resolve: 'gatsby-plugin-sass',
|
||||||
options: {
|
options: {
|
||||||
@ -50,6 +51,23 @@ module.exports = {
|
|||||||
// see https://github.com/smooth-code/svgr for a list of all options
|
// see https://github.com/smooth-code/svgr for a list of all options
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'gatsby-plugin-offline',
|
{
|
||||||
|
resolve: 'gatsby-plugin-favicon',
|
||||||
|
options: {
|
||||||
|
logo: './src/images/favicon.png',
|
||||||
|
injectHTML: true,
|
||||||
|
icons: {
|
||||||
|
android: true,
|
||||||
|
appleIcon: true,
|
||||||
|
appleStartup: false,
|
||||||
|
coast: false,
|
||||||
|
favicons: true,
|
||||||
|
firefox: true,
|
||||||
|
twitter: false,
|
||||||
|
yandex: true,
|
||||||
|
windows: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
"gatsby": "^1.9.259",
|
"gatsby": "^1.9.259",
|
||||||
"gatsby-image": "^1.0.51",
|
"gatsby-image": "^1.0.51",
|
||||||
"gatsby-link": "^1.6.44",
|
"gatsby-link": "^1.6.44",
|
||||||
|
"gatsby-plugin-favicon": "^2.1.1",
|
||||||
"gatsby-plugin-google-analytics": "^1.0.31",
|
"gatsby-plugin-google-analytics": "^1.0.31",
|
||||||
"gatsby-plugin-offline": "^1.0.15",
|
"gatsby-plugin-offline": "^1.0.15",
|
||||||
"gatsby-plugin-react-helmet": "^2.0.11",
|
"gatsby-plugin-react-helmet": "^2.0.11",
|
||||||
|
@ -2,11 +2,11 @@ import React from 'react'
|
|||||||
import Helmet from 'react-helmet'
|
import Helmet from 'react-helmet'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
const SEO = ({ postMeta, meta }) => {
|
const SEO = ({ project, meta }) => {
|
||||||
const title = postMeta.title || meta.title
|
const title = project.title ? project.title : meta.title
|
||||||
const description = postMeta.description || meta.description
|
const description = project.description ? project.description : meta.description
|
||||||
const image = postMeta.img || meta.img || null
|
const image = project.img ? project.img.childImageSharp.twitterImage.src : meta.img.childImageSharp.resize.src
|
||||||
const url = postMeta.slug ? `${meta.url}/${postMeta.slug}` : meta.url
|
const url = project.slug ? `${meta.url}/${project.slug}` : meta.url
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Helmet>
|
<Helmet>
|
||||||
@ -32,12 +32,12 @@ const SEO = ({ postMeta, meta }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
SEO.propTypes = {
|
SEO.propTypes = {
|
||||||
postMeta: PropTypes.object,
|
project: PropTypes.object,
|
||||||
meta: PropTypes.object,
|
meta: PropTypes.object,
|
||||||
}
|
}
|
||||||
|
|
||||||
SEO.defaultProps = {
|
SEO.defaultProps = {
|
||||||
postMeta: {},
|
project: {},
|
||||||
meta: {},
|
meta: {},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,9 +13,7 @@ class Header extends Component {
|
|||||||
const meta = this.props.meta
|
const meta = this.props.meta
|
||||||
|
|
||||||
let classes = 'header'
|
let classes = 'header'
|
||||||
if (!isHomepage) {
|
if (!isHomepage) classes += ' header--minimal'
|
||||||
classes += ' header--minimal'
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<header className={classes}>
|
<header className={classes}>
|
||||||
|
BIN
src/images/favicon.png
Normal file
BIN
src/images/favicon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.3 KiB |
BIN
src/images/twitter-card.png
Normal file
BIN
src/images/twitter-card.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.6 KiB |
@ -81,6 +81,13 @@ export const query = graphql`
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
img {
|
||||||
|
childImageSharp {
|
||||||
|
resize(width: 980) {
|
||||||
|
src
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
social {
|
social {
|
||||||
Email
|
Email
|
||||||
Blog
|
Blog
|
||||||
|
@ -32,7 +32,7 @@ class Project extends Component {
|
|||||||
<title>{title}</title>
|
<title>{title}</title>
|
||||||
</Helmet>
|
</Helmet>
|
||||||
|
|
||||||
<SEO meta={meta} postMeta={project} />
|
<SEO project={project} meta={meta} />
|
||||||
|
|
||||||
<article className="project">
|
<article className="project">
|
||||||
<Content>
|
<Content>
|
||||||
@ -79,6 +79,13 @@ export const projectQuery = graphql`
|
|||||||
url
|
url
|
||||||
}
|
}
|
||||||
techstack
|
techstack
|
||||||
|
img {
|
||||||
|
childImageSharp {
|
||||||
|
twitterImage: resize(width: 980) {
|
||||||
|
src
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dataYaml {
|
dataYaml {
|
||||||
title
|
title
|
||||||
@ -99,6 +106,13 @@ export const projectQuery = graphql`
|
|||||||
}
|
}
|
||||||
typekit
|
typekit
|
||||||
googleanalytics
|
googleanalytics
|
||||||
|
img {
|
||||||
|
childImageSharp {
|
||||||
|
resize(width: 980) {
|
||||||
|
src
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
projectImages: allImageSharp(
|
projectImages: allImageSharp(
|
||||||
filter: { id: { regex: $slug } }
|
filter: { id: { regex: $slug } }
|
||||||
|
Loading…
Reference in New Issue
Block a user