diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..ea92f360 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,4 @@ +plugins/gatsby-redirect-from +node_modules +public +.cache diff --git a/.eslintrc b/.eslintrc index bcf8949d..48d2d1d1 100644 --- a/.eslintrc +++ b/.eslintrc @@ -3,9 +3,10 @@ "extends": [ "eslint:recommended", "plugin:react/recommended", + "plugin:jsx-a11y/recommended", "plugin:prettier/recommended" ], - "plugins": ["react", "graphql", "prettier"], + "plugins": ["react", "graphql", "prettier", "jsx-a11y"], "parserOptions": { "sourceType": "module", "ecmaFeatures": { diff --git a/.travis.yml b/.travis.yml index 6abe4d23..edab949d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ install: script: - npm test - - npm run build + - travis_wait 60 npm run build after_success: - pip install --user awscli diff --git a/config.js b/config.js new file mode 100644 index 00000000..830390b8 --- /dev/null +++ b/config.js @@ -0,0 +1,33 @@ +module.exports = { + siteTitle: 'kremalicious', + siteTitleShort: 'krlc', + siteDescription: 'Blog of designer & developer Matthias Kretschmann.', + siteUrl: 'https://kremalicious.com', + themeColor: '#88bec8', + backgroundColor: '#e7eef4', + pathPrefix: null, + author: { + name: 'Matthias Kretschmann', + email: 'm@kretschmann.io', + uri: 'https://matthiaskretschmann.com', + twitter: 'https://twitter.com/kremalicious', + github: 'https://github.com/kremalicious', + facebook: 'https://facebook.com/matthiaskretschmann', + bitcoin: '171qDmKEXm9YBgBLXyGjjPvopP5o9htQ1V', + ether: '0x339dbC44d39bf1961E385ed0Ae88FC6069b87Ea1' + }, + rss: '/feed.xml', + jsonfeed: '/feed.json', + typekitID: 'msu4qap', + itemsPerPage: 20, + menu: [ + { + title: 'Photos', + link: '/photos' + }, + { + title: 'Goodies', + link: '/goodies' + } + ] +} diff --git a/content/menu.yml b/content/menu.yml deleted file mode 100644 index 1fdba700..00000000 --- a/content/menu.yml +++ /dev/null @@ -1,5 +0,0 @@ -- title: Photos - link: /photos - -- title: Goodies - link: /goodies diff --git a/content/meta.yml b/content/meta.yml deleted file mode 100644 index 75529cc2..00000000 --- a/content/meta.yml +++ /dev/null @@ -1,31 +0,0 @@ -# -# Home: / -# Archive Page: /archive/ -# Pagination: /page/N/ -# Post: /post-slug/ -# RSS Feed: /feed/ -# - -# Basics -# -------------------- - -title: kremalicious -tagline: 'Blog of designer & developer Matthias Kretschmann' -url: https://kremalicious.com -author: - name: Matthias Kretschmann - email: m@kretschmann.io - uri: https://matthiaskretschmann.com - twitter: https://twitter.com/kremalicious - github: https://github.com/kremalicious - facebook: https://facebook.com/matthiaskretschmann - googleplus: https://plus.google.com/+MatthiasKretschmann - rss: /feed.xml - jsonfeed: /feed.json - avatar: ../src/images/avatar.jpg - bitcoin: 171qDmKEXm9YBgBLXyGjjPvopP5o9htQ1V - ether: "0x339dbC44d39bf1961E385ed0Ae88FC6069b87Ea1" - - -typekitID: msu4qap -itemsPerPage: 20 diff --git a/gatsby-config.js b/gatsby-config.js index e6f395a1..790ed403 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -1,18 +1,12 @@ const path = require('path') -const fs = require('fs') -const yaml = require('js-yaml') -const meta = yaml.load(fs.readFileSync('./content/meta.yml', 'utf8')) -const { title, tagline, url, author } = meta +const siteConfig = require('./config') // required for gatsby-plugin-meta-redirect require('regenerator-runtime/runtime') module.exports = { siteMetadata: { - title: `${title}`, - description: `${tagline}`, - siteUrl: `${url}`, - author: `${author.name}` + ...siteConfig }, plugins: [ { @@ -29,13 +23,6 @@ module.exports = { path: path.join(__dirname, 'content', 'media') } }, - { - resolve: 'gatsby-source-filesystem', - options: { - name: 'posts', - path: path.join(__dirname, 'content') - } - }, { resolve: 'gatsby-source-filesystem', options: { @@ -129,7 +116,7 @@ module.exports = { options: { siteId: '1', matomoUrl: 'https://analytics.kremalicious.com', - siteUrl: `${url}` + siteUrl: `${siteConfig.siteUrl}` } }, { @@ -138,14 +125,14 @@ module.exports = { logo: './src/images/apple-touch-icon.png', // WebApp Manifest Configuration - appName: title.toLowerCase(), - appDescription: tagline, - developerName: author.name, - developerURL: author.uri, + appName: siteConfig.siteTitle.toLowerCase(), + appDescription: siteConfig.siteDescription, + developerName: siteConfig.author.name, + developerURL: siteConfig.author.uri, dir: 'auto', lang: 'en-US', - background: '#e7eef4', - theme_color: '#88bec8', + background: siteConfig.backgroundColor, + theme_color: siteConfig.themeColor, display: 'minimal-ui', orientation: 'any', start_url: '/?homescreen=1', @@ -172,26 +159,27 @@ module.exports = { { site { siteMetadata { - title - description + siteTitle + siteDescription siteUrl + title: siteTitle + description: siteDescription site_url: siteUrl - author } } } `, feeds: [ { - serialize: ({ query: { site, allMarkdownRemark } }) => { + serialize: ({ query: { allMarkdownRemark } }) => { return allMarkdownRemark.edges.map(edge => ({ title: edge.node.frontmatter.title, date: edge.node.fields.date, description: feedContent(edge), - url: site.siteMetadata.siteUrl + edge.node.fields.slug, + url: siteConfig.siteUrl + edge.node.fields.slug, categories: edge.node.frontmatter.tags, - author: site.siteMetadata.author, - guid: site.siteMetadata.siteUrl + edge.node.fields.slug + author: siteConfig.author.name, + guid: siteConfig.siteUrl + edge.node.fields.slug })) }, query: ` @@ -224,8 +212,8 @@ module.exports = { ] } }, + 'gatsby-plugin-webpack-size', 'gatsby-plugin-react-helmet', - 'gatsby-transformer-yaml', 'gatsby-plugin-sharp', 'gatsby-transformer-sharp', 'gatsby-plugin-sitemap', diff --git a/gatsby-node.js b/gatsby-node.js index ddf895c2..b6734dbc 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -1,13 +1,9 @@ const path = require('path') -const fs = require('fs') -const yaml = require('js-yaml') const { createFilePath } = require('gatsby-source-filesystem') const fastExif = require('fast-exif') const Fraction = require('fraction.js') const dms2dec = require('dms2dec') - -const meta = yaml.load(fs.readFileSync('./content/meta.yml', 'utf8')) -const { itemsPerPage } = meta +const { itemsPerPage } = require('./config') const redirects = [ { f: '/feed', t: '/feed.xml' }, diff --git a/package.json b/package.json index fabe68c2..7635ad8d 100644 --- a/package.json +++ b/package.json @@ -9,15 +9,19 @@ "scripts": { "start": "gatsby develop", "build": "gatsby build", - "format": "prettier --write 'src/**/*.{js,jsx}'", - "format:css": "prettier-stylelint --write --quiet 'src/**/*.{css,scss}'", - "lint:js": "eslint ./gatsby-*.js && eslint ./src/**/*.jsx", + "ssr": "npm run build && serve -s public/", + "format": "run-p format:js format:css format:md format:yaml", + "format:js": "prettier-eslint --write 'src/**/*.{js,jsx}'", + "format:css": "prettier-stylelint --write", + "format:md": "prettier --write \"**/*.md\" --no-semi", + "format:yaml": "prettier --write \"**/*.y?(a)ml\"", + "lint:js": "eslint --ext .js,.jsx .", "lint:css": "stylelint ./src/**/*.{css,scss}", - "lint:md": "markdownlint ./content/posts/**/*.md && markdownlint ./README.md", - "lint": "npm run lint:md && npm run lint:js && npm run lint:css", + "lint:md": "markdownlint \"**/*.md\"", + "lint:yaml": "prettier --list-different \"**/*.y?(a)ml\"", + "lint": "run-p --continue-on-error lint:js lint:css lint:yaml", "test": "npm run lint", "deploy": "./scripts/deploy.sh", - "svg": "./scripts/svg.sh", "new": "babel-node ./scripts/new.js" }, "browserslist": [ @@ -27,11 +31,11 @@ "dms2dec": "^1.1.0", "fast-exif": "^1.0.1", "fraction.js": "^4.0.9", - "gatsby": "^2.0.12", - "gatsby-image": "^2.0.12", + "gatsby": "^2.0.13", + "gatsby-image": "^2.0.13", "gatsby-plugin-catch-links": "^2.0.3", "gatsby-plugin-favicon": "^3.1.4", - "gatsby-plugin-feed": "^2.0.5", + "gatsby-plugin-feed": "^2.0.6", "gatsby-plugin-lunr": "^1.2.0", "gatsby-plugin-matomo": "^0.5.0", "gatsby-plugin-meta-redirect": "^1.1.0", @@ -41,6 +45,7 @@ "gatsby-plugin-sharp": "^2.0.5", "gatsby-plugin-sitemap": "^2.0.1", "gatsby-plugin-svgr": "^2.0.0-alpha", + "gatsby-plugin-webpack-size": "^0.0.2", "gatsby-redirect-from": "^0.1.1", "gatsby-remark-autolink-headers": "^2.0.6", "gatsby-remark-copy-linked-files": "^2.0.5", @@ -48,9 +53,8 @@ "gatsby-remark-images": "^2.0.3", "gatsby-remark-smartypants": "^2.0.5", "gatsby-source-filesystem": "^2.0.1", - "gatsby-transformer-remark": "^2.1.4", + "gatsby-transformer-remark": "^2.1.5", "gatsby-transformer-sharp": "^2.1.3", - "gatsby-transformer-yaml": "^2.1.1", "graphql": "^0.13.2", "intersection-observer": "^0.5.0", "load-script": "^1.0.0", @@ -77,12 +81,15 @@ "eslint-config-prettier": "^3.1.0", "eslint-loader": "^2.1.1", "eslint-plugin-graphql": "^2.1.1", + "eslint-plugin-jsx-a11y": "^6.1.1", "eslint-plugin-prettier": "^3.0.0", "eslint-plugin-react": "^7.11.1", "markdownlint": "^0.11.0", "markdownlint-cli": "^0.13.0", + "npm-run-all": "^4.1.3", "ora": "^3.0.0", "prettier": "^1.14.3", + "prettier-eslint-cli": "^4.7.1", "prettier-stylelint": "^0.4.2", "stylelint": "^9.6.0", "stylelint-config-css-modules": "^1.3.0", diff --git a/src/components/atoms/PostActions.jsx b/src/components/atoms/PostActions.jsx index c1f10b44..8c3ff3c3 100644 --- a/src/components/atoms/PostActions.jsx +++ b/src/components/atoms/PostActions.jsx @@ -42,9 +42,9 @@ export default class PostActions extends PureComponent {
Say thanks{' '} - + +
diff --git a/src/components/atoms/SEO.jsx b/src/components/atoms/SEO.jsx index a72b53c1..0a353834 100644 --- a/src/components/atoms/SEO.jsx +++ b/src/components/atoms/SEO.jsx @@ -5,19 +5,22 @@ import Helmet from 'react-helmet' const query = graphql` query { - contentYaml { - title - tagline - url - author { - name - twitter - avatar { - childImageSharp { - resize(width: 160) { - src - } - } + site { + siteMetadata { + siteTitle + siteDescription + siteUrl + author { + name + twitter + } + } + } + + logo: allFile(filter: { name: { eq: "apple-touch-icon" } }) { + edges { + node { + relativePath } } } @@ -88,8 +91,8 @@ const MetaTags = ({ siteMeta }) => (
Blog of designer & developer{' '}
diff --git a/src/components/molecules/Vcard.module.scss b/src/components/molecules/Vcard.module.scss
index fe2d0e99..82845646 100644
--- a/src/components/molecules/Vcard.module.scss
+++ b/src/components/molecules/Vcard.module.scss
@@ -5,7 +5,12 @@
@include media-frame;
margin-bottom: ($spacer / 2);
- border-radius: 50%;
+
+ &,
+ img {
+ border-radius: 50%;
+ overflow: hidden;
+ }
}
.description {
diff --git a/src/components/organisms/Footer.jsx b/src/components/organisms/Footer.jsx
index c675df47..1c0b0099 100644
--- a/src/components/organisms/Footer.jsx
+++ b/src/components/organisms/Footer.jsx
@@ -13,12 +13,14 @@ import styles from './Footer.module.scss'
const query = graphql`
query {
- contentYaml {
- author {
- name
- uri
- bitcoin
- github
+ site {
+ siteMetadata {
+ author {
+ name
+ uri
+ bitcoin
+ github
+ }
}
}
}
@@ -44,7 +46,7 @@ export default class Footer extends PureComponent {