gatsby-config.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. const { version, homepage } = require("./package.json");
  2. const cdn = process.env.USE_LOCAL_FILE
  3. ? `http://localhost:${process.env.npm_package_config_ports_webpack}`
  4. : `https://cdn.jsdelivr.net/npm/quill@${version}/dist`;
  5. const siteMetadata = {
  6. version,
  7. cdn,
  8. github:
  9. "https://github.com/quilljs/quill/tree/develop/packages/website/content",
  10. highlightjs: "//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0",
  11. katex: "//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1",
  12. url: homepage,
  13. title: "Quill - Your powerful rich text editor",
  14. shortTitle: "Quill Rich Text Editor",
  15. description:
  16. "Quill is a free, open source WYSIWYG editor built for the modern web. Completely customize it for any need with its modular architecture and expressive API.",
  17. shortDescription:
  18. "Quill is a free, open source rich text editor built for the modern web.",
  19. };
  20. const config = {
  21. siteMetadata,
  22. graphqlTypegen: true,
  23. plugins: [
  24. {
  25. resolve: "gatsby-plugin-google-analytics",
  26. options: {
  27. trackingId: "UA-19077541-2",
  28. head: true,
  29. },
  30. },
  31. "gatsby-plugin-sass",
  32. {
  33. resolve: "gatsby-plugin-react-svg",
  34. options: {
  35. rule: {
  36. include: /svg/,
  37. },
  38. },
  39. },
  40. {
  41. resolve: "gatsby-source-filesystem",
  42. options: { name: "content", path: `${__dirname}/content` },
  43. },
  44. {
  45. resolve: "gatsby-plugin-mdx",
  46. options: {
  47. gatsbyRemarkPlugins: [
  48. {
  49. resolve: "gatsby-remark-find-replace",
  50. options: {
  51. replacements: Object.keys(siteMetadata).reduce((acc, key) => {
  52. acc[`{{site.${key}}}`] = siteMetadata[key];
  53. return acc;
  54. }, {}),
  55. prefix: false,
  56. },
  57. },
  58. ],
  59. },
  60. },
  61. ],
  62. };
  63. module.exports = config;