1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2025-02-14 21:10:41 +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 # Footer actions
gpg: https://kretschmann.io/pub.gpg gpg: https://kretschmann.io/pub.gpg
addressbook: /matthias-kretschmann.vcf addressbook: /matthias-kretschmann.vcf
bugs: https://github.com/kremalicious/portfolio/issues
typekitID: dtg3zui typekitID: dtg3zui

View File

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

View File

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

View File

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

View File

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

View File

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