.Page.URL
deprecation broke my navigation and pagination, but does not bring error messages. Replacing by .Permalink
or .RelPermalink
or .Params.url
still brokes and brings error messages can't evaluate field ... in type ...
Can someone have a look at my repo and help me please?
I used .Page.URL
in nav.html
+ nav-poemes.html
+ nav-recueils.html
.
Thanks!
edit: finally doesn’t seem related to .Page.URL
deprecation, see below
1 Like
Hello,
Please have a look at the relevant GitHub issue by reading it you will find that there are several ways to fix the issues you encountered.
Also I am not sure why you mention that your website broke due to the depreciation of .Page.URL as this should only show warnings in the console. Once .Page.URL is removed from Hugo then your project will break.
P.S. I had a cursory look at your repo and you should be able to fix the warnings with what I posted above, but note that I didn’t actually test your project locally due to lack of time.
Thanks for your answer.
I was confused because the “prev/next in section” navigation in nav-poemes.html
is broken after upgrading Hugo (worked like a charm in 0.54
).
For menus relying on Page’s .URL
to detect the current page (in main nav nav.html
and secondary nav nav-recueils.html
), I just replaced .Page.URL
by .Page.RelPermalink
and it did the job, menus are working fine and there’s no warning fired by these two files.
But as far as the “prev/next in section” navigation here is concerned, the 0.55.0
update breaks it: .PrevInSection
and .NextInSection
are empty. If you have any clue why I’d be glad if you could help. Otherwise I will try this code by @rordorf indicated here but it’s way more complicated.
It seems to me this break is due to version 0.55.0
's following fix:
Fix default date assignment for sections 1d9dde82 @bep #5784
But I’m not sure at all. When trying to render .NextInSection.RelPermalink
(or prev
/ .URL
) I’ve got this error:
nil pointer evaluating page.Page.RelPermalink
But I don’t know how to work around this.
@bep do you think this could be a collateral bug introduced in 0.55.0
?