You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a Metalsmith instance is intantiated, it can have a property indicating its pristine state.
When run is first called it is assigned a different value.
This property can be used to determine whether a function call happened during instantiation or during the first run.
Then the match method could be used as a built-in to replace the pattern option in many plugins.
metalsmith.use(drafts())// match allmetalsmith.match('**/*.html').use(minifyHtml)// match html only for following plugins
Equally if not more appealing, and very similar to express js routers:
metalsmith.use('**/*.html',minfiyHtml)
though this has implications for the metalsmith.json CLI format in how array parameters vs function arguments are interpreted
The text was updated successfully, but these errors were encountered:
When a Metalsmith instance is intantiated, it can have a property indicating its pristine state.
When
run
is first called it is assigned a different value.This property can be used to determine whether a function call happened during instantiation or during the first run.
Then the
match
method could be used as a built-in to replace thepattern
option in many plugins.Equally if not more appealing, and very similar to express js routers:
though this has implications for the metalsmith.json CLI format in how array parameters vs function arguments are interpreted
The text was updated successfully, but these errors were encountered: