1
0
mirror of https://github.com/kremalicious/blog.git synced 2024-12-31 17:17:46 +01:00

fix avatar

This commit is contained in:
Matthias Kretschmann 2018-10-01 19:57:49 +02:00
parent d5b3adc32f
commit 0207034455
Signed by: m
GPG Key ID: 606EEEF3C479A91F
6 changed files with 42 additions and 14 deletions

View File

@ -1,5 +1,3 @@
const path = require('path')
module.exports = { module.exports = {
siteTitle: 'kremalicious', siteTitle: 'kremalicious',
siteTitleShort: 'krlc', siteTitleShort: 'krlc',
@ -8,12 +6,10 @@ module.exports = {
themeColor: '#88bec8', themeColor: '#88bec8',
backgroundColor: '#e7eef4', backgroundColor: '#e7eef4',
pathPrefix: null, pathPrefix: null,
logo: path.resolve(__dirname, 'src/images/avatar.jpg'),
author: { author: {
name: 'Matthias Kretschmann', name: 'Matthias Kretschmann',
email: 'm@kretschmann.io', email: 'm@kretschmann.io',
uri: 'https://matthiaskretschmann.com', uri: 'https://matthiaskretschmann.com',
avatar: './src/images/avatar.jpg',
twitter: 'https://twitter.com/kremalicious', twitter: 'https://twitter.com/kremalicious',
github: 'https://github.com/kremalicious', github: 'https://github.com/kremalicious',
facebook: 'https://facebook.com/matthiaskretschmann', facebook: 'https://facebook.com/matthiaskretschmann',

View File

@ -42,7 +42,9 @@ export default class PostActions extends PureComponent {
<h1 className={styles.actionTitle}>Found something useful?</h1> <h1 className={styles.actionTitle}>Found something useful?</h1>
<p className={styles.actionText}> <p className={styles.actionText}>
Say thanks{' '} Say thanks{' '}
<button className="link" onClick={this.toggleModal}>with Bitcoins or Ether.</button> <button className="link" onClick={this.toggleModal}>
with Bitcoins or Ether.
</button>
</p> </p>
</article> </article>

View File

@ -13,7 +13,14 @@ const query = graphql`
author { author {
name name
twitter twitter
avatar }
}
}
logo: allFile(filter: { name: { eq: "apple-touch-icon" } }) {
edges {
node {
relativePath
} }
} }
} }
@ -131,6 +138,8 @@ const SEO = ({ post, slug, postSEO }) => (
query={query} query={query}
render={data => { render={data => {
const siteMeta = data.site.siteMetadata const siteMeta = data.site.siteMetadata
const logo = data.logo.edges[0].node.relativePath
let title let title
let description let description
let image let image
@ -140,14 +149,12 @@ const SEO = ({ post, slug, postSEO }) => (
const postMeta = post.frontmatter const postMeta = post.frontmatter
title = `${postMeta.siteTitle} ¦ ${siteMeta.siteDescription}` title = `${postMeta.siteTitle} ¦ ${siteMeta.siteDescription}`
description = postMeta.description ? postMeta.description : post.excerpt description = postMeta.description ? postMeta.description : post.excerpt
image = postMeta.image image = postMeta.image ? postMeta.image.childImageSharp.fluid.src : logo
? postMeta.image.childImageSharp.fluid.src
: siteMeta.author.avatar
postURL = `${siteMeta.siteUrl}${slug}` postURL = `${siteMeta.siteUrl}${slug}`
} else { } else {
title = `${siteMeta.siteTitle} ¦ ${siteMeta.siteDescription}` title = `${siteMeta.siteTitle} ¦ ${siteMeta.siteDescription}`
description = siteMeta.siteDescription description = siteMeta.siteDescription
image = siteMeta.author.avatar image = logo
} }
image = `${siteMeta.siteUrl}${image}` image = `${siteMeta.siteUrl}${image}`

View File

@ -1,6 +1,6 @@
import React from 'react' import React from 'react'
import { StaticQuery, graphql } from 'gatsby' import { StaticQuery, graphql } from 'gatsby'
// import Img from 'gatsby-image' import Img from 'gatsby-image'
import IconLinks from './IconLinks' import IconLinks from './IconLinks'
import styles from './Vcard.module.scss' import styles from './Vcard.module.scss'
@ -18,6 +18,18 @@ const query = graphql`
} }
} }
} }
avatar: allFile(filter: { name: { eq: "avatar" } }) {
edges {
node {
childImageSharp {
fixed(width: 80, height: 80, quality: 90) {
...GatsbyImageSharpFixed_withWebp_noBase64
}
}
}
}
}
} }
` `
@ -29,16 +41,22 @@ const Vcard = () => (
twitter, twitter,
github, github,
facebook, facebook,
avatar,
name, name,
uri uri
} = data.site.siteMetadata.author } = data.site.siteMetadata.author
const avatar = data.avatar.edges[0].node.childImageSharp.fixed
const links = [twitter, github, facebook] const links = [twitter, github, facebook]
return ( return (
<div className="vcard author"> <div className="vcard author">
<img className={styles.avatar} src={avatar} alt="avatar" /> <Img
className={styles.avatar}
fixed={avatar}
alt="avatar"
width="80"
height="80"
/>
<p className={styles.description}> <p className={styles.description}>
Blog of designer &amp; developer{' '} Blog of designer &amp; developer{' '}
<a className="fn" rel="author" href={uri}> <a className="fn" rel="author" href={uri}>

View File

@ -5,7 +5,12 @@
@include media-frame; @include media-frame;
margin-bottom: ($spacer / 2); margin-bottom: ($spacer / 2);
border-radius: 50%;
&,
img {
border-radius: 50%;
overflow: hidden;
}
} }
.description { .description {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 64 KiB