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

Add support for basedir option #64

Closed
sgtpep opened this Issue Dec 5, 2013 · 6 comments

Comments

Projects
None yet
5 participants
@sgtpep

sgtpep commented Dec 5, 2013

I found mention about this option here: http://stackoverflow.com/questions/11675453/jade-loading-templates-from-different-directories#comment27283495_11677885

It allows to use absolute paths in exclude and include directives (starting with slash).

@x1024

This comment has been minimized.

x1024 commented Dec 25, 2013

+1

@tkellen

This comment has been minimized.

Member

tkellen commented Dec 26, 2013

PRs welcome!

@mathiasschopmans

This comment has been minimized.

Contributor

mathiasschopmans commented Feb 19, 2014

Just add basedir to your options.

jade: {
  compile: {
    options: {
      basedir: "path/to/jade/root/",
      data: {
        debug: false
      }
    },
    files: [{
      expand: true,
      flatten: true,
      cwd: 'path/to/jade/template-root/',
      src: ['*.jade'],
      dest: 'path/to/html/output',
      ext :'.html'
    }]
  }
}

@tkellen tkellen closed this Feb 19, 2014

@vlatri

This comment has been minimized.

vlatri commented Aug 20, 2015

@mathiasschopmans, could you tell me where should I look for these options, please?

@mathiasschopmans

This comment has been minimized.

Contributor

mathiasschopmans commented Aug 21, 2015

Hi @vlatri5264,
sorry I don't see your problem. 😕

If my previous answer doesn't solve your question, can you please add a link to a repository you're working on?

Maybe the following Gruntfile.js might help you more. Please adjust the paths.

module.exports = function(grunt) {

  grunt.initConfig({
    jade: {
      yourTaskName: {
        options: {
          basedir: 'path/to/jade/template-root/',
        },
        files: [{
          expand: true,
          flatten: true,
          cwd: 'path/to/jade/template-root/',
          src: ['*.jade'],
          dest: 'path/to/html/output',
          ext :'.html'
        }]
      }
    }
  });

  grunt.loadNpmTasks('grunt-contrib-jade');
  grunt.registerTask('default', ['jade']);

};
@vlatri

This comment has been minimized.

vlatri commented Aug 21, 2015

Thanks, @markdalgleish, your solution works))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment