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

Include file with data where a key value is a variable passed from gulp #130

Open
yairEO opened this issue Feb 12, 2017 · 2 comments
Open

Comments

@yairEO
Copy link

yairEO commented Feb 12, 2017

main.html (src file)

<!DOCTYPE html>
<html lang='en'>
    <head>
        @@include('../html-includes/head.html', { "pageName":"foo", "pageCSSFile":"bar", "serverPath":xxx })
    </head>

I want xxx to be a variable passed from gulp to my main file (main.html). it has many includes which use that serverPath property in the data passed and I want it to come from gulp.

I can't seem to find how to do that since context only allows the things to be used in if statements. which is a bummer.

@SilvaLA59
Copy link

Hi @yairEO. Can you found how to do this?

@yairEO
Copy link
Author

yairEO commented Nov 7, 2017

@SilvaLA59 - While I did not do that personally, you could use gulp-replace to replace specific strings in the stream with any other string.

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

2 participants