Closed saviomd closed 6 years ago
I think a permalinks configuration like this will work for you:
permalinks: {
structure: ':custom/:basename/index.html',
patterns: [
{
pattern: ':custom',
replacement: function () {
var root = path.join(grunt.config.get('config.src'), 'templates/pages');
var ext = path.extname(this.src);
return this.src
.replace(root, '')
.replace(ext, '')
.replace(this.basename, '')
.replace(/^[\/\\]/, '');
}
}
]
}
grunt.config.get('config.src')
is a property set in my grunt.initConfig
. It might be something different for you.
Ok, I'll try that out. Thank you!
@doowb this is a nice workaround but perhaps this should be built in
My permalink config is
I set the path in the YFM of every file and it's working fine, the files are compiled like '/jogos/lista/index.html', '/jogos/buraco/index.html', etc But I wanted to have something more automatic, I don't want to do this in every single html file.
I was looking for a way to have something like that
So the name of the files would be something like "jogoslista.html", "jogosburaco.html" and I would have a way to intercept the basename and replace all "__" with "/". Is this currently possible? (I'm using assemble 0.4.41 and permalinks 0.3.6)