wangchucheng / hugo-eureka

Eureka is a feature-rich and highly customizable Hugo theme.
https://www.wangchucheng.com/en/docs/hugo-eureka/
Apache License 2.0
926 stars 193 forks source link

icon.png 更换无效,生成的网站维持原 icon #220

Open fanghenshaometeor opened 2 years ago

fanghenshaometeor commented 2 years ago

作者你好!

我将 themes/hugo-eureka/assets/images/ 下默认的 icon.png 替换成了另外一张同名但内容不同的 icon.png 之后,hugo 生成的网站仍然是之前的默认 icon 图标(也就是白底黑字的 W),无法更换图标。

我尝试在 themes/hugo-eureka/assets/images/ 下添加一个新的 icon.jpg 文件,同时在 config/_default/params.yaml 中将 icon: images/icon.png 修改成 icon: images/icon.jpg,此时再 hugo 生成网站则会报错

Start building sites … 
hugo v0.106.0-e08ce30fe4779e7d8a8395d7021314b915648cb4 windows/amd64 BuildDate=2022-11-17T18:33:40Z VendorInfo=gohugoio
ERROR 2022/11/23 16:20:26 render of "term" failed: "C:\Users\fangkun\AppData\Local\Temp\hugo_cache\modules\filecache\modules\pkg\mod\wangchucheng.com\hugo-eureka@v0.9.3\layouts\_default\baseof.html:7:6": execute of template failed: template: _default/list.html:7:6: executing "_default/list.html" at <partial "head" .>: error calling partial: "C:\Users\fangkun\AppData\Local\Temp\hugo_cache\modules\filecache\modules\pkg\mod\wangchucheng.com\hugo-eureka@v0.9.3\layouts\partials\head.html:172:58": execute of template failed: template: partials/head.html:172:58: executing "partials/head.html" at <partial "get-icon" (dict "icon" . "size" 32)>: error calling partial: execute of template failed: template: partials/head.html:178:24: executing "partials/get-icon" at <$icon.Fill>: nil pointer evaluating resource.Resource.Fill
ERROR 2022/11/23 16:20:26 render of "page" failed: "C:\Users\fangkun\AppData\Local\Temp\hugo_cache\modules\filecache\modules\pkg\mod\wangchucheng.com\hugo-eureka@v0.9.3\layouts\_default\baseof.html:7:6": execute of template failed: template: _default/single.html:7:6: executing "_default/single.html" at <partial "head" .>: error calling partial: "C:\Users\fangkun\AppData\Local\Temp\hugo_cache\modules\filecache\modules\pkg\mod\wangchucheng.com\hugo-eureka@v0.9.3\layouts\partials\head.html:172:58": execute of template failed: template: partials/head.html:172:58: executing "partials/head.html" at <partial "get-icon" (dict "icon" . "size" 32)>: error calling partial: execute of template failed: template: partials/head.html:178:24: executing "partials/get-icon" at <$icon.Fill>: nil pointer evaluating resource.Resource.Fill
ERROR 2022/11/23 16:20:26 render of "page" failed: "C:\Users\fangkun\AppData\Local\Temp\hugo_cache\modules\filecache\modules\pkg\mod\wangchucheng.com\hugo-eureka@v0.9.3\layouts\_default\baseof.html:7:6": execute of template failed: template: _default/single.html:7:6: executing "_default/single.html" at <partial "head" .>: error calling partial: "C:\Users\fangkun\AppData\Local\Temp\hugo_cache\modules\filecache\modules\pkg\mod\wangchucheng.com\hugo-eureka@v0.9.3\layouts\partials\head.html:172:58": execute of template failed: template: partials/head.html:172:58: executing "partials/head.html" at <partial "get-icon" (dict "icon" . "size" 32)>: error calling partial: execute of template failed: template: partials/head.html:178:24: executing "partials/get-icon" at <$icon.Fill>: nil pointer evaluating resource.Resource.Fill
ERROR 2022/11/23 16:20:26 render of "home" failed: "C:\Users\fangkun\AppData\Local\Temp\hugo_cache\modules\filecache\modules\pkg\mod\wangchucheng.com\hugo-eureka@v0.9.3\layouts\_default\baseof.html:7:6": execute of template failed: template: index.html:7:6: executing "index.html" at <partial "head" .>: error calling partial: "C:\Users\fangkun\AppData\Local\Temp\hugo_cache\modules\filecache\modules\pkg\mod\wangchucheng.com\hugo-eureka@v0.9.3\layouts\partials\head.html:172:58": execute of template failed: template: partials/head.html:172:58: executing "partials/head.html" at <partial "get-icon" (dict "icon" . "size" 32)>: error calling partial: execute of template failed: template: partials/head.html:178:24: executing "partials/get-icon" at <$icon.Fill>: nil pointer evaluating resource.Resource.Fill
Error: Error building site: failed to render pages: render of "taxonomy" failed: "C:\Users\fangkun\AppData\Local\Temp\hugo_cache\modules\filecache\modules\pkg\mod\wangchucheng.com\hugo-eureka@v0.9.3\layouts\_default\baseof.html:7:6": execute of template failed: template: authors/terms.html:7:6: executing "authors/terms.html" at <partial "head" .>: error calling partial: "C:\Users\fangkun\AppData\Local\Temp\hugo_cache\modules\filecache\modules\pkg\mod\wangchucheng.com\hugo-eureka@v0.9.3\layouts\partials\head.html:172:58": execute of template failed: template: partials/head.html:172:58: executing "partials/head.html" at <partial "get-icon" (dict "icon" . "size" 32)>: error calling partial: execute of template failed: template: partials/head.html:178:24: executing "partials/get-icon" at <$icon.Fill>: nil pointer evaluating resource.Resource.Fill
Built in 80 ms

期待回复!

TimDorand commented 1 year ago

Hi, I had the same issue and found the fix. Update your params with this: https://github.com/wangchucheng/hugo-eureka-starters/blob/main/config/_default/params.yaml

fanghenshaometeor commented 1 year ago

Hi, I had the same issue and found the fix. Update your params with this: https://github.com/wangchucheng/hugo-eureka-starters/blob/main/config/_default/params.yaml

Thanks for your kind reply. But i checked that my params.yaml is exactly the same as the file you share. it seems that it does not work. i still cannot change the icon.

Li-Jinjie commented 1 year ago

Hi, I changed the icon.png and presented successfully. Please see my forked repository https://github.com/Li-Jinjie/hugo-eureka. Maybe clean your cache?