You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm new with Hugo, so I'm not sure that this is a bug. At least the theme configuration, didn't behave the way I expected.
Configuration
hugo-tranquilpeak-theme 0.4.4-BETA
hugo v0.37.1 linux/amd64
Actual behavior
Parameters author.picture and params.coverImage from config.yml don't behave the same way.
I put both picture and coverImage files into ~/HugoProject/static/images/theme/. After building my site, both jpeg files end well in ~/HugoProject/public/images/theme/. But the html generated give:
A workaround is possible but tweaking the path only for coverImage like this:
coverImage: "/theme/cover_01.jpg"
Expected behavior
Images/files that we put at the same static place, and that end under the same path once generated should be referenced the same way in the config file.
Steps to reproduce the behavior
Create a fresh Huge project
Add the tranquilpeak-theme in it,
Copy you Avatar/logo picture and background picture in the same directory somewhere under /static
Edit your config.yml/tml to set picture and params.coverImage to point to the corresponding file (both having the same path)
Generate you static site
The text was updated successfully, but these errors were encountered:
xenlo
changed the title
picture and params.coverImage from config.yml don't behave the same wayauthor.picture and params.coverImage from config.yml don't behave the same way
Feb 12, 2019
I dig a bit. I found that in certain files like themes/tranquilpeak/layouts/partials/meta.html, .Params.coverImageand .Author.picture are used the same way though absURL filter.
xenlo@silver-screen:~/Scripts/hugolwenn$ grep".Params.coverImage\|.Author.picture"-C5themes/tranquilpeak/layouts/partials/meta.html
{{ with .Params.thumbnailImage }}
<metaproperty="og:image"content="{{ . | absURL }}"><metaproperty="twitter:image"content="{{ . | absURL }}">
{{ end }}
{{ with .Params.coverImage }}
<metaproperty="og:image"content="{{ . | absURL }}"><metaproperty="twitter:image"content="{{ . | absURL }}">
{{ end }}
{{ with .Params.gallery }}
{{ range . }}
--
{{ end }}
{{ if .Scratch.Get"gravatarEmail" }}
<metaproperty="og:image"content="https://www.gravatar.com/avatar/{{ (md5 (.Scratch.Get "gravatarEmail")) |urlize }}?s=640"><metaproperty="twitter:image"content="https://www.gravatar.com/avatar/{{ (md5 (.Scratch.Get "gravatarEmail")) |urlize }}?s=640">
{{ elseif .Site.Author.picture }}
<metaproperty="og:image"content="{{ .Site.Author.picture | absURL }}"><metaproperty="twitter:image"content="{{ .Site.Author.picture | absURL }}">
{{ end }}
Nevertheless, in themes/tranquilpeak/layouts/partials/cover.html it adds an imges/ if the coverImage don't contain a ://.
{{ with .Site.Params.coverImage }}
{{ if (in . "://") }}
{{ $cover:= . }}
<divid="cover" style="background-image:url('{{ $cover | absURL }}');"></div>
{{ else }}
{{ $cover:= (printf"images/%s" .) }}
<divid="cover"style="background-image:url('{{ $cover | absURL }}');"></div>
{{ end }}
{{ end }}
* upstream/master: (28 commits)
Fix wrong mini requirement
🔖 version 0.4.7-BETA
Upgrade index.html to support changes from 0.57
update generator theme version
🔖 version 0.4.6-BETA
Remove stupid previous cover Image fix
Update showcase
build
🔖 version 0.4.5-BETA
0.4.5-BETA changelog
Remove search stuffs if algolia is not set
Update changelog & breaking change
Always fetch cover image from base path
Update doc & requirement
Add check on legacy file path
Remove grunt from doc, prefer using npm
Fix eslint error
Update deps & fix build for latest node
Update base code to fix hugo warnings
Proposition to correct issue kakawait#327, align static image behavior Second attempt with the right account this time I hope
...
Hi/Bonjour,
I'm new with Hugo, so I'm not sure that this is a bug. At least the theme configuration, didn't behave the way I expected.
Configuration
Actual behavior
Parameters
author.picture
andparams.coverImage
from config.yml don't behave the same way.I put both
picture
andcoverImage
files into~/HugoProject/static/images/theme/
. After building my site, both jpeg files end well in~/HugoProject/public/images/theme/
. But the html generated give:picture
, andcoverImage
A workaround is possible but tweaking the path only for
coverImage
like this:Expected behavior
Images/files that we put at the same static place, and that end under the same path once generated should be referenced the same way in the config file.
Steps to reproduce the behavior
/static
picture
andparams.coverImage
to point to the corresponding file (both having the same path)The text was updated successfully, but these errors were encountered: