by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Bogdan Chadkin
    @TrySound
    Are you sure, beetwen closing brackets (round and curly) and suffix could be spaces and after variable name immediatly suffix?
    haoxin
    @coderhaoxin
    Oh, I mean +1 for "avoid using @if statement without round brackets", since it's broken, it need publish as v1.x(a major version)
    Bogdan Chadkin
    @TrySound
    @coderhaoxin Yes, I understand. It's just a question how parse suffix.
    haoxin
    @coderhaoxin
    haha, if we suggest to avoid using @if statement without brackets, no need suffix.
    haoxin
    @coderhaoxin
    This message was deleted
    Bogdan Chadkin
    @TrySound
    @coderhaoxin Maybe parse suffix as unneccesary? Comments for example: /* include() */ <!-- include() -->
    Bogdan Chadkin
    @TrySound
    Ok, if bracketsless constuction is the only reason, I will not parse suffix.
    Bogdan Chadkin
    @TrySound
    @coderhaoxin Streaming mode doesn't support even wearefractal. It's just complicating testing. Maybe remove it on 1.0?
    haoxin
    @coderhaoxin
    Agree!
    Patrick Shelley
    @pat154
    Hi guys! Great plugin. I was just wondering if it's possible to copy the compiled file to a new directory without it matching the filestructure of the source. E.g. I've got src/pages/home.html which includes src/global/header.html. Currently it gets compiled to dist/pages/home.html and head.html gets copied over to /dist/global as well. Is it possible to make it just compile src/pages/home.html into dist/home.html with copying the head.html file too?
    Thanks!
    Patrick Shelley
    @pat154
    Sorry guys, new to gulp. Just realised it was my own settings! :)
    con-ssc
    @con-ssc
    Hello
    Bogdan Chadkin
    @TrySound
    Hi
    con-ssc
    @con-ssc
    I want to try to loop over a folder with files and I want to replace an @@include with each filename once so that I get multiple files from one template, is that possible?
    Bogdan Chadkin
    @TrySound
    Nope)
    Not now
    con-ssc
    @con-ssc
    :(((
    I already jumped through loops to manage it for uglify and browserify
    Jorge Martinez
    @GiorgioMartini
    Hi there, one question, to have the same header and footer on all pages... does each file still has to have a body.. or can the body be half of it in the header and the end on the footer?
    Bogdan Chadkin
    @TrySound
    @GiorgioMartini You can only include partials, there is not layout extending.
    Prosenjit Manna
    @developer-prosenjit
    hello I setup gulp-file-include for html file include. It's working fine when run build task and when watch task running I user browser sync server side include process. But that way I can not set variables . Without sending dist folder is it possible include html files? Because if I have 100 html files then each line changes total 100 html files compiled and send to dist folder. This will be take large memory and time.
    Bogdan Chadkin
    @TrySound
    @developer-prosenjit Variables work fine.
    Prosenjit Manna
    @developer-prosenjit
    I know but how to serve html file when watch mode?
    because I am using currently browser sync server include process
    Bogdan Chadkin
    @TrySound
    browsersync doesn't have any leverage on file-include. Don't understand where is the problem.
    Show your code and error log
    Prosenjit Manna
    @developer-prosenjit

    browsersync code for server side compile

    rewriteRules: [
    {
    match: /@include("(.+?)")/g,
    fn: function (match, filename) {
    if (fs.existsSync(filename)) {
    return fs.readFileSync(filename);
    } else {
    return '<span style="color: red">'+filename+' could not be found</span>';
    }
    }
    }
    ],
    it's works when I run watch mode but without variable

    header.tpl

    <ul class="nav nav-pills">
    <li class="@home-active"><a href="#">Home</a></li>
    <li><a href="#">Profile</a></li>
    <li><a href="#">Messages</a></li>
    </ul>

    index.html
    @include("app/header.tpl",{
    "home-active" : "active"
    })
    this works when build time, but this don't work when in watch mode

    Bogdan Chadkin
    @TrySound
    Use ```code``` please
    Bogdan Chadkin
    @TrySound
    @developer-prosenjit Okay, browser-sync is not gulp-file-include. You just matches regexp and returns something. It's not our issue.
    Anthony
    @anthonygoodier
    Hi all, is it possible to set a default variable which is used if no variable is set when an include is called?
    Bogdan Chadkin
    @TrySound
    Hi @anthonygoodier, you can use context.var_name, which is undefined if veriable doesn't exist. Context in conditions is not the same as global context variables.
    Anthony
    @anthonygoodier
    Hi @TrySound, thanks for your reply but I don't quite follow, my JavaScript isn't that strong. Is there any documentation on this that I am missing?
    Bogdan Chadkin
    @TrySound
    I mean
    <div>
    @@if (context.var === 'value') {will not throw and error}
    </div>
    Anthony
    @anthonygoodier
    okay, thanks for your help
    Jacob Bearce
    @JacobDB
    Is there a way to set variables from within your gulpfile.js? I'd like to do something like gulp build-static or gulp build-wordpress to build out either static HTML or WordPress PHP based on statements like @@if (buildmode === "wordpress") {/* php code */} and @@if (buildmode === "static") {/* html code */}.
    Bogdan Chadkin
    @TrySound
    use context option
    @revxx14
    Jacob Bearce
    @JacobDB
    Is there documentation on that @TrySound ? Looking around I'm not understanding what you mean
    Thanks much!
    Jacob Bearce
    @JacobDB
    One more question: Is it possible to do while loops? I see in coderhaoxin/gulp-file-include#70 that it's suggested, but I'm not sure if it's actually been implemented?
    Bogdan Chadkin
    @TrySound
    Note yet. I have a plan to make it in 1.0
    Nothing was implemented in this list
    Miguel Ramos
    @mishingo
    can you do nested for loops?
    l5s
    @l5s
    I suspect that this has been asked a million times, but I haven't seen any document for an else statement. For example, @@if (index === 0) { <li class="active"> } else { <li> }. Is there such a thing?
    Tony Boswell
    @Shylmysten
    Can't figure out what I'm missing... My current includes look like this
    {{include "includes/news-patterns/quotes/1.html"}}
    Tony Boswell
    @Shylmysten

    Bah, I tried to edit post above and it wouldn't allow me to save it....

    My gulp task:

    var buildIncludes = function (done) {
        return src([paths.tmp + 'home.html', paths.tmp + 'interior.html'])
            .pipe(fileinclude({
                prefix: '{{',
                suffix: '}}',
                basepath: paths.tmp
            }))
            .pipe(dest(paths.tmp))
    }

    I've tried using open: '"' and close: '"' as well with no success, it's just not replacing - not sure what I'm doing wrong here.

    I've replaced one include with your template pattern @@include('path/file') and it works great, however, I would like to keep my current templating system:

    {{include "path/file"}}

    and not have to go through every single file and replace it with your pattern, and then try to rework the templating system I already have in place.

    Does the plugin currently have support to do what I am trying to do, because I thought the docs implied that it did...

    Thanks in advance!