assemble / grunt-assemble-lunr

grunt-assemble plugin for creating a search engine within your static site using lunr.js.
MIT License
12 stars 2 forks source link

Issues when writing assemble into sub directory #7

Open BradlySharpe opened 8 years ago

BradlySharpe commented 8 years ago

Config:

options: {
    layout: 'page.hbs',
    layoutdir: 'source/configuration/layouts/',
    partials: 'source/configuration/partials/**/*.{hbs,css}',
    plugins: ['grunt-assemble-lunr'],
    lunr: {
      dataPath: 'destination/search.json'
    }
  },
  homepage: {
    options: {
      layout: 'homepage.hbs'
    },
    files: [
      {
        cwd: "source/content/_pages/",
        dest: "destination/",
        expand: true,
        src: 'index.hbs'
      }
    ]
  },
  pages: {
    files: [
      {
        cwd: "source/content/_pages/",
        dest: "destination/",
        expand: true,
        src: [ '**/*.hbs', '!index.hbs' ]
      }
    ]
  },
  blog: {
    options: {
      layout: 'blog.hbs'
    },
    files: [
      {
        cwd: "source/content/blog/",
        dest: "destination/blog/",
        expand: true,
        src: [ '**/*.hbs', '**/*.md' ]
      }
    ]
  }

Then I only publish the contents of the destination folder to the webserver, however all the lunr url's are destination/index.html and destination/blog/blogpost.html

An option to add cwd or the ability to remove the destination/ path would be very handy!

assemblebot commented 8 years ago

@BradlySharpe Thanks for the issue! If you're reporting a bug, please be sure to include:

BradlySharpe commented 8 years ago

assemble: 0.4.42 grunt-assemble-lunr: 0.1.0