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 |
Beta Was this translation helpful? Give feedback.
-
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 :) |
Beta Was this translation helpful? Give feedback.
-
@lachlanjc Hey, Lachlan. Could you help me to check it. Please. Sorry to @ you again. |
Beta Was this translation helpful? Give feedback.
-
@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 |
Beta Was this translation helpful? Give feedback.
-
@lachlanjc Thanks to your reply! Yeah, I'm using |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
Sorry, I'm a little confused now. If I don't want to introduce In other words, currently, |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
OK, I see. Then the problem is that I have wrapped static Markdown content into Check here |
Beta Was this translation helpful? Give feedback.
-
And I have set custom |
Beta Was this translation helpful? Give feedback.
-
@lqhuang Try this instead? #867 (comment) |
Beta Was this translation helpful? Give feedback.
-
Thanks for reply. I just tried to replace You could check this commit. |
Beta Was this translation helpful? Give feedback.
-
@lachlanjc Hey, Lachlan. Could you drop in a little time to look this again? Sorry to trouble you. |
Beta Was this translation helpful? Give feedback.
-
To add to this conversation - I also have the same problem Editing the index.js works (e.g. color changing)
|
Beta Was this translation helpful? Give feedback.
-
@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 |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
I'm a developer in science computing, not very familiar with javascript. I'm using
gatsbyjs
andtheme-ui
to build my own Blog pages. Now I met some confused problems in failed to configuregatsby-plugin-theme-ui
with 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.js
and 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.js
look likes followingThat's very perplex.
BaseStyle
has applied in all markdown components andgatsby-plugin-theme-ui
has 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 install
2.npm start
3. checkhttp://localhost:8000/2017-04-04-code-and-syntax-highlighting
and 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 !!!
Beta Was this translation helpful? Give feedback.
All reactions