mirror of
https://github.com/LukeHagar/unicorn-utterances.git
synced 2025-12-06 04:21:55 +00:00
Initial commit to blog site code. Ensured author data is populated based on ID
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -4,7 +4,7 @@ logs
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
.idea/
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
|
||||
33
authors.js
Normal file
33
authors.js
Normal file
@@ -0,0 +1,33 @@
|
||||
const { lstatSync, readdirSync } = require('fs')
|
||||
const { join, basename } = require('path')
|
||||
|
||||
const isDirectory = source => lstatSync(source).isDirectory()
|
||||
const getDirectories = source =>
|
||||
readdirSync(source).map(name => join(source, name)).filter(isDirectory)
|
||||
|
||||
const authorFolders = getDirectories(join(__dirname, 'content', 'assets', 'authors'))
|
||||
|
||||
/**
|
||||
* @typedef {object} socials
|
||||
* @prop {string} socials.twitter - Their Twitter handle, sans `@`
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} authorInfo
|
||||
* @prop {string} authorInfo.name - Their name they wish to have displayed on the page
|
||||
* @prop {string} authorInfo.blurbet - The short form description of author, shown at the bottom of every page
|
||||
* @prop {string} authorInfo.description - The long form description of author
|
||||
* @prop {socials} authorInfo.socials - Their social media links
|
||||
* @prop {[string, string, string, string, string]} authorInfo.pronouns - their preferred pronouns.
|
||||
* Should match order of data here https://github.com/witch-house/pronoun.is
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @type {{[username: string]: authorInfo}}
|
||||
*/
|
||||
module.exports = authorFolders.reduce((prev, folder) => {
|
||||
const username = basename(folder);
|
||||
prev[username] = require(join(folder, 'info'));
|
||||
return prev;
|
||||
}, {})
|
||||
11
content/assets/authors/crutchcorn/info.js
Normal file
11
content/assets/authors/crutchcorn/info.js
Normal file
@@ -0,0 +1,11 @@
|
||||
const { findPronouns } = require("../../../../utils/pronoun-helper");
|
||||
|
||||
module.exports = {
|
||||
name: 'Corbin Crutchley',
|
||||
blurbet: 'Is a cool dood',
|
||||
description: 'Is a super mega rad human being',
|
||||
socials: {
|
||||
twitter: 'crutchcorn'
|
||||
},
|
||||
pronouns: findPronouns('they')
|
||||
};
|
||||
BIN
content/assets/authors/crutchcorn/profile_pic.png
Normal file
BIN
content/assets/authors/crutchcorn/profile_pic.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 530 KiB |
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: Hello World
|
||||
date: "2015-05-01T22:12:03.284Z"
|
||||
author: 'crutchcorn'
|
||||
license: 'MIT'
|
||||
---
|
||||
|
||||
This is my first post on my new fake blog! How exciting!
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
title: New Beginnings
|
||||
date: "2015-05-28T22:40:32.169Z"
|
||||
description: This is a custom description for SEO and Open Graph purposes, rather than the default generated excerpt. Simply add a description field to the frontmatter.
|
||||
author: 'joe'
|
||||
---
|
||||
|
||||
Far far away, behind the word mountains, far from the countries Vokalia and
|
||||
|
||||
1
content/blog/my-second-post/file.txt
Normal file
1
content/blog/my-second-post/file.txt
Normal file
@@ -0,0 +1 @@
|
||||
Hello there
|
||||
@@ -1,6 +1,8 @@
|
||||
---
|
||||
title: My Second Post!
|
||||
date: "2015-05-06T23:46:37.121Z"
|
||||
author: 'thing'
|
||||
attached: ['./file.txt']
|
||||
---
|
||||
|
||||
Wow! I love blogging so much already.
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
const authors = require('./authors');
|
||||
|
||||
module.exports = {
|
||||
siteMetadata: {
|
||||
title: `Gatsby Starter Blog`,
|
||||
author: `Kyle Mathews`,
|
||||
description: `A starter blog demonstrating what Gatsby can do.`,
|
||||
siteUrl: `https://gatsby-starter-blog-demo.netlify.com/`,
|
||||
social: {
|
||||
twitter: `kylemathews`,
|
||||
},
|
||||
title: `Unicorn Utterances`,
|
||||
description: `Learning programming from magically magestic words`,
|
||||
siteUrl: `https://unicorn-utterances.com/`,
|
||||
authors
|
||||
},
|
||||
plugins: [
|
||||
{
|
||||
@@ -23,6 +22,13 @@ module.exports = {
|
||||
name: `assets`,
|
||||
},
|
||||
},
|
||||
`gatsby-transformer-yaml`,
|
||||
{
|
||||
resolve: `gatsby-source-filesystem`,
|
||||
options: {
|
||||
path: `./src/data`,
|
||||
},
|
||||
},
|
||||
{
|
||||
resolve: `gatsby-transformer-remark`,
|
||||
options: {
|
||||
@@ -75,4 +81,7 @@ module.exports = {
|
||||
},
|
||||
},
|
||||
],
|
||||
mapping: {
|
||||
"MarkdownRemark.frontmatter.author": `AuthorYaml`,
|
||||
},
|
||||
}
|
||||
|
||||
179
package-lock.json
generated
179
package-lock.json
generated
@@ -321,6 +321,15 @@
|
||||
"@babel/plugin-syntax-optional-catch-binding": "^7.2.0"
|
||||
}
|
||||
},
|
||||
"@babel/plugin-proposal-optional-chaining": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.2.0.tgz",
|
||||
"integrity": "sha512-ea3Q6edZC/55wEBVZAEz42v528VulyO0eir+7uky/sT4XRcdkWJcFi1aPtitTlwUzGnECWJNExWww1SStt+yWw==",
|
||||
"requires": {
|
||||
"@babel/helper-plugin-utils": "^7.0.0",
|
||||
"@babel/plugin-syntax-optional-chaining": "^7.2.0"
|
||||
}
|
||||
},
|
||||
"@babel/plugin-proposal-unicode-property-regex": {
|
||||
"version": "7.4.4",
|
||||
"resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.4.4.tgz",
|
||||
@@ -395,6 +404,14 @@
|
||||
"@babel/helper-plugin-utils": "^7.0.0"
|
||||
}
|
||||
},
|
||||
"@babel/plugin-syntax-optional-chaining": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.2.0.tgz",
|
||||
"integrity": "sha512-HtGCtvp5Uq/jH/WNUPkK6b7rufnCPLLlDAFN7cmACoIjaOOiXxUt3SswU5loHqrhtqTsa/WoLQ1OQ1AGuZqaWA==",
|
||||
"requires": {
|
||||
"@babel/helper-plugin-utils": "^7.0.0"
|
||||
}
|
||||
},
|
||||
"@babel/plugin-transform-arrow-functions": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz",
|
||||
@@ -808,6 +825,15 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"@babel/preset-flow": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/preset-flow/-/preset-flow-7.0.0.tgz",
|
||||
"integrity": "sha512-bJOHrYOPqJZCkPVbG1Lot2r5OSsB+iUOaxiHdlOeB1yPWS6evswVHwvkDLZ54WTaTRIk89ds0iHmGZSnxlPejQ==",
|
||||
"requires": {
|
||||
"@babel/helper-plugin-utils": "^7.0.0",
|
||||
"@babel/plugin-transform-flow-strip-types": "^7.0.0"
|
||||
}
|
||||
},
|
||||
"@babel/preset-react": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.0.0.tgz",
|
||||
@@ -1820,6 +1846,20 @@
|
||||
"babel-plugin-macros": "^2.4.2"
|
||||
}
|
||||
},
|
||||
"babel-preset-gatsby-package": {
|
||||
"version": "0.1.4",
|
||||
"resolved": "https://registry.npmjs.org/babel-preset-gatsby-package/-/babel-preset-gatsby-package-0.1.4.tgz",
|
||||
"integrity": "sha512-OL7xqAQ9yCfnCcRWqwB4XUuFVGBcVJLFs/iCGupmsLqtyz+vtpFVMwCTfg/025zShPkZTTYI+S0ZJSv3eYrikA==",
|
||||
"requires": {
|
||||
"@babel/plugin-proposal-class-properties": "^7.0.0",
|
||||
"@babel/plugin-proposal-optional-chaining": "^7.0.0",
|
||||
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
|
||||
"@babel/plugin-transform-runtime": "^7.0.0",
|
||||
"@babel/preset-env": "^7.0.0",
|
||||
"@babel/preset-flow": "^7.0.0",
|
||||
"@babel/preset-react": "^7.0.0"
|
||||
}
|
||||
},
|
||||
"babel-runtime": {
|
||||
"version": "6.26.0",
|
||||
"resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
|
||||
@@ -3470,6 +3510,29 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"cross-env": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/cross-env/-/cross-env-5.2.0.tgz",
|
||||
"integrity": "sha512-jtdNFfFW1hB7sMhr/H6rW1Z45LFqyI431m3qU6bFXcQ3Eh7LtBuG3h74o7ohHZ3crrRkkqHlo4jYHFPcjroANg==",
|
||||
"requires": {
|
||||
"cross-spawn": "^6.0.5",
|
||||
"is-windows": "^1.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"cross-spawn": {
|
||||
"version": "6.0.5",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
|
||||
"integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
|
||||
"requires": {
|
||||
"nice-try": "^1.0.4",
|
||||
"path-key": "^2.0.1",
|
||||
"semver": "^5.5.0",
|
||||
"shebang-command": "^1.2.0",
|
||||
"which": "^1.2.9"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"cross-fetch": {
|
||||
"version": "2.2.2",
|
||||
"resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-2.2.2.tgz",
|
||||
@@ -5712,8 +5775,7 @@
|
||||
},
|
||||
"ansi-regex": {
|
||||
"version": "2.1.1",
|
||||
"bundled": true,
|
||||
"optional": true
|
||||
"bundled": true
|
||||
},
|
||||
"aproba": {
|
||||
"version": "1.2.0",
|
||||
@@ -5731,13 +5793,11 @@
|
||||
},
|
||||
"balanced-match": {
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"optional": true
|
||||
"bundled": true
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"bundled": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
@@ -5750,18 +5810,15 @@
|
||||
},
|
||||
"code-point-at": {
|
||||
"version": "1.1.0",
|
||||
"bundled": true,
|
||||
"optional": true
|
||||
"bundled": true
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"bundled": true,
|
||||
"optional": true
|
||||
"bundled": true
|
||||
},
|
||||
"console-control-strings": {
|
||||
"version": "1.1.0",
|
||||
"bundled": true,
|
||||
"optional": true
|
||||
"bundled": true
|
||||
},
|
||||
"core-util-is": {
|
||||
"version": "1.0.2",
|
||||
@@ -5864,8 +5921,7 @@
|
||||
},
|
||||
"inherits": {
|
||||
"version": "2.0.3",
|
||||
"bundled": true,
|
||||
"optional": true
|
||||
"bundled": true
|
||||
},
|
||||
"ini": {
|
||||
"version": "1.3.5",
|
||||
@@ -5875,7 +5931,6 @@
|
||||
"is-fullwidth-code-point": {
|
||||
"version": "1.0.0",
|
||||
"bundled": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"number-is-nan": "^1.0.0"
|
||||
}
|
||||
@@ -5888,20 +5943,17 @@
|
||||
"minimatch": {
|
||||
"version": "3.0.4",
|
||||
"bundled": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
},
|
||||
"minimist": {
|
||||
"version": "0.0.8",
|
||||
"bundled": true,
|
||||
"optional": true
|
||||
"bundled": true
|
||||
},
|
||||
"minipass": {
|
||||
"version": "2.3.5",
|
||||
"bundled": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"safe-buffer": "^5.1.2",
|
||||
"yallist": "^3.0.0"
|
||||
@@ -5918,7 +5970,6 @@
|
||||
"mkdirp": {
|
||||
"version": "0.5.1",
|
||||
"bundled": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"minimist": "0.0.8"
|
||||
}
|
||||
@@ -5991,8 +6042,7 @@
|
||||
},
|
||||
"number-is-nan": {
|
||||
"version": "1.0.1",
|
||||
"bundled": true,
|
||||
"optional": true
|
||||
"bundled": true
|
||||
},
|
||||
"object-assign": {
|
||||
"version": "4.1.1",
|
||||
@@ -6002,7 +6052,6 @@
|
||||
"once": {
|
||||
"version": "1.4.0",
|
||||
"bundled": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"wrappy": "1"
|
||||
}
|
||||
@@ -6078,8 +6127,7 @@
|
||||
},
|
||||
"safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"bundled": true,
|
||||
"optional": true
|
||||
"bundled": true
|
||||
},
|
||||
"safer-buffer": {
|
||||
"version": "2.1.2",
|
||||
@@ -6109,7 +6157,6 @@
|
||||
"string-width": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"code-point-at": "^1.0.0",
|
||||
"is-fullwidth-code-point": "^1.0.0",
|
||||
@@ -6127,7 +6174,6 @@
|
||||
"strip-ansi": {
|
||||
"version": "3.0.1",
|
||||
"bundled": true,
|
||||
"optional": true,
|
||||
"requires": {
|
||||
"ansi-regex": "^2.0.0"
|
||||
}
|
||||
@@ -6166,13 +6212,11 @@
|
||||
},
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"bundled": true,
|
||||
"optional": true
|
||||
"bundled": true
|
||||
},
|
||||
"yallist": {
|
||||
"version": "3.0.3",
|
||||
"bundled": true,
|
||||
"optional": true
|
||||
"bundled": true
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -6761,6 +6805,20 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"gatsby-plugin-transition-link": {
|
||||
"version": "1.12.4",
|
||||
"resolved": "https://registry.npmjs.org/gatsby-plugin-transition-link/-/gatsby-plugin-transition-link-1.12.4.tgz",
|
||||
"integrity": "sha512-+1j/knyO/7soWAokoWvNuta8EzEmBVgsPMQh+8QxHVmwMfhzh+o6AnvPITWgcjFShbb6sC91JO/LQze3T52jeQ==",
|
||||
"requires": {
|
||||
"babel-preset-gatsby-package": "^0.1.2",
|
||||
"color-convert": "^1.9.3",
|
||||
"cross-env": "^5.2.0",
|
||||
"json-bump": "^0.1.3",
|
||||
"polyfill-array-includes": "^1.0.0",
|
||||
"react-transition-group": "^2.5.0",
|
||||
"requestanimationframe-timer": "^1.0.4"
|
||||
}
|
||||
},
|
||||
"gatsby-plugin-typography": {
|
||||
"version": "2.2.13",
|
||||
"resolved": "https://registry.npmjs.org/gatsby-plugin-typography/-/gatsby-plugin-typography-2.2.13.tgz",
|
||||
@@ -7060,6 +7118,17 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"gatsby-transformer-yaml": {
|
||||
"version": "2.1.12",
|
||||
"resolved": "https://registry.npmjs.org/gatsby-transformer-yaml/-/gatsby-transformer-yaml-2.1.12.tgz",
|
||||
"integrity": "sha512-KkRKb3ysNwYwBRE0kUA17gLHA5bg6NOmjf8OeSeHhNkJJrn8DQkRhqd8aGCXgfg5m7AeN7XU/5MGtF4uDXVM0A==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.0.0",
|
||||
"js-yaml": "^3.13.0",
|
||||
"lodash": "^4.17.10",
|
||||
"unist-util-select": "^1.5.0"
|
||||
}
|
||||
},
|
||||
"gauge": {
|
||||
"version": "2.7.4",
|
||||
"resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz",
|
||||
@@ -8888,6 +8957,24 @@
|
||||
"resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz",
|
||||
"integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg="
|
||||
},
|
||||
"json-bump": {
|
||||
"version": "0.1.3",
|
||||
"resolved": "https://registry.npmjs.org/json-bump/-/json-bump-0.1.3.tgz",
|
||||
"integrity": "sha512-M8dmYwjHGHg+uvBQRj959sVKtd57pl5F0brla3e8h934pXIBknSpWh49j/AjmoCTcumQhT7Q6iKKuhHdUxD3fQ==",
|
||||
"requires": {
|
||||
"jsonfile": "^3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"jsonfile": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-3.0.1.tgz",
|
||||
"integrity": "sha1-pezG9l9T9mLEQVx2daAzHQmS7GY=",
|
||||
"requires": {
|
||||
"graceful-fs": "^4.1.6"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"json-loader": {
|
||||
"version": "0.5.7",
|
||||
"resolved": "https://registry.npmjs.org/json-loader/-/json-loader-0.5.7.tgz",
|
||||
@@ -10948,6 +11035,11 @@
|
||||
"ts-pnp": "^1.1.2"
|
||||
}
|
||||
},
|
||||
"polyfill-array-includes": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/polyfill-array-includes/-/polyfill-array-includes-1.0.0.tgz",
|
||||
"integrity": "sha1-PdoHBHWFnpnWU6zwbsNiLMdvhDA="
|
||||
},
|
||||
"portfinder": {
|
||||
"version": "1.0.20",
|
||||
"resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.20.tgz",
|
||||
@@ -11851,6 +11943,14 @@
|
||||
"resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.1.1.tgz",
|
||||
"integrity": "sha512-w7fLxIRCRT7U8Qu53jQnJyPkYZIaR4n5151KMfcJlO/A9397Wxb1amJvROTK6TOnp7PfoAmg/qXiNHI+08jRfA=="
|
||||
},
|
||||
"raf": {
|
||||
"version": "3.4.1",
|
||||
"resolved": "https://registry.npmjs.org/raf/-/raf-3.4.1.tgz",
|
||||
"integrity": "sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==",
|
||||
"requires": {
|
||||
"performance-now": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"randombytes": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
|
||||
@@ -12168,6 +12268,17 @@
|
||||
"shallowequal": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"react-transition-group": {
|
||||
"version": "2.9.0",
|
||||
"resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-2.9.0.tgz",
|
||||
"integrity": "sha512-+HzNTCHpeQyl4MJ/bdE0u6XRMe9+XG/+aL4mCxVN4DnPBQ0/5bfHWPDuOZUzYdMj94daZaZdCCc1Dzt9R/xSSg==",
|
||||
"requires": {
|
||||
"dom-helpers": "^3.4.0",
|
||||
"loose-envify": "^1.4.0",
|
||||
"prop-types": "^15.6.2",
|
||||
"react-lifecycles-compat": "^3.0.4"
|
||||
}
|
||||
},
|
||||
"react-typography": {
|
||||
"version": "0.16.19",
|
||||
"resolved": "https://registry.npmjs.org/react-typography/-/react-typography-0.16.19.tgz",
|
||||
@@ -12509,6 +12620,14 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"requestanimationframe-timer": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/requestanimationframe-timer/-/requestanimationframe-timer-1.0.4.tgz",
|
||||
"integrity": "sha512-5ehtMkIS7RLI/UxjgAEZg6zGLoRdSSzfwjwowpBRImAr8Rbs2pdcS/4tmJ7CAtvYjtO/H+ui96AMkyefzUqUlQ==",
|
||||
"requires": {
|
||||
"raf": "^3.4.0"
|
||||
}
|
||||
},
|
||||
"require-directory": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
"gatsby-plugin-offline": "^2.1.1",
|
||||
"gatsby-plugin-react-helmet": "^3.0.12",
|
||||
"gatsby-plugin-sharp": "^2.1.3",
|
||||
"gatsby-plugin-transition-link": "^1.12.4",
|
||||
"gatsby-plugin-typography": "^2.2.13",
|
||||
"gatsby-remark-copy-linked-files": "^2.0.13",
|
||||
"gatsby-remark-images": "^3.0.14",
|
||||
@@ -25,6 +26,7 @@
|
||||
"gatsby-source-filesystem": "^2.0.38",
|
||||
"gatsby-transformer-remark": "^2.3.12",
|
||||
"gatsby-transformer-sharp": "^2.1.21",
|
||||
"gatsby-transformer-yaml": "^2.1.12",
|
||||
"prismjs": "^1.16.0",
|
||||
"react": "^16.8.6",
|
||||
"react-dom": "^16.8.6",
|
||||
|
||||
@@ -6,70 +6,42 @@
|
||||
*/
|
||||
|
||||
import React from "react"
|
||||
import { StaticQuery, graphql } from "gatsby"
|
||||
import Image from "gatsby-image"
|
||||
|
||||
import { rhythm } from "../utils/typography"
|
||||
|
||||
function Bio() {
|
||||
function Bio({author}) {
|
||||
if (!(author && author.profileImg && author.profileImg.childImageSharp && author.profileImg.childImageSharp.fixed)) {return null;}
|
||||
return (
|
||||
<StaticQuery
|
||||
query={bioQuery}
|
||||
render={data => {
|
||||
const { author, social } = data.site.siteMetadata
|
||||
return (
|
||||
<div
|
||||
style={{
|
||||
display: `flex`,
|
||||
marginBottom: rhythm(2.5),
|
||||
}}
|
||||
>
|
||||
<Image
|
||||
fixed={data.avatar.childImageSharp.fixed}
|
||||
alt={author}
|
||||
style={{
|
||||
marginRight: rhythm(1 / 2),
|
||||
marginBottom: 0,
|
||||
minWidth: 50,
|
||||
borderRadius: `100%`,
|
||||
}}
|
||||
imgStyle={{
|
||||
borderRadius: `50%`,
|
||||
}}
|
||||
/>
|
||||
<p>
|
||||
Written by <strong>{author}</strong> who lives and works in San
|
||||
Francisco building useful things.
|
||||
{` `}
|
||||
<a href={`https://twitter.com/${social.twitter}`}>
|
||||
You should follow him on Twitter
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
)
|
||||
<div
|
||||
style={{
|
||||
display: `flex`,
|
||||
marginBottom: rhythm(2.5),
|
||||
}}
|
||||
/>
|
||||
>
|
||||
<Image
|
||||
fixed={author.profileImg.childImageSharp.fixed}
|
||||
alt={author.name}
|
||||
style={{
|
||||
marginRight: rhythm(1 / 2),
|
||||
marginBottom: 0,
|
||||
minWidth: 50,
|
||||
borderRadius: `100%`,
|
||||
}}
|
||||
imgStyle={{
|
||||
borderRadius: `50%`,
|
||||
}}
|
||||
/>
|
||||
<p>
|
||||
Written by <strong>{author.name}</strong>.
|
||||
{author.blurbet}
|
||||
{` `}
|
||||
<a href={`https://twitter.com/${author.socials.twitter}`}>
|
||||
You should follow {author.pronouns[1]} on Twitter
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
const bioQuery = graphql`
|
||||
query BioQuery {
|
||||
avatar: file(absolutePath: { regex: "/profile-pic.jpg/" }) {
|
||||
childImageSharp {
|
||||
fixed(width: 50, height: 50) {
|
||||
...GatsbyImageSharpFixed
|
||||
}
|
||||
}
|
||||
}
|
||||
site {
|
||||
siteMetadata {
|
||||
author
|
||||
social {
|
||||
twitter
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export default Bio
|
||||
|
||||
@@ -18,7 +18,6 @@ function SEO({ description, lang, meta, title }) {
|
||||
siteMetadata {
|
||||
title
|
||||
description
|
||||
author
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -57,7 +56,7 @@ function SEO({ description, lang, meta, title }) {
|
||||
},
|
||||
{
|
||||
name: `twitter:creator`,
|
||||
content: site.siteMetadata.author,
|
||||
content: 'crutchcorn',
|
||||
},
|
||||
{
|
||||
name: `twitter:title`,
|
||||
|
||||
24
src/data/author.yaml
Normal file
24
src/data/author.yaml
Normal file
@@ -0,0 +1,24 @@
|
||||
- id: crutchcorn
|
||||
name: 'Corbin Crutchley'
|
||||
blurbet: 'Is a cool dood'
|
||||
description: 'Is a super mega rad human being'
|
||||
socials:
|
||||
twitter: 'crutchcorn'
|
||||
pronouns: ['they', 'them', 'their', 'themselves']
|
||||
profileImg: './crutchcorn.png'
|
||||
- id: joe
|
||||
name: 'Joe Casenova'
|
||||
blurbet: 'Is a cool dood'
|
||||
description: 'Is a super mega rad human being'
|
||||
socials:
|
||||
twitter: 'crutchcorn'
|
||||
pronouns: ['they', 'them', 'their', 'themselves']
|
||||
profileImg: './crutchcorn.png'
|
||||
- id: thing
|
||||
name: 'Thing 1'
|
||||
blurbet: 'Is a cool dood'
|
||||
description: 'Is a super mega rad human being'
|
||||
socials:
|
||||
twitter: 'crutchcorn'
|
||||
pronouns: ['they', 'them', 'their', 'themselves']
|
||||
profileImg: './crutchcorn.png'
|
||||
BIN
src/data/crutchcorn.png
Normal file
BIN
src/data/crutchcorn.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 530 KiB |
@@ -15,7 +15,6 @@ class BlogIndex extends React.Component {
|
||||
return (
|
||||
<Layout location={this.props.location} title={siteTitle}>
|
||||
<SEO title="All posts" />
|
||||
<Bio />
|
||||
{posts.map(({ node }) => {
|
||||
const title = node.frontmatter.title || node.fields.slug
|
||||
return (
|
||||
@@ -25,6 +24,7 @@ class BlogIndex extends React.Component {
|
||||
marginBottom: rhythm(1 / 4),
|
||||
}}
|
||||
>
|
||||
<Bio author={node.frontmatter.author} />
|
||||
<Link style={{ boxShadow: `none` }} to={node.fields.slug}>
|
||||
{title}
|
||||
</Link>
|
||||
@@ -63,6 +63,22 @@ export const pageQuery = graphql`
|
||||
date(formatString: "MMMM DD, YYYY")
|
||||
title
|
||||
description
|
||||
author {
|
||||
name
|
||||
blurbet
|
||||
description
|
||||
socials {
|
||||
twitter
|
||||
}
|
||||
pronouns
|
||||
profileImg {
|
||||
childImageSharp {
|
||||
fixed(width: 50, height: 50) {
|
||||
...GatsbyImageSharpFixed
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ class BlogPostTemplate extends React.Component {
|
||||
marginBottom: rhythm(1),
|
||||
}}
|
||||
/>
|
||||
<Bio />
|
||||
<Bio author={post.frontmatter.author}/>
|
||||
|
||||
<ul
|
||||
style={{
|
||||
@@ -73,7 +73,6 @@ export const pageQuery = graphql`
|
||||
site {
|
||||
siteMetadata {
|
||||
title
|
||||
author
|
||||
}
|
||||
}
|
||||
markdownRemark(fields: { slug: { eq: $slug } }) {
|
||||
@@ -84,6 +83,23 @@ export const pageQuery = graphql`
|
||||
title
|
||||
date(formatString: "MMMM DD, YYYY")
|
||||
description
|
||||
license
|
||||
author {
|
||||
name
|
||||
blurbet
|
||||
description
|
||||
socials {
|
||||
twitter
|
||||
}
|
||||
pronouns
|
||||
profileImg {
|
||||
childImageSharp {
|
||||
fixed(width: 50, height: 50) {
|
||||
...GatsbyImageSharpFixed
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
42
utils/pronoun-helper.js
Normal file
42
utils/pronoun-helper.js
Normal file
@@ -0,0 +1,42 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const pronounIsFile = fs.readFileSync(path.join(__dirname, 'pronouns.tab'), 'utf8');
|
||||
|
||||
const pronoun2DArr = pronounIsFile
|
||||
.split('\n')
|
||||
.map(pronounRow => pronounRow.split('\t'));
|
||||
|
||||
/**
|
||||
* @param matchStr - The string to match to
|
||||
* @returns {[string, string, string, string, string]} authorInfo.pronouns - their preferred pronouns.
|
||||
* Should match order of data here https://github.com/witch-house/pronoun.is
|
||||
*/
|
||||
const findPronouns = (matchStr) => {
|
||||
return pronoun2DArr.find(pronounList => pronounList.includes(matchStr));
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {object} socials
|
||||
* @prop {string} socials.twitter - Their Twitter handle, sans `@`
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} authorInfo
|
||||
* @prop {string} authorInfo.username - The unique key to that user
|
||||
* @prop {string} authorInfo.name - Their name they wish to have displayed on the page
|
||||
* @prop {string} authorInfo.blurbet - The short form description of author, shown at the bottom of every page
|
||||
* @prop {string} authorInfo.description - The long form description of author
|
||||
* @prop {socials} authorInfo.socials - Their social media links
|
||||
* @prop {[string, string, string, string, string]} authorInfo.pronouns - their preferred pronouns.
|
||||
* Should match order of data here https://github.com/witch-house/pronoun.is
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @type {authorInfo}
|
||||
*/
|
||||
module.exports = {
|
||||
pronoun2DArr,
|
||||
findPronouns
|
||||
}
|
||||
40
utils/pronouns.tab
Normal file
40
utils/pronouns.tab
Normal file
@@ -0,0 +1,40 @@
|
||||
she her her hers herself
|
||||
he him his his himself
|
||||
they them their theirs themselves
|
||||
ze hir hir hirs hirself
|
||||
ze zir zir zirs zirself
|
||||
xey xem xyr xyrs xemself
|
||||
ae aer aer aers aerself
|
||||
e em eir eirs emself
|
||||
ey em eir eirs eirself
|
||||
fae faer faer faers faerself
|
||||
fey fem feir feirs feirself
|
||||
hu hum hus hus humself
|
||||
it it its its itself
|
||||
jee jem jeir jeirs jemself
|
||||
kit kit kits kits kitself
|
||||
ne nem nir nirs nemself
|
||||
peh pehm peh's peh's pehself
|
||||
per per per pers perself
|
||||
sie hir hir hirs hirself
|
||||
se sim ser sers serself
|
||||
shi hir hir hirs hirself
|
||||
si hyr hyr hyrs hyrself
|
||||
they them their theirs themself
|
||||
thon thon thons thons thonself
|
||||
ve ver vis vis verself
|
||||
ve vem vir virs vemself
|
||||
vi ver ver vers verself
|
||||
vi vim vir virs vimself
|
||||
vi vim vim vims vimself
|
||||
xie xer xer xers xerself
|
||||
xe xem xyr xyrs xemself
|
||||
xey xem xeir xeirs xemself
|
||||
yo yo yos yos yosself
|
||||
ze zem zes zes zirself
|
||||
ze mer zer zers zemself
|
||||
zee zed zeta zetas zedself
|
||||
zie zir zir zirs zirself
|
||||
zie zem zes zes zirself
|
||||
zie hir hir hirs hirself
|
||||
zme zmyr zmyr zmyrs zmyrself
|
||||
Reference in New Issue
Block a user