docpad-plugin-partials
docpad-plugin-partials copied to clipboard
Unnecessary hard-coding of src/partials during render
The partial plugin creates a custom query to discover partial documents:
.setQuery('isPartial', {
$or:
isPartial: true
fullPath: $startsWith: config.partialsPath # src/partials
})
Notably, $or: allows a document to be discovered outside of the src/partials folder by merely including isPartial: true in the metadata. However, when time to render the documents, the below is hardcoded, making partials outside the src/partials folder give rise to an error:
partialFuzzyPath = pathUtil.join(config.partialsPath, partialName)
partial.document ?= docpad.getCollection('partials').fuzzyFindOne(partialFuzzyPath)