Skip to content

metalsmith.match() issue with metalsmith-branch #24

@emmercm

Description

@emmercm

Something I've noticed in my own plugins @webketje is how metalsmith-branch will only pass a subset of files to a child plugin, but if you use metalsmith.match() it will match against the "global" list of files, and you will end up with some filenames that might not be in your "working" file list.

The fix is using metalsmith.match(pattern, Object.keys(files)) in every plugin, like this: https://github.com/emmercm/metalsmith-reading-time/pull/88/files#diff-92bbac9a308cd5fcf9db165841f2d90ce981baddcb2b1e26cfff170929af3bd1R16

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions