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

Page.URL is deprecated and will be removed #262

Closed
cppcms-testing opened this issue Feb 29, 2020 · 3 comments
Closed

Page.URL is deprecated and will be removed #262

cppcms-testing opened this issue Feb 29, 2020 · 3 comments
Assignees

Comments

@cppcms-testing
Copy link

After a fresh install of Hugo and the theme "ananke", and after generating a new post with the command:
hugo new posts/my-first-one.md
there is a warning:
Page.URL is deprecated and will be removed in a future release. Use .Permalink or .RelPermalink. If what you want is the front matter URL value, use .Params.url
Every time the command:
hugo server -D
is issued, this warning shows up. I have been looking in vain for the string "Page.URL" . I tried another theme. There is no warning. Everything is working fine.
I really like the Ananke theme and would like to use it as a starting theme.
This is a current warning but the solutions found in various forums do not work for me or screw up everything.
Does the author of this theme can help me correct it. I cannot afford to publish in production something with warning, or worse, with errors.
Thank you for the development of themes and for your help.

@zeorze
Copy link

zeorze commented Apr 23, 2020

You should be searching for .URL rather than Page.URL in your theme directory. There are a couple of remnant entries which weren't covered off in #216 . These can be found in layouts > partials > site-navigation.html and layouts > partials > social-share.html.

@cppcms-testing
Copy link
Author

cppcms-testing commented Apr 24, 2020

Thank you for your recommendation. This is exactly what I did before asking for help, and this is the output of the command hugo server -D:
Building sites … ERROR 2020/04/24 15:53:30 render of "section" failed: execute of template failed: template: _default/list.html:49:29: executing "header" at <partial "site-header.html" .>: error calling partial: execute of template failed: template: partials/site-header.html:7:9: executing "partials/site-header.html" at <partial "site-navigation.html" .>: error calling partial: "/home/patrick/ananke/themes/ananke/layouts/partials/site-navigation.html:12:66": execute of template failed: template: partials/site-navigation.html:12:66: executing "partials/site-navigation.html" at <.Permalink>: can't evaluate field Permalink in type *navigation.MenuEntry ERROR 2020/04/24 15:53:30 render of "taxonomyTerm" failed: execute of template failed: template: _default/terms.html:49:29: executing "header" at <partial "site-header.html" .>: error calling partial: execute of template failed: template: partials/site-header.html:7:9: executing "partials/site-header.html" at <partial "site-navigation.html" .>: error calling partial: "/home/patrick/ananke/themes/ananke/layouts/partials/site-navigation.html:12:66": execute of template failed: template: partials/site-navigation.html:12:66: executing "partials/site-navigation.html" at <.Permalink>: can't evaluate field Permalink in type *navigation.MenuEntry ERROR 2020/04/24 15:53:30 render of "page" failed: execute of template failed: template: _default/single.html:3:5: executing "header" at <partial "page-header.html" .>: error calling partial: execute of template failed: template: partials/page-header.html:23:9: executing "partials/page-header.html" at <partial "site-navigation.html" .>: error calling partial: "/home/patrick/ananke/themes/ananke/layouts/partials/site-navigation.html:12:66": execute of template failed: template: partials/site-navigation.html:12:66: executing "partials/site-navigation.html" at <.Permalink>: can't evaluate field Permalink in type *navigation.MenuEntry ERROR 2020/04/24 15:53:30 render of "taxonomyTerm" failed: execute of template failed: template: _default/terms.html:49:29: executing "header" at <partial "site-header.html" .>: error calling partial: execute of template failed: template: partials/site-header.html:7:9: executing "partials/site-header.html" at <partial "site-navigation.html" .>: error calling partial: "/home/patrick/ananke/themes/ananke/layouts/partials/site-navigation.html:12:66": execute of template failed: template: partials/site-navigation.html:12:66: executing "partials/site-navigation.html" at <.Permalink>: can't evaluate field Permalink in type *navigation.MenuEntry Built in 31 ms Error: Error building site: failed to render pages: render of "home" failed: execute of template failed: template: index.html:49:29: executing "header" at <partial "site-header.html" .>: error calling partial: execute of template failed: template: partials/site-header.html:7:9: executing "partials/site-header.html" at <partial "site-navigation.html" .>: error calling partial: "/home/patrick/ananke/themes/ananke/layouts/partials/site-navigation.html:12:66": execute of template failed: template: partials/site-navigation.html:12:66: executing "partials/site-navigation.html" at <.Permalink>: can't evaluate field Permalink in type *navigation.MenuEntry

I just replaced ".URL" by ".Permalink" in the files :
themes/ananke/layouts/partials/social-share.html
themes/ananke/layouts/partials/site-navigation.html

Thank you again.
I think there is something rotten. I have waisted too much time trying to debug it. I'll find another solution. People should test more carefully before publishing themes. This is doing much harm to Hugo.

@budparr
Copy link
Member

budparr commented Apr 24, 2020

@cppcms-testing Why are you trying to fix this? It's a warning and should not be breaking your site.

I cannot afford to publish in production something with warning, or worse, with errors.

What errors? It's a warning. I run 40+ Hugo sites in production and have not had a problem. It will be fixed before it becomes an error.

People should test more carefully before publishing themes. This is doing much harm to Hugo.

Can you explain the harm being done to Hugo? The theme works perfectly and is used by many people. I built the theme on my free time and contribute to Hugo and the community as much as I can. Perhaps we should charge you money for the theme so we can dedicate resources to supporting it? Would you prefer that, or would you prefer to use a free open source theme that you're welcome contribute to.

@budparr budparr closed this as completed Apr 24, 2020
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

4 participants