gatsby-config.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. const fs = require("fs");
  2. const path = require("path");
  3. const addPluginsIfAPIKeySet = !process.env.EXAMPLE_GATSBY_AIRTABLE_API_KEY
  4. ? []
  5. : [
  6. {
  7. resolve: `gatsby-source-airtable`,
  8. options: {
  9. apiKey: process.env.EXAMPLE_GATSBY_AIRTABLE_API_KEY,
  10. tables: [
  11. {
  12. baseId: `appcL6Jdj7ZrhTg4q`,
  13. tableName: `Recipes`,
  14. tableView: `List`,
  15. queryName: `Recipes`,
  16. mapping: {
  17. images: "fileNode",
  18. ingredients: "text/markdown",
  19. directions: "text/markdown"
  20. },
  21. separateMapTypes: true
  22. }
  23. ]
  24. }
  25. },
  26. {
  27. resolve: `gatsby-theme-recipes`,
  28. options: {
  29. sources: ["Airtable"]
  30. }
  31. }
  32. ];
  33. if (!process.env.EXAMPLE_GATSBY_AIRTABLE_API_KEY) {
  34. try {
  35. const template = require.resolve(
  36. "gatsby-theme-recipes/src/templates/recipeTemplate.js"
  37. );
  38. const main = require.resolve("gatsby-theme-recipes/src/main/recipes.js");
  39. fs.renameSync(
  40. template,
  41. template
  42. .split(".")
  43. .reduce((acc, cur) => (cur === "js" ? acc + ".nojs" : acc + cur), "")
  44. );
  45. fs.renameSync(
  46. main,
  47. main
  48. .split(".")
  49. .reduce((acc, cur) => (cur === "js" ? acc + ".nojs" : acc + cur), "")
  50. );
  51. } catch (e) {
  52. // no-op
  53. }
  54. } else {
  55. try {
  56. const template = require.resolve(
  57. "gatsby-theme-recipes/src/templates/recipeTemplate.nojs"
  58. );
  59. const main = require.resolve("gatsby-theme-recipes/src/main/recipes.nojs");
  60. fs.renameSync(
  61. template,
  62. template
  63. .split(".")
  64. .reduce((acc, cur) => (cur === "nojs" ? acc + ".js" : acc + cur), "")
  65. );
  66. fs.renameSync(
  67. main,
  68. main
  69. .split(".")
  70. .reduce((acc, cur) => (cur === "nojs" ? acc + ".js" : acc + cur), "")
  71. );
  72. } catch (e) {
  73. // no-op
  74. }
  75. }
  76. module.exports = {
  77. siteMetadata: {
  78. siteTitle: `Jacob Bolda`,
  79. siteDescription: `Structural Engineer with a knack for creative solutions using code and ingenuity.`,
  80. siteAuthor: `Jacob Bolda`,
  81. siteAuthorIdentity: `Structural Engineer`,
  82. siteLanding: `
  83. Focusing on the intersection of tech and Structural
  84. Engineering. Masters degree in Structural Engineering
  85. from the Milwaukee School of Engineering, undergrad in
  86. Architectural Engineering with a minor in Management,
  87. and a deep understanding of software and programming.
  88. Marrying that experience with problem solving and
  89. systematizing is powerful.
  90. `,
  91. siteContact: "https://twitter.com/jacobbolda",
  92. contactLinks: [
  93. {
  94. url: "mailto:me@jacobbolda.com",
  95. text: "me@jacobbolda.com",
  96. icon: ["far", "envelope"]
  97. },
  98. {
  99. url: "https://twitter.com/jacobbolda",
  100. text: "@jacobbolda",
  101. icon: ["fab", "twitter"]
  102. },
  103. {
  104. url: "https://linkedin.com/in/bolda",
  105. text: "linkedin.com/in/bolda",
  106. icon: ["fab", "linkedin"]
  107. },
  108. {
  109. url: "https://github.com/jbolda",
  110. text: "github.com/jbolda",
  111. icon: ["fab", "github"]
  112. },
  113. {
  114. url: "https://keybase.io/jbolda",
  115. text: "keybase.io/jbolda",
  116. icon: ["fab", "keybase"]
  117. },
  118. {
  119. url: "https://angel.co/jacobbolda",
  120. text: "angel.co/jacobbolda",
  121. icon: ["fab", "angellist"]
  122. },
  123. {
  124. url: "http://www.jbolda.com/photo",
  125. text: "My Photographs",
  126. icon: ["fas", "camera"]
  127. }
  128. ],
  129. navLinks: [{ url: "/recipes/", text: "Our Recipes" }]
  130. },
  131. plugins: [
  132. {
  133. resolve: `gatsby-source-filesystem`,
  134. options: {
  135. name: `articles`,
  136. path: `${__dirname}/src/articles/`
  137. }
  138. },
  139. `gatsby-plugin-theme-ui`,
  140. `gatsby-plugin-sharp`,
  141. `gatsby-transformer-sharp`,
  142. `@jbolda/gatsby-theme-homepage`,
  143. `@jbolda/gatsby-theme-articles`,
  144. ...addPluginsIfAPIKeySet,
  145. {
  146. resolve: `gatsby-plugin-mdx`,
  147. options: {}
  148. },
  149. `gatsby-plugin-react-helmet`,
  150. `gatsby-plugin-netlify`
  151. ]
  152. };