Detailed warnings

I’ve seen this mentioned a few times, but after recent changes to Hugo I am getting warnings due to Page.URL being deprecated, as well as Page.TranslationBaseName. I’ve used a lot of these in the past, but it is hard to know which ones I need to correct. Is there a way to get Hugo to show the filenames and possible line numbers that are causing these messages?

You can use a code editor to search your project and get all needed info.

This I know, but I don’t think .URL is exclusive to Pages.

.URL is also present within the context of a menu template and within the context of a pagination template.

The use of .URL within the context of .Page is deprecated.

For example within the context of range .Pages etc. then you need to use .Permalink or .RelPermalink and remove .URL

I get it and is probably what I’m going to have to do for now, but is it possible to show detailed warnings about what layouts is causing the errors or would this be a feature request?

Yes it would be. You can make a proposal here: Issues · gohugoio/hugo · GitHub

@b-rad I ran into this recently as well, and was hoping for filename and/or line-number printed out in the warning message. Did you end up filing this by any chance?

I filed this, hopefully they will steer us in the right direction!