Replies: 15 comments
|
Hey! I checked out the code, & it looks like you’re missing the remark-slug package in your config, as described here: https://theme-ui.com/guides/linked-headings |
|
Hey @lachlanjc, thanks. Yeah, I just miss this tutorial. That's my fault. But I still cannot reproduce correct results by adding config: And how about other custom components except heading like Here, I attached my improved code base FYI. Please check it. Thank you again :) |
|
@lachlanjc Hey, Lachlan. Could you help me to check it. Please. Sorry to @ you again. |
|
@lqhuang I can’t see your content, but are you using .md or .mdx files for your Markdown content? If you’re using .md, your configuration of |
|
@lachlanjc Thanks to your reply! Yeah, I'm using |
|
Got it. Go ahead & set up https://www.gatsbyjs.org/packages/gatsby-remark-slug/ then. What’s in your components.js & your config on the MDX plug-in aren’t applying to anything since you don’t have MDX content. |
|
Sorry, I'm a little confused now. If I don't want to introduce In other words, currently, |
|
That is correct. You’ll want to ignore everything in the Theme UI docs about styling Markdown, as it’s designed for MDX, & probably wrap your static Markdown content in |
|
OK, I see. Then the problem is that I have wrapped static Markdown content into Check here |
|
And I have set custom |
|
Thanks for reply. I just tried to replace You could check this commit. |
|
@lachlanjc Hey, Lachlan. Could you drop in a little time to look this again? Sorry to trouble you. |
|
To add to this conversation - I also have the same problem Editing the index.js works (e.g. color changing) |
|
@dowi Thanks for help! My case is very similar with yours. I have checked my codes. Found that I have imported /** @jsx jsx */
import { jsx, Styled } from 'theme-ui'check here. It should be the same. I also tried replace it with |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
I'm a developer in science computing, not very familiar with javascript. I'm using
gatsbyjsandtheme-uito build my own Blog pages. Now I met some confused problems in failed to configuregatsby-plugin-theme-uiwith custom components.Hence, sorry to disturb community for asking a favor.
Generally, I hope to use custom components to add hashtag(#) and link when hover in title. I have read all documents even in both gatsbyjs and theme-ui index page to layout file structure and configuration.
I create a directory named
gatsby-plugin-theme-ui, the structure of folder look likes following:Then export theme object in
index.jsand custom components incomponents.jsx(I have tried both .js and .jsx). Theme styles of components work well but custom components didn't perform normally as I expected. Codes incomponents.jslook likes followingThat's very perplex.
BaseStylehas applied in all markdown components andgatsby-plugin-theme-uihas been enabled ingatsby-config.js.To Reproduce
I have post my repo into attachment. You're able to check it. If who's interesting in it. Could you please help to figure out why custom components doesn't work well?
How to run: 1.
npm install2.npm start3. checkhttp://localhost:8000/2017-04-04-code-and-syntax-highlightingand compare with filesrc/gatsby-plugin-theme-ui/components.js.Expected behavior
A hashtag (#) before title when hover
Additional context
See attached files for your information
blog-demo.zip
Thanks very much !!!
All reactions