Skip to content

Unnecessary hard-coding of src/partials during render #31

@julrichkieffer

Description

@julrichkieffer

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions