解决 Hugo Failed to Find a Valid Digest in the 'Integrity' Attribute

将Hugo的博客环境从Mac的电脑转移到Win上面,结果样式不对,报错如下:

Failed to Find a Valid Digest in the 'Integrity' Attribute

Google 了好半天,发现是因为Mac和Win中的文件使用了不同的结尾符导致计算的hashcode不一样导致的。

解决方案

我的方法比较粗暴,就是将整个Repo转换成LF换行的,问题解决。

转换方法

参考:强制git仓库使用LF换行