Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
In my build, I'd like to have different permalink patterns per collection. I'm currently doing it by combining PR #24 with multiple invocations of the plugin, effectively giving me "scoped" permalink patterns. While it's working (for the most part), it's clumsy.
This PR is a proposal for a new feature to introduce scoped sets of options, using the passed in options as default, matching on arbitrary metadata. The idea is that, e.g., a
blogposts
collection could have a permalink pattern like:date/:title
, while apages
collection could have a different pattern, such aspages/:title
.Backwards compatibility (meaning the tests pass 🍦) is maintained by making the original options objects act as defaults for each linkset, and also as the default linkset itself.
How it would work
Eventually, I think a bunch of more sophisticated matchers et al. would be awesome, and a bunch more tests, but I wanted to make sure I wasn't running down a path that you'd disagree with too strongly.