Closed paskal closed 6 years ago
Thanks for the bug report. Yeah, all the templates want a background
parameter defined in the config, e.g.: https://github.com/cboettig/hugo-now-ui/blob/master/exampleSite/config.toml#L74
This value is used as the default; it can be overridden by the page level parameters / yaml headers. But I see your point that I really ought to have a fallback for when neither can be found. Not quite sure the Hugo-foo for that case. Here's the relevant line in the template:
https://github.com/cboettig/hugo-now-ui/blob/master/layouts/_default/baseof.html#L11
https://github.com/kaushalmodi/hugo-bare-min-theme/issues/1 might be a good reference point.
Thanks! Yes, I definitely agree the theme should at least build without errors given a vanilla / no config.yml. (Some documentation of parameter use in the README
is also needed).
I'll take a whack at this
Here's the relevant line in the template:
This does not solve the problem at hand.. but here's a minor optimization to prevent having that | default
.
If you do {{ .Param "foo" }}
, it will pick the foo
param from the .Page.Params
context if found.. and if not, it looks in .Site.Params
context.
So you can do {{ .Param "background" | relURL }}
instead of {{ .Params.background | default .Site.Params.background | relURL }}
.
Now to tackle the problem at hand, you can probably:
theme/static/img/foo.png
, and then{{ (.Param "background") | default "img/foo.png" | relURL }}
(I haven't tried that.. but should work)On that note, this upcoming feature in Hugo will help a great deal! https://github.com/gohugoio/hugo/issues/4490
Look what I've found:
https://github.com/solutionroute/hugo-smorg by @solutionroute is amazing.
Another way in https://github.com/olOwOlo/hugo-theme-even from @olOwOlo:
~ docker-compose run --publish 1111:1111 --rm --name hugo-theme-even blog-preview -D --port 1111 --bind "0.0.0.0" --theme hugo-theme-even server
Building sites … ERROR 2018/03/20 17:35:09
There are two possible situations that led to this error:
1. You haven't copied the config.toml yet. See https://github.com/olOwOlo/hugo-theme-even#installation
2. You have an incompatible update. See https://github.com/olOwOlo/hugo-theme-even/blob/master/CHANGELOG.md#300
Thanks very much... More coming soon.
On Mar 20, 2018 10:39, "Dmitry Verkhoturov" notifications@github.com wrote:
Look what I've found:
[image: image] https://user-images.githubusercontent.com/712534/37672246-9d7850c8-2c7e-11e8-8d20-54935d2e5e6d.png https://github.com/solutionroute/hugo-smorg by @solutionroute https://github.com/solutionroute is amazing.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cboettig/hugo-now-ui/issues/9#issuecomment-374690039, or mute the thread https://github.com/notifications/unsubscribe-auth/AD7VniSyznoH3FjWcI6URAWouX8gRIHVks5tgT7LgaJpZM4SyTEf .
Just checked, works like a charm after last commit. Thanks a lot!
I'm not sure github sent notifications to mentioned authors, so posting double there: theme highlight is out, this very theme is in it, additional info on https://github.com/paskal/terrty/issues/1.
Hello!
$subj, when trying to run this theme against my blog source I get following (and site won't render at all):
The reason is likely some absent
.Site.
parameter but you can't tell it from error message, I guess input parameters handling could be improved.