123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- const { version, homepage } = require('./package.json');
- const cdn = process.env.USE_LOCAL_FILE
- ? `http://localhost:${process.env.npm_package_config_ports_webpack}`
- : `https://cdn.jsdelivr.net/npm/quill@${version}/dist`;
- const siteMetadata = {
- version,
- cdn,
- github:
- 'https://github.com/quilljs/quill/tree/develop/packages/website/content',
- highlightjs: '//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0',
- katex: '//cdnjs.cloudflare.com/ajax/libs/KaTeX/0.7.1',
- url: homepage,
- title: 'Quill - Your powerful rich text editor',
- shortTitle: 'Quill Rich Text Editor',
- description:
- '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.',
- shortDescription:
- 'Quill is a free, open source rich text editor built for the modern web.',
- };
- const config = {
- siteMetadata,
- graphqlTypegen: true,
- plugins: [
- 'gatsby-plugin-sass',
- {
- resolve: 'gatsby-plugin-react-svg',
- options: {
- rule: {
- include: /svg/,
- },
- },
- },
- {
- resolve: 'gatsby-source-filesystem',
- options: { name: 'content', path: `${__dirname}/content` },
- },
- {
- resolve: 'gatsby-plugin-mdx',
- options: {
- gatsbyRemarkPlugins: [
- {
- resolve: 'gatsby-remark-find-replace',
- options: {
- replacements: Object.keys(siteMetadata).reduce((acc, key) => {
- acc[`{{site.${key}}}`] = siteMetadata[key];
- return acc;
- }, {}),
- prefix: false,
- },
- },
- ],
- },
- },
- {
- resolve: `gatsby-plugin-feed`,
- options: {
- query: `
- {
- site {
- siteMetadata {
- url
- }
- }
- }
- `,
- feeds: [
- {
- serialize: ({ query: { site, allMdx } }) => {
- return allMdx.nodes.map((node) => {
- return Object.assign({}, node.frontmatter, {
- description: node.excerpt,
- date: node.frontmatter.date,
- url: site.siteMetadata.url + node.fields.permalink,
- guid: site.siteMetadata.url + node.fields.permalink,
- });
- });
- },
- query: `
- {
- allMdx(
- sort: { fields: frontmatter___date, order: DESC }
- filter: { fields: { pageType: { eq: "blog" } } }
- ) {
- nodes {
- frontmatter {
- date(formatString: "DD MMM yyyy")
- title
- }
- fields {
- permalink
- }
- id
- body
- excerpt
- }
- }
- }
- `,
- output: '/feed.xml',
- title: siteMetadata.title,
- match: '^/blog/',
- },
- ],
- },
- },
- {
- resolve: 'gatsby-plugin-google-gtag',
- options: {
- trackingIds: ['G-B37E2WMSPW'],
- },
- },
- ],
- };
- module.exports = config;
|