diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-05-27 17:01:35 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-05-27 18:38:44 +0200 |
commit | 46a2ea6d0d3aba04213362fc72f5a3a28e3c3404 (patch) | |
tree | 02b304fdb8ceaf7bfd5c54f1c4421a734e8b8ffd /tpl | |
parent | 653ab2cc1f97df8f05c466e1d757e1c81fcc58f8 (diff) |
postcss: Make the resource cache key more stable
By using the input map as the basis, which means the hash will not change if we add/rename/remove options.
This happened in Hugo 0.99, as we added a new options. This is unortunate.
Unfortunately this means that the cache keys for PostCSS will change one more time in 0.100, but will be stable going forward.
Note that we have implemented this pattern in all the other resource transformers.
Updates #9787
Diffstat (limited to 'tpl')
-rw-r--r-- | tpl/resources/resources.go | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/tpl/resources/resources.go b/tpl/resources/resources.go index 165152c78..428e36c92 100644 --- a/tpl/resources/resources.go +++ b/tpl/resources/resources.go @@ -405,15 +405,8 @@ func (ns *Namespace) PostCSS(args ...any) (resource.Resource, error) { if err != nil { return nil, err } - var options postcss.Options - if m != nil { - options, err = postcss.DecodeOptions(m) - if err != nil { - return nil, err - } - } - return ns.postcssClient.Process(r, options) + return ns.postcssClient.Process(r, m) } func (ns *Namespace) PostProcess(r resource.Resource) (postpub.PostPublishedResource, error) { |