Giter VIP home page Giter VIP logo

Comments (3)

styxlab avatar styxlab commented on June 11, 2024 1

It's possible and absolutely recommended to use shadowing for customizing this theme. Read this article about component shadowing to get started quickly.

The structure of this mono repo is not relevant for for your path layouts (just forget the directory structure of gatsby-theme-try-ghost for a moment). Just think of every package as a standalone program (like you would with any other npm package that you import).

Just have a look at gatsby-starter-try-ghost. The starter uses the base theme gatsby-theme-try-ghost and another theme gatsby-theme-ghost-dark-mode. The dark-mode theme shadows some of the base theme components. First, observe that you need both packages in package.json. Second, you need to configure them in gatsby-config.js.

The base theme gatsby-theme-try-ghost contains a file called DocumentHead.js which is shadowed by the dark-mode theme. The original path is:

gatsby-theme-try-ghost
└── src
    └── components
        └── common
            └── DocumentHead.js

To shadow DocumentHead.js in gatsby-theme-ghost-dark-mode the file must be placed in

gatsby-theme-ghost-dark-mode
└── src
    └── gatsby-theme-try-ghost
        └── components
            └── common
                └──DocumentHead.js

So basically, you need to create directory named exactly as the base theme, put it under src/ and follow the same directory structure as in the base theme. Hope that makes sense to you.

If your customizations could be used by many people, please consider to contribute to this project by sending a PR. I'd be happy to discuss with you if it fits into this project.

from gatsby-theme-try-ghost.

feresberbeche avatar feresberbeche commented on June 11, 2024

I think you mean

gatsby-theme-ghost-dark-mode
└── src
    └── gatsby-theme-try-ghost
        └── components
            └── common
                └──DocumentHead.js

instead of

gatsby-theme-ghost-dark-mode
└── src
    └── gatsby-theme-ghost-dark-mode
        └── components
            └── common
                └──DocumentHead.js

if I understood correctly

from gatsby-theme-try-ghost.

styxlab avatar styxlab commented on June 11, 2024

Thanks for catching this. I corrected it in the original post.

from gatsby-theme-try-ghost.

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.