Closed abhijeetvramgir closed 2 years ago
This can easily be done (for example with Handlebars) as:
{{ htmlifyPath article.previous.path }}
where htmlifyPath
is a custom Handlebars helper.
If you use'd
collections before eg layouts plugin, the file metadata path
will contain the template language extension and you need to replace the extension with, eg .html
(as the helper above does, or see below)
See for example the custom plugin below, between collections
& layouts
Metalsmith(__dirname)
.use(collections())
.use((files) => {
Object.entries(files).forEach(([file, path]) => {
file.path = path.replace(/\.hbs$/, '.html')
})
})
.use(layouts())
I have to md files:
I'm matching using the
collection
metadata. How do I get the links for the pages?? Thanks!