1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2024-11-14 09:05:15 +01:00

simplify meta queries

This commit is contained in:
Matthias Kretschmann 2020-06-01 12:49:10 +02:00
parent 6699829972
commit a9139865ea
Signed by: m
GPG Key ID: 606EEEF3C479A91F
6 changed files with 5 additions and 23 deletions

View File

@ -11,6 +11,7 @@
# Footer actions
gpg: https://kretschmann.io/pub.gpg
addressbook: /matthias-kretschmann.vcf
bugs: https://github.com/kremalicious/portfolio/issues
typekitID: dtg3zui

View File

@ -20,13 +20,6 @@ module.exports = {
path: path.join(__dirname, 'content')
}
},
{
resolve: 'gatsby-source-filesystem',
options: {
name: 'pkg',
path: path.join(__dirname, 'package.json')
}
},
{
resolve: 'gatsby-source-filesystem',
options: {

View File

@ -18,6 +18,7 @@
},
"gpg": "https://kretschmann.io/pub.gpg",
"addressbook": "/matthias-kretschmann.vcf",
"bugs": "https://github.com/kremalicious/portfolio/issues",
"typekitID": "dtg3zui",
"matomoUrl": "https://analytics.kremalicious.com",
"matomoSite": 2,

View File

@ -12,7 +12,6 @@ beforeAll(() => {
...meta,
...resume,
photoSrc,
portfolioJson: { bugs: '' },
...projects
}

View File

@ -4,7 +4,6 @@
"version": "0.1.0",
"homepage": "https://matthiaskretschmann.com",
"repository": "github:kremalicious/portfolio",
"bugs": "https://github.com/kremalicious/portfolio/issues",
"license": "MIT",
"author": "Matthias Kretschmann <m@kretschmann.io>",
"scripts": {

View File

@ -1,6 +1,5 @@
import React, { memo } from 'react'
import PropTypes from 'prop-types'
import { graphql, useStaticQuery } from 'gatsby'
import loadable from '@loadable/component'
import LogoUnit from '../molecules/LogoUnit'
import Networks from '../molecules/Networks'
@ -9,15 +8,7 @@ import { useMeta } from '../../hooks/use-meta'
const LazyVcard = loadable(() => import('../atoms/Vcard'))
const query = graphql`
query FooterQuery {
portfolioJson {
bugs
}
}
`
const FooterMarkup = ({ pkg, meta, year }) => (
const FooterMarkup = ({ meta, year }) => (
<footer className={`h-card ${styles.footer}`}>
<LogoUnit minimal />
<Networks small />
@ -27,7 +18,7 @@ const FooterMarkup = ({ pkg, meta, year }) => (
<a className="u-key" href={meta.gpg}>
PGP/GPG key
</a>
<a href={pkg.bugs}>Found a bug?</a>
<a href={meta.bugs}>Found a bug?</a>
</p>
<p className={styles.copyright}>
<small>
@ -42,17 +33,15 @@ const FooterMarkup = ({ pkg, meta, year }) => (
)
FooterMarkup.propTypes = {
pkg: PropTypes.object.isRequired,
meta: PropTypes.object.isRequired,
year: PropTypes.number.isRequired
}
function Footer() {
const metaYaml = useMeta()
const { portfolioJson } = useStaticQuery(query)
const year = new Date().getFullYear()
return <FooterMarkup year={year} pkg={portfolioJson} meta={metaYaml} />
return <FooterMarkup year={year} meta={metaYaml} />
}
export default memo(Footer)