tyrion / gridsome-plugin-netlify-cms-paths

Fix markdown image paths to work with Netlify CMS
10 stars 5 forks source link

Remark transformer options ignored. #6

Open tommyip opened 4 years ago

tommyip commented 4 years ago

When this plugin is enabled all the remark options under source-filesystem seem to have no effect. Here is a snippet of my config:

{
  use: '@gridsome/source-filesystem',
  options: {
    path: 'posts/**/*.md',
    typeName: 'Post',
    remark: {
      config: {
        footnotes: true
      }
    }
  },
},

If the remark config is global instead of under source-filesystem then everything is fine.

By the way thanks for making this plugin! :+1:

idueppe commented 4 years ago

I guess I have the same issue with the gridsome-plugin-remark-youtube plugin together with gridsome-plugin-netlify-cms-paths.

If I configure gridsome-plugin-remark-youtube below source-filesystem like this:

 {
      use: '@gridsome/source-filesystem',
      options: {
           typeName: 'Post',
           path: 'content/posts/*.md',
           refs: {
               tags: {
                   typeName: 'Tag',
                   create: true,
                },
          }, remark: { plugins: [ 'gridsome-plugin-remark-youtube'  ]  }
     },
},

It is ignored as soon as gridsome-plugin-netlify-cms-paths is configured.

But if it is defined global it works:

    transformers: {
    //Add markdown support to all file-system sources
        remark: {
            externalLinksTarget: '_blank',
            externalLinksRel: ['nofollow', 'noopener', 'noreferrer',],
            anchorClassName: 'icon icon-link',
            plugins: [
                'gridsome-plugin-remark-youtube',
                '@gridsome/remark-prismjs'
            ],
        },
    },