fix: update gatsby-remark-images options

This commit is contained in:
alxshelepenok 2019-07-16 14:58:11 +03:00
parent a0b28f128c
commit babcddb3a2
2 changed files with 6 additions and 4 deletions

View File

@ -93,6 +93,7 @@ module.exports = {
resolve: 'gatsby-transformer-remark',
options: {
plugins: [
'gatsby-remark-relative-images',
{
resolve: 'gatsby-remark-katex',
options: {
@ -101,7 +102,11 @@ module.exports = {
},
{
resolve: 'gatsby-remark-images',
options: { maxWidth: 960 }
options: {
maxWidth: 960,
withWebp: true,
ignoreFileExtensions: [],
}
},
{
resolve: 'gatsby-remark-responsive-iframe',

View File

@ -2,13 +2,10 @@
const _ = require('lodash');
const { createFilePath } = require('gatsby-source-filesystem');
const { fmImagesToRelative } = require('gatsby-remark-relative-images');
const onCreateNode = ({ node, actions, getNode }) => {
const { createNodeField } = actions;
fmImagesToRelative(node);
if (node.internal.type === 'MarkdownRemark') {
if (typeof node.frontmatter.slug !== 'undefined') {
createNodeField({