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

Strange issues on build... #627

Closed
wehrend opened this issue Jun 13, 2024 · 2 comments
Closed

Strange issues on build... #627

wehrend opened this issue Jun 13, 2024 · 2 comments

Comments

@wehrend
Copy link

wehrend commented Jun 13, 2024

I've having some issues with hugo related to the book theme currently. Working on my laptop, so I cannot verify what the issue here... So cant lookup what I could simply check on my workstation...

Error: Error building site: "/src/content/themes/hugo-book/layouts/_default/_markup/render-image.html:1:1": unmarshal failed: invalid character '{' looking for beginning of object key string
Built in 2398 ms

the mentioned file looks like the following:

{{- if .Page.Site.Params.BookPortableLinks -}}
{{- template "portable-image" . -}}
{{- else -}}
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" {{ with .Title }}title="{{ . }}"{{ end }}/>
{{- end -}}

{{- define "portable-image" -}}
{{- $isRemote := or (in .Destination "://") (strings.HasPrefix .Destination "//") }}
{{- if not $isRemote }}
{{- $path := print .Page.File.Dir .Destination }}
{{- if strings.HasPrefix .Destination "/" }}
{{- $path = print "/static" .Destination }}
{{- end }}
{{- if not (fileExists $path) }}
{{- warnf "Image '%s' not found in '%s'" .Destination .Page.File }}
{{- end }}
{{- end }}
<img src="{{ .Destination | safeURL }}" alt="{{ .Text }}" {{ with .Title }}title="{{ . }}"{{ end }}/>
{{- end -}}

@alex-shpak
Copy link
Owner

Hi! Which URL you supplied to image tag in markdown?

@wehrend
Copy link
Author

wehrend commented Oct 10, 2024

I am not sure what was the culprit, it is solved for now. But I have other issues related to i18n.
Opening another ticket for it.

@wehrend wehrend closed this as completed Oct 10, 2024
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

No branches or pull requests

2 participants