Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug fix] increase robustness of feat_img process pipeline #802

Merged
merged 2 commits into from
Dec 6, 2022

Conversation

Sped0n
Copy link
Contributor

@Sped0n Sped0n commented Dec 6, 2022

复现

exampleSite下的config.toml的中文配置删除(279-521行),构建时就会出现以下报错。

"/home/runner/work/DoIt/DoIt/layouts/posts/single.html:143:25": execute of template failed: template: posts/single.html:143:25: executing "content" at <.Width>: can't evaluate field Width in type resource.Resource

bug原因

exampleSite下的create-diagrams内的参数featureImage为空,理论上来说按照single.html所使用的with方法这个空参数是不会被传入的,但我看作者您在这里貌似使用了一些其他的处理方式让这个空值也会被传入,从而导致Hugo无法获取到资源的宽度从而报错。

修复方法

加了一个判断文件类型的逻辑,只有检测到输入为图片时才会进行后续操作。

@vercel
Copy link

vercel bot commented Dec 6, 2022

Someone is attempting to deploy a commit to a Personal Account owned by @HEIGE-PCloud on Vercel.

@HEIGE-PCloud first needs to authorize it.

@HEIGE-PCloud HEIGE-PCloud merged commit 98107d2 into HEIGE-PCloud:main Dec 6, 2022
@Sped0n Sped0n deleted the featimg_robust branch December 8, 2022 02:28
xiaobinqt pushed a commit to xiaobinqt/DoIt that referenced this pull request Dec 15, 2022
…oud#802)

* increase robustness of feat_img process pipeline

* fix typo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants