Giter Club home page Giter Club logo

Comments (13)

TinoGuo avatar TinoGuo commented on August 23, 2024

It can occasionally happen in prod build as well. I build 4 times and got 1 time error
image

from doit.

HEIGE-PCloud avatar HEIGE-PCloud commented on August 23, 2024

Can you share your params.toml or hugo.toml configurations? Specifically have you configured anything about params.image?

from doit.

TinoGuo avatar TinoGuo commented on August 23, 2024
image:
  # 缓存图片链接到本地
  cacheRemote : true
  # 图片缩放和优化
  optimise : true

I copied the configuration from master

from doit.

HEIGE-PCloud avatar HEIGE-PCloud commented on August 23, 2024

Can you provide a minimal reproduction? I cannot reproduce this issue on the exampleSite.

The error message is just saying that params.image has type string instead of map, which indicates that it might be a configuration error. I suspect somewhere in the config there is an image = "some/image.png" entry which is causing conflicts.

from doit.

TinoGuo avatar TinoGuo commented on August 23, 2024

I added image : "" into the seo.en.yaml, will it cause the conflict? as this is not 100% reproducible, so I need some time to make minimal project.

from doit.

TinoGuo avatar TinoGuo commented on August 23, 2024

I tried to log the data and debug the template, I found one interesting thing

Status ScreenShot Type
Success Screenshot 2024-05-28 at 22 53 46 Map
Fail Screenshot 2024-05-28 at 22 54 05 empty string
Fail Screenshot 2024-05-28 at 22 55 37 Map but recognize as String

So it seems the data is not recoginze instead of configuration problem

btw, I'm using YAML to config hugo

from doit.

HEIGE-PCloud avatar HEIGE-PCloud commented on August 23, 2024

How do you trigger the third case? What's the difference between the first case and the third case?

This might be an issue with Hugo...

from doit.

TinoGuo avatar TinoGuo commented on August 23, 2024

I try to rename image in image.html
from

{{- $cacheRemote := .CacheRemote | default site.Params.image.cacheRemote | default false -}}
{{- $optimise := .Optimise | default site.Params.image.optimise | default false -}}

to

{{- $cacheRemote := .CacheRemote | default site.Params.imageX.cacheRemote | default false -}}
{{- $optimise := .Optimise | default site.Params.imageX.optimise | default false -}}

and config the imageX in the params.yaml, then no issue found, so it still could be conflict. however, I searched the config in my site, only this image was configured. I have no idea to continue. could it conflict image with hugo?

from doit.

TinoGuo avatar TinoGuo commented on August 23, 2024

@HEIGE-PCloud nothing difference when trigger these 3 cases, just run and screenshot, all the configurations are the same. from my POV, it seems the configuration was changed in runtime in 3rd case, even though it read as map before, but the configuration was changed to String when process the image.html

from doit.

TinoGuo avatar TinoGuo commented on August 23, 2024

I think I figured out the RC, so I added below to my site as seo.en.yaml and seo.zh-cn.yaml

# Site SEO config
# 网站 SEO 配置
[seo]
  # image URL
  # 图片 URL
  image = "/images/Apple-Devices-Preview.png"
  # thumbnail URL
  # 缩略图 URL
  thumbnailUrl = "/images/screenshot.png"
  # Google 搜索结果中网站备用名字
  # alternate site name in Google search result
  # https://developers.google.com/search/docs/appearance/site-names#alternative
  # alternateName = ["Hugo DoIt"]

so whenever, I attach image field then it will be high possibility fail. If I remove the field, then nothing went wrong. But I have no idea, why the seo can override the image in params, it could be hugo issue

from doit.

HEIGE-PCloud avatar HEIGE-PCloud commented on August 23, 2024

The SEO config is under the params namespace https://github.com/search?q=repo%3AHEIGE-PCloud%2FDoIt%20params.seo&type=code

So it should be placed in params.yaml. Inside params.yaml, you should have both

image:
  cacheRemote: true
  optimise: true

seo:
  image: /images/Apple-Devices-Preview.png
  thumbnailUrl: /images/screenshot.png

I am not sure whether this is the RC though.

from doit.

HEIGE-PCloud avatar HEIGE-PCloud commented on August 23, 2024

I don't think Hugo actually supports arbitrary top level config keys... Not sure what it does when it sees one.

https://github.com/gohugoio/hugo/blob/7f3061723e3df064515fc57c183b06ed16f26b75/config/allconfig/allconfig.go#L98

from doit.

TinoGuo avatar TinoGuo commented on August 23, 2024

since the issue gone after the change, I think this should be RC. thx for support and sorry to raise false alarm

from doit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.