3

I'm using metalsmith-permalinks with the following settings:

  .use(permalinks({
  pattern: ':title',
  linksets: [{
    match: { collection: 'blogposts' },
    pattern: 'blog/:title'
  }, {
    match: { collection: 'portfolioposts' },
    pattern: 'portfolio/:title'
  }]
}))

However, logging files in the relevant collections shows that path isn't being added to their metadata:

layout: 'subpage.hbs',
title: 'Blog Post',
date: 2016-08-16T00:00:00.000Z,
excerpt: 'This post has an excerpt',
tags: [ 'test', 'test-tag', 'a-third-tag' ],
contents: <>,
mode: '0644',
stats: {},
collection: [ 'blogposts' ]

Permalinks is being called before layouts, meaning it can't be the same issue found here, and – as seen in the log – other plugins are adding metadata successfully.

My full build order is:

.use(collections({}))
.use(tags({}))
.use(permalinks({}))
.use(dateFormatter({}))
.use(markdown({}))
.use(helpers({}))
.use(layouts({}))
.use(rename({}))

And I'm running Metalsmith directly in Gulp. Any help would be greatly appreciated.

0 Answers0