Giter Site home page Giter Site logo

Comments (8)

ismay avatar ismay commented on August 28, 2024 1

The partials is relative to the where I ran the build from while pattern is relative to the default Metalsmith folder, which is src in my case.

That's intentional. The reason being that you don't want your partials to end up in your dist (since they're only partials and not complete files meant for output). So we let you choose where your partials are in your project folder (which should be outside of src).

pattern is relative to src because it doesn't make sense to use a pattern outside of src, since metalsmith only processes files from src.

I understand how this can be confusing, because your approach works, as you're filtering out the partials with the pattern, but that is by no means the recommended approach. The way this is meant to be used is by putting your partials outside of src.

from in-place.

ismay avatar ismay commented on August 28, 2024 1

@doodzik Maybe we should document this more clearly in the readme. I've now come across several cases where people are putting layouts and partials in src, which in my opinion isn't something we want to support.

from in-place.

ismay avatar ismay commented on August 28, 2024 1

Hmm yeah, we could also add it to the pattern and partials sections, but it might not be noticed there. A faq seems like a good idea 👍

from in-place.

doodzik avatar doodzik commented on August 28, 2024

can you provide additional informations how you set it up?
If you don't want it to be public you can email it to me.
I'm going to look into it and reopen this issue as soon as I get the information :)

from in-place.

gunnx avatar gunnx commented on August 28, 2024

Here is extract of my config:

Metalsmith(__dirname)
.use(inplace({
    engine: 'handlebars',
    partials: 'src/partial',
    pattern: 'page/*.hbs',
    rename: true
  }))

The partials is relative to the where I ran the build from while pattern is relative to the default Metalsmith folder, which is src in my case.

from in-place.

gunnx avatar gunnx commented on August 28, 2024

Thanks for the explanation, I'm used to putting all my source code under src so I include partials in there too, as you noticed I keep my pages separate from my partials.
I'd say just a bit more in the readme will do the job.

from in-place.

doodzik avatar doodzik commented on August 28, 2024

I think it makes sense to separate them, but we definitely want to add that to the readme.

from in-place.

doodzik avatar doodzik commented on August 28, 2024

@ismay should we do it as a point in a faq?
which also means adding a faq.

from in-place.

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.