GithubHelp home page GithubHelp logo

Comments (6)

fabe avatar fabe commented on July 27, 2024 1

@dderooy global.css.js is basically just a CSS reset. Feel free to just edit the file, for example add this to the end of the stylesheet:

ul {
  list-style: square;
}

That stylesheet is definitely meant to be overwritten by you 🙂

If you don't want to touch that file, you can also add some rules for that in component stylesheets, for example box.css.js:

export const Container = styled.div`
  padding: 2rem 4rem;
  max-width: 700px;

  ul {
    list-style: square;
  }
`;

Then only the lists inside <Box/> components are being styled!


@gswirrl You can use the HTML by querying for it in the page query and referencing it in the template. I'm not actually using converted markdown on the homepage. For example:

src/pages/about.js
<div
  dangerouslySetInnerHTML={{
    __html: data.aboutJson.content.childMarkdownRemark.html, // <- HTML
  }}
/>

This uses markdown converted to HTML.

src/pages/index.js
<Title as="h2" size="large">
  {data.homeJson.content.childMarkdownRemark.rawMarkdownBody} // <- Raw Markdown, not converted to HTML
</Title>

This is just using raw markdown. You can get the HTML by getting the .html value instead of the .rawMarkdownBody value.

from gatsby-universal.

gjhltn avatar gjhltn commented on July 27, 2024

Im having a similar issue, but (in my case) the markdown isn't being overridden, it's not being transformed.

Steps to reproduce:

  1. gatsby new my-site https://github.com/fabe/gatsby-universal
  2. in (eg) ~/content/home/intro.md add
# Broken :-(

[link](https://www.google.com)
  1. Expected:
<h1>Broken :-(</h1>
<a href="https://www.google.com">link</a>

screenshot 2018-12-19 at 17 08 52

EDIT: poorly chosen example because this is actually inside an h2 tag, but the same problem, occurs everywhere

UPDATE: My mistake - this is expected! Sorry. To get rendered markdown. change the template to

{data.homeJson.content.childMarkdownRemark.html}

from gatsby-universal.

gjhltn avatar gjhltn commented on July 27, 2024

@fabe thanks so much for the full reply - id just figured it out and was editing my comment! :-) d'oh!

once again, thank you - love the starter!

from gatsby-universal.

dderooy avatar dderooy commented on July 27, 2024

@fabe Thank you for the help. I have it displaying properly now 😄 👍

from gatsby-universal.

fabe avatar fabe commented on July 27, 2024

@gswirrl @dderooy Thanks, let me know if anything else comes up! 🙂

from gatsby-universal.

dannycahyo avatar dannycahyo commented on July 27, 2024

I have the same issues. I've already used HTML to display my markdown file. For example like this :
<div dangerouslySetInnerHTML={{ __html: html }} />
I still can't display the markdown file properly, here is the case. I want to display ## Heading 2, but it just shows Heading 2, which is just plain text.
Besides, I also use Chakra UI.

Can anyone give me the solution, please?

from gatsby-universal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.