Comments (8)
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.
@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.
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.
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.
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.
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.
I think it makes sense to separate them, but we definitely want to add that to the readme.
from in-place.
@ismay should we do it as a point in a faq?
which also means adding a faq.
from in-place.
Related Issues (20)
- Match files directly with multimatch
- Add missing git version tags
- Enable greenkeeper and greenkeeper-lockfile
- Update remote references to npm package and github repo
- See if babel can be removed
- Dependency/Ordering mayhem HOT 8
- Make errors more descriptive
- Add debug logging
- Update readme and package info
- Improve documentation HOT 28
- Enable greenkeeper HOT 1
- Bug with pug filename HOT 3
- Add support for async jstransformers
- Transforming NJK and MD with filename of index.md.njk markdown not processing HOT 7
- Passing Options to marked HOT 1
- error message missing current file name
- Infinite loop when a jstransformer for html is available HOT 3
- update to latest [email protected] due to security issue with pug@<3.0.1
- Change wiki link in readme HOT 1
- Common use case enhancements HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from in-place.