Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multimatch filtering to source files #11

Open
ubenzer opened this issue Oct 24, 2014 · 6 comments
Open

Multimatch filtering to source files #11

ubenzer opened this issue Oct 24, 2014 · 6 comments

Comments

@ubenzer
Copy link
Contributor

ubenzer commented Oct 24, 2014

Hello,

Is it possible to add a filtering mechanism, so it can be determined which files to be processed to css and which files should be left out as-is?

Thanks for this plugin!

@stevenschobert
Copy link
Owner

Hey @ubenzer, thanks for the suggestion.

Out of curiosity, was there anything in particular about the other Metalsmith plugins (like metalsmith-ignore) that didn't work out for you?

@ubenzer
Copy link
Contributor Author

ubenzer commented Oct 28, 2014

Hey @stevenschobert ,

metalsmith-ignore fully deletes a file, so it doesn't appear on the build folder. I want some sass files not to be converted to css and stay as uncompiled files.

The reason behind this is: I am trying to write a metalsmith-powered blog engine and I only want theme-related scss files to be compiled. If user adds a scss files to their post (say, he is writing a scss tutorial and adds an example scss file to his post to be downloaded) I don't want to compile it to css and leave it as-is.

@stevenschobert
Copy link
Owner

@ubenzer Ah. Really interesting use-case.

I could see how adding some sort of ignore option would be nice to have, but I'm wondering whether that option would completely remove the file, or just not compile it. Which do you think the most expected behavior would be?

@ubenzer
Copy link
Contributor Author

ubenzer commented Nov 9, 2014

Just leave it as is, not compile.

I can come up with a PR this week if I have time, if that is OK with you.

@karneaud
Copy link

What's the state of this as it can be useful. I have my main sass files and I have some framework sass files that I import into my main sass. Things go as planned but the frame work sass is being compiled as a .css into the output as well which is not what I want as its already being compiled into the main sass file thus

app/
-----/framework/sass/style.scss
----/sass/main.scss

my metalsmith.json has

"metalsmith-sass":
    {
        "files":["app/sass/*.scss"],
        "includePaths":["app/sass"],
        "outputDir":"css",
        "outputStyle": "expanded"
    },

my main.scss has

@import "../framework/sass/style";

what I get outputted

css/
-----style.css
-----main.css

why is it outputting the style.css?

@irisli
Copy link

irisli commented Sep 29, 2015

Hi. I was going to open an issue but then saw this issue that described what I was looking for.

In my use case, I have a documentation site that pulls in a standalone angular webapp (that contains both a index.scss and index.css). The files in the webapp directory are to be left as-is. With metalsmith-in-place and metalsmith-layouts, i can specify pattern: "*.handlebars" to only use handlebars on those specific files.

It would be great to have a config to only process specific files. For me, I would use pattern: styles/** and then only sass files in the parent website gets processed while child standalone webapps are left as-is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants