weixin_39519619 2020-11-21 16:31
浏览 0

Permalinks missing?

Even though it's possible to request tableOfContent in allMdx and it's properly generated, permalinks seem to be missing on all headline elements.

This could be related to my custom MDXProvider with custom components. Anything special I need to write there? Here is my current state


import { MDXProvider } from '-js/react'
import React from 'react'
import { H1, H2, H3, PM} from '/style/mdxStyle'
import styled, { css } from 'styled-components'

export default ({ children }) => (
  <mdxprovider components="{{" map html element tag to react component h1: h1 h2: h2 h3: h3 p: pm li: styled.li> props.theme.typography.paragraph.M}
      `
    }}
  >
    {children}
  </mdxprovider>
)

该提问来源于开源项目:ChristopherBiscardi/gatsby-mdx

  • 写回答

5条回答 默认 最新

  • weixin_39519619 2020-11-21 16:31
    关注

    I check props for the component and there are only children

    FYI, for regular .md in Gatsby, every headline also generates a small anchor inside with the '#link' for permalink support and those links are then later used in table of contents

    评论

报告相同问题?