Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with Gatsby MDX #155

Open
oravecz opened this issue Aug 30, 2021 · 0 comments
Open

Compatibility with Gatsby MDX #155

oravecz opened this issue Aug 30, 2021 · 0 comments

Comments

@oravecz
Copy link

oravecz commented Aug 30, 2021

I've been unsuccessful so far to integrate this plugin with Gatsby's MDX plugin. Anyone have any advice or working example?

module.exports = {
  siteMetadata: {
    siteUrl: "https://www.yourdomain.tld",
  },
  plugins: [
    {
      resolve: "gatsby-source-filesystem",
      options: {
        name: "pages",
        path: "./src/pages/",
      },
      __key: "pages",
    },
    {
      resolve: "gatsby-plugin-mdx",
      options: {
        extensions: [ `.md`, `.mdx` ],
        gatsbyRemarkPlugins: [
          {
            resolve: 'remark-generic-extensions',
            options: {
              elements: {
                alert: {
                  html: {
                    tagName: "span",
                    children: [
                      {
                        type: "element",
                        tagName: "i",
                        properties: {
                          className: "fa fa-exclamation",
                          ariaHidden: true
                        }
                      },
                      {
                        type: "element",
                        tagName: "span",
                        children: [
                          {
                            type: "text",
                            value: "::content::"
                          }
                        ]
                      },
                      {
                        type: "element",
                        tagName: "span",
                        properties: {
                          className: "subtext"
                        },
                        children: [
                          {
                            type: "text",
                            value: "::argument::"
                          }
                        ]
                      }
                    ]
                  }
                }
              },
              youtube: {
                html: {
                  tagName: "div",
                  children: [
                    {
                      type: "element",
                      tagName: "iframe",
                      properties: {
                        width: 420,
                        height: 315,
                        src: "https://www.youtube.com/embed/::argument::"
                      }
                    },
                    {
                      tagName: "span",
                      properties: {
                        className: "::prop::spanClassName::"
                      },
                      children: [
                        {
                          type: "text",
                          value: "::content::"
                        }
                      ]
                    }
                  ]
                }
              }
            }
          }
        ],
      },
    },
  ],
}

Error I'm getting is

Invalid options provided: <...dump of my options config...>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant