hugo-PaperMod icon indicating copy to clipboard operation
hugo-PaperMod copied to clipboard

prevent non-existing field refer errors

Open AswinBlue opened this issue 3 years ago • 3 comments
trafficstars

- check parameters before use - prevent 'can't evaluate field' build error - tested in hugo v0.101.0

What does this PR change? What problem does it solve?

  • when using 'config.yml' file in example page, 'can't evaluate field' error occurred (hugo v0.101.0). This PR removes the errors

Was the change discussed in an issue or in the Discussions before?

  • No, I couldn't find related issues

PR Checklist

  • [ ] This change adds/updates translations and I have used the template present here.
  • [ ] I have enabled maintainer edits for this PR.
  • [x] I have verified that the code works as described/as intended.
  • [ ] This change adds a Social Icon which has a permissive license to use it.
  • [x] This change does not include any CDN resources/links.
  • [x] This change does not include any unrelated scripts such as bash and python scripts.
  • [ ] This change updates the overridden internal templates from HUGO's repository.

AswinBlue avatar Jul 10 '22 05:07 AswinBlue

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

sonarqubecloud[bot] avatar Jul 10 '22 05:07 sonarqubecloud[bot]

I don't see any such logs in https://github.com/adityatelange/hugo-PaperMod/runs/7264423754?check_suite_focus=true

Please attach screenshots and a sample source to reproduce this issue if any.

adityatelange avatar Jul 10 '22 14:07 adityatelange

Here's my build errors

PS C:\Users\user\Documents\Github\HugoBlog> git submodule update --remote --merge
PS C:\Users\user\Documents\Github\HugoBlog> hugo -t hugo-PaperMod
Start building sites … 
hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66 windows/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio
ERROR 2022/07/27 20:47:51 render of "page" failed: "C:\Users\user\Documents\Github\HugoBlog\themes\hugo-PaperMod\layouts\_default\baseof.html:5:8": execute of template failed: template: _default/single.html:5:8: executing "_default/single.html" at <partial "head.html" .>: error calling partial: execute of template failed: template: partials/templates/opengraph.html:5:14: executing "partials/templates/opengraph.html" at <.Params.cover.image>: can't evaluate field image in type string
ERROR 2022/07/27 20:47:51 render of "page" failed: "C:\Users\user\Documents\Github\HugoBlog\themes\hugo-PaperMod\layouts\_default\baseof.html:5:8": execute of template failed: template: _default/single.html:5:8: executing "_default/single.html" at <partial "head.html" .>: error calling partial: execute of template failed: template: partials/templates/opengraph.html:5:14: executing "partials/templates/opengraph.html" at <.Params.cover.image>: can't evaluate field image in type string
ERROR 2022/07/27 20:47:51 render of "page" failed: "C:\Users\user\Documents\Github\HugoBlog\themes\hugo-PaperMod\layouts\_default\baseof.html:5:8": execute of template failed: template: _default/single.html:5:8: executing "_default/single.html" at <partial "head.html" .>: error calling partial: execute of template failed: template: partials/templates/opengraph.html:5:14: executing "partials/templates/opengraph.html" at <.Params.cover.image>: can't evaluate field image in type string
ERROR 2022/07/27 20:47:51 render of "page" failed: "C:\Users\user\Documents\Github\HugoBlog\themes\hugo-PaperMod\layouts\_default\baseof.html:5:8": execute of template failed: template: _default/single.html:5:8: executing "_default/single.html" at <partial "head.html" .>: error calling partial: execute of template failed: template: partials/templates/opengraph.html:5:14: executing "partials/templates/opengraph.html" at <.Params.cover.image>: can't evaluate field image in type string
Error: Error building site: failed to render pages: render of "page" failed: "C:\Users\user\Documents\Github\HugoBlog\themes\hugo-PaperMod\layouts\_default\baseof.html:5:8": execute of template failed: template: _default/single.html:5:8: executing "_default/single.html" at <partial "head.html" .>: error calling partial: execute of template failed: template: partials/templates/opengraph.html:5:14: executing "partials/templates/opengraph.html" at <.Params.cover.image>: can't evaluate field image in type string
Total in 172 ms
PS C:\Users\user\Documents\Github\HugoBlog>

And this is commits of papermod repository

9af128a8 (HEAD, origin/master, origin/HEAD) Update Indonesian Languange (id.yaml) (#955)
7683ef18 Add lichess.org social icon. (#952)
0262b5eb Fix typo to work with site verification tags (#954)
a94674e6 Include chroma fix code when hljs is disabled
c6926957 Improve Kurdish translations (#936)
181a8c38 Allow disabling custom Scroll Bar Style
0ed246d4 Seperate scroll-bar customization into seperate stylesheet

AswinBlue avatar Jul 27 '22 11:07 AswinBlue

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

sonarqubecloud[bot] avatar Jun 13 '23 14:06 sonarqubecloud[bot]