gatsby-config.js 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. module.exports = {
  2. // https://www.gatsbyjs.org/docs/how-gatsby-works-with-github-pages/
  3. pathPrefix: "/DiscordPHP",
  4. siteMetadata: {
  5. title: `DiscordPHP`,
  6. },
  7. plugins: [
  8. `gatsby-plugin-react-helmet`,
  9. {
  10. resolve: `gatsby-source-filesystem`,
  11. options: {
  12. name: `api`,
  13. path: `${__dirname}/src/pages/api`,
  14. },
  15. },
  16. {
  17. resolve: `gatsby-transformer-remark`,
  18. options: {
  19. plugins: [
  20. {
  21. resolve: `gatsby-remark-prismjs`,
  22. options: {
  23. // Class prefix for <pre> tags containing syntax highlighting;
  24. // defaults to 'language-' (eg <pre class="language-js">).
  25. // If your site loads Prism into the browser at runtime,
  26. // (eg for use with libraries like react-live),
  27. // you may use this to prevent Prism from re-processing syntax.
  28. // This is an uncommon use-case though;
  29. // If you're unsure, it's best to use the default value.
  30. classPrefix: "language-",
  31. // This is used to allow setting a language for inline code
  32. // (i.e. single backticks) by creating a separator.
  33. // This separator is a string and will do no white-space
  34. // stripping.
  35. // A suggested value for English speakers is the non-ascii
  36. // character '›'.
  37. inlineCodeMarker: null,
  38. // This lets you set up language aliases. For example,
  39. // setting this to '{ sh: "bash" }' will let you use
  40. // the language "sh" which will highlight using the
  41. // bash highlighter.
  42. aliases: {},
  43. // This toggles the display of line numbers globally alongside the code.
  44. // To use it, add the following line in src/layouts/index.js
  45. // right after importing the prism color scheme:
  46. // `require("prismjs/plugins/line-numbers/prism-line-numbers.css");`
  47. // Defaults to false.
  48. // If you wish to only show line numbers on certain code blocks,
  49. // leave false and use the {numberLines: true} syntax below
  50. showLineNumbers: false,
  51. // If setting this to true, the parser won't handle and highlight inline
  52. // code used in markdown i.e. single backtick code like `this`.
  53. noInlineHighlight: false,
  54. },
  55. },
  56. ],
  57. },
  58. },
  59. {
  60. resolve: `gatsby-plugin-typography`,
  61. options: {
  62. pathToConfigModule: `src/utils/typography`,
  63. },
  64. },
  65. {
  66. resolve: `@gatsby-contrib/gatsby-plugin-elasticlunr-search`,
  67. options: {
  68. // Fields to index
  69. fields: [`title`, `name`, `scope`, `route`, `method`],
  70. // How to resolve each field`s value for a supported node type
  71. resolvers: {
  72. // For any node of type MarkdownRemark, list how to resolve the fields` values
  73. MarkdownRemark: {
  74. title: (node) => node.frontmatter.title,
  75. name: (node) => node.frontmatter.name,
  76. slug: (node) =>
  77. `#${node.frontmatter.scope ? node.frontmatter.scope + "-" : ""}${
  78. node.fields.idName
  79. }`,
  80. route: (node) => `${node.frontmatter.route}`,
  81. method: (node) => `${node.frontmatter.example}`,
  82. type: (node) => node.frontmatter.type || "API",
  83. version: (node) => node.fields.version,
  84. },
  85. },
  86. },
  87. },
  88. ],
  89. };