birdgg / hugo-theme-shoka

A hugo theme port from hexo theme shoka
https://birdgg.me
MIT License
9 stars 5 forks source link

Bug 除法计算的除数没有判断除数是否为0,并处理异常。 #1

Closed Ailontania closed 2 years ago

Ailontania commented 2 years ago

问题现象: 运行服务器时,报错 Start building sites … hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended windows/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio Error: Error building site: failed to render pages: render of "taxonomy" failed: "...\www\themes\hugo-theme-shoka\layouts_default\terms.html:40:24": execute of template failed: template: _default/terms.html:40:24: executing "main" at <div (sub (math.Log $count) (math.Log $min)) (sub (math.Log $max) (math.Log $min))>: error calling div: can't divide the value by 0 Built in 185 ms

问题原因分析:

birdgg commented 2 years ago

fix with $max add 1