Closed andyra closed 9 years ago
Try using assemble-contrib-permalinks
for assemble 0.4.x
Ah, good catch. OK, now my package.json dependencies look like so:
"assemble": "^0.4.42",
"assemble-contrib-permalinks": "^0.3.6",
"grunt": "^0.4.5",
I changed my Grunfile to:
assemble:
options:
flatten: true
plugins: ['assemble-contrib-permalinks']
...
Now when I run grunt:assemble
, I get the following error:
Warning: Arguments to path.resolve must be strings Use --force to continue.
Note: I'm getting this same error when I clone the assemble-middleware-permalinks repo, install npm dependencies, and run grunt:assemble
.
Check your node_modules
and make sure assemble-contrib-permalinks
is version 0.3.6
. I have that setup on:
Mac OSX 10.9.5
node 0.10.29
npm 1.4.26
Maybe something else is conflicting.
Yep, the package.json file for assemble-contrib-permalinks
is telling the the version number is 0.3.6
. I'm set up with:
Mac OSX 10.9.5
node 0.10.36
npm 1.4.28
The only other npm modules I have in the project are grunt, assemble, and load-grunt-tasks, so I don't think there should be any conflicts.
I updated and it's working fine. How are you using load-grunt-tasks
? Can you post the entire gruntfile?
I'm using load-grunt-tasks so I don't have to manually include new plugins in the gruntfile.
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
assemble:
options:
flatten: true
plugins: ['assemble-contrib-permalinks']
layoutdir: 'docs/layouts'
assets: 'dist/assets'
partials: 'docs/partials/*.hbs'
helpers: 'docs/helpers/*.js'
data: ['docs/data/*.{json,yml}']
site:
options:
permalinks:
preset: 'pretty'
files: [
expand: true
cwd: 'docs/pages'
src: ['**/*.hbs']
dest: 'docs/build/'
]
# Load plugins
require('load-grunt-tasks') grunt,
pattern: ['grunt-*', 'assemble']
grunt.registerTask 'default', ['assemble']
Keep in mind that I'm getting the same error when running grunt assemble
on the examples included in the repo, so I don't think it's specific to this project.
try this:
# Load plugins
require('load-grunt-tasks') grunt,
pattern: ['grunt-*', 'assemble*']
grunt.registerTask 'default', ['assemble']
basically, wildcard the assemble
string to pick up the plugin.
Ah, that did the trick. Thanks! I'm not sure why I was having the same issue on the assemble-middleware-permalinks
repo, but fixing it here works for my project.
I'm trying out this plugin to get pretty permalinks (example.com/about instead of example.com/about.html).
When I run
grunt assemble
, I expectdocs/pages/about.hbs
to compile todocs/build/about/index.html
, but instead it's compiling todocs/build/about.html
. I've followed the example in the docs and my Gruntfile.coffee looks like so:The plugin doesn't seem to be doing anything at all. Is there something I'm missing here?