Comments (9)
What do you think about doing the same as gulp-nunjucks and making the default name the relative path (eg. templates/articles/show) and adding an option for specifying a name using a callback function?
See: https://github.com/sindresorhus/gulp-nunjucks#nunjucksoptions
from gulp-dust.
Sounds good for me :)
from gulp-dust.
Are you planning to integrate this anytime soon? :)
It would be really helpful for my current projects.
from gulp-dust.
@b00gizm done.
Can you try out master and let me know if it works for your use-case?
npm install git://github.com/sindresorhus/gulp-dust
from gulp-dust.
This is weird: When I define a custom callback function for the name (in my case, I want to omit the file extension, i.e. path/to/foo
), it'll just be applied on the very first file that comes through. All following files are ignored and registered with your default schema (path/to/bar.dust
).
from gulp-dust.
@b00gizm can you share your callback function?
from gulp-dust.
I already found it.
name = typeof name === 'function' && name(file) || file.relative;
This works for the first file that comes through, but for all following ones, name
will always be a string, so typeof name === 'function'
will fail and we're returning the fallback.
Just use something other than name
for the assignment ;)
Sorry, I wanted to send you a pull request, but writing a test for this is a real pain.
from gulp-dust.
@b00gizm oops, you're right. should be fixed now. check master.
from gulp-dust.
Yep, that's it. Thank you :)
from gulp-dust.
Related Issues (9)
- How can I concat all the output js file like 'dustc */**.dust -o tmpl.js'? HOT 1
- Files not compiled when watch triggers due to change in subfolder HOT 1
- Compile to HTML HOT 6
- ext is still .dust after compilation HOT 1
- Whitespace Flag Unsupported HOT 1
- Can this async/stream + hot reload templates in the browser? HOT 2
- Loading partials for use in templates HOT 2
- How to pass options like amd feature, cwd to gulp-dust task? HOT 4
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 gulp-dust.