DBJDBJ
June 19, 2019, 1:38pm
1
I have downloaded and installed HUGO today (19/JUN/19). All is fine. My Hugo site worlks as before.
layouts/partials/logo.html
… I do not understand what should be the href of the only <a>
over there? Whatever I do, after I save the file, WARN is the same (working inside hugo serve session, as ever) :
Page’s .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.
Ideally I would like not to have any image in there, just a simple text inside an link.
zwbetz
June 19, 2019, 1:46pm
2
We’d have to see your project code to help out more, but the warning message you pasted is clear IMO.
DBJDBJ
June 19, 2019, 3:29pm
3
Site is here: https://dbj-kb.onrender.com/
Project is here: https://github.com/dbj-systems/kb
theme is: docDock https://themes.gohugo.io/docdock/
That error message is not clear to me … Although it has nothing to do with my inability to change the logo … There is something fundamental I do not know it seems … like for example GO Templates fundamentals …
zwbetz
June 19, 2019, 3:32pm
4
DBJDBJ
June 19, 2019, 3:35pm
5
Ok , I was just about to ask if double quotes are a problem … thanks …
I assume I will be able to understand and use inbuilt vairables and the ones from the config …
(changed that and git pushed it)
But it seems the core issue is chaniging that file does not propagae to the site?
zwbetz
June 19, 2019, 3:39pm
6
You need to fix all of these, for whichever theme you’re using.
$ grep -r "\.URL" *
themes/learn/layouts/shortcodes/children.html:<a href="{{.URL}}" >{{ .Title }}</a>
themes/learn/layouts/shortcodes/children.html:<a href="{{.URL}}" >{{ .Title }}</a>
themes/learn/layouts/shortcodes/ref.html: {{- .URL -}}
themes/learn/layouts/shortcodes/relref.html: {{- .URL -}}
themes/learn/layouts/_default/list.html: <li><a href="{{.URL}}">{{.Title}}</a></li>
themes/learn/layouts/partials/menu.html: {{.Pre}}<a class="padding" href="{{.URL | absLangURL }}">{{safeHTML .Name}}</a>{{.Post}}
themes/learn/layouts/partials/menu.html: <li data-nav-id="{{.URL}}" title="{{.Title}}" class="dd-item
themes/learn/layouts/partials/menu.html: <li data-nav-id="{{.URL}}" title="{{.Title}}" class="dd-item {{if eq .UniqueID $currentNode.UniqueID}}active{{end}}">
themes/learn/layouts/partials/footer.html: {{if hasPrefix $currentNode.URL .menu.URL }}
themes/learn/layouts/partials/footer.html: <a class="nav nav-prev" href="{{.URL}}" title="{{.Title}}"> <i class="fa fa-chevron-left"></i></a>
themes/learn/layouts/partials/footer.html: <a class="nav nav-next" href="{{.URL}}" title="{{.Title}}" style="margin-right: 0px;"><i class="fa fa-chevron-right"></i></a>
themes/learn/layouts/partials/header.html: {{ $value := (printf "<a href='%s'>%s</a> > %s" $parent.URL $parent.Title .value) }}
themes/docdock/layouts/shortcodes/children.html: <a href="{{.URL}}" >{{ .Title }}</a>
themes/docdock/layouts/shortcodes/children.html: <a href="{{.URL}}" >{{ .Title }}</a>
themes/docdock/layouts/shortcodes/relref.html: {{- .URL -}}
themes/docdock/layouts/shortcodes/header.html: <li><a href="{{.URL}}" >{{ .Title }}</a></li>
themes/docdock/layouts/shortcodes/header.html: <li><a href="{{.URL}}" >{{ .Title }}</a></li>
themes/docdock/layouts/partials/next-prev-page.html: {{- if hasPrefix $currentNode.URL .menu.URL -}}
themes/docdock/layouts/partials/next-prev-page.html: <a class="nav nav-prev" href="{{.URL}}" title="{{.Title}}"> <i class="fa fa-chevron-left"></i><label>{{.Title}}</label></a>
themes/docdock/layouts/partials/next-prev-page.html: <a class="nav nav-next" href="{{.URL}}" title="{{.Title}}" style="margin-right: 0px;"><label>{{.Title}}</label><i class="fa fa-chevron-right"></i></a>
themes/docdock/layouts/partials/pagination.html: <a class="newer-posts" href="{{ .Prev.URL }}">← {{T "Previous-Pages"}}</a>
themes/docdock/layouts/partials/pagination.html: <a class="older-posts" href="{{ .Next.URL }}">{{T "Next-Pages"}} →</a>
themes/docdock/layouts/partials/language-selector.html: <option id="{{ $translation.Language }}" value="{{ $translation.URL }}" selected>{{ .LanguageName }}</option>
themes/docdock/layouts/partials/language-selector.html: <option id="{{ $translation.Language }}" value="{{ $translation.URL }}">{{ .LanguageName }}</option>
themes/docdock/layouts/partials/original/body-beforecontent.html: <a href="{{.URL}}" target="_blank" rel="noopener">{{safeHTML .Name}}</a>
themes/docdock/layouts/partials/original/body-beforecontent.html:{{$value := (printf "<a href='%s'>%s</a> > %s" .page.Parent.URL .page.Parent.Title .value)}}
themes/docdock/layouts/partials/menu.html: <li data-nav-id="{{.URL}}" class="dd-item
themes/docdock/layouts/partials/menu.html: {{- if eq .URL $currentNode.URL}} active{{end}}
themes/docdock/layouts/partials/menu.html: <li data-nav-id="{{.URL}}" class="dd-item
themes/docdock/layouts/partials/menu.html: {{- if eq .URL $currentNode.URL}} active{{end -}}
themes/docdock/layouts/partials/breadcrumb.html:{{$value := (printf "<a href='%s'>%s</a> > %s" .page.Parent.URL .page.Parent.Title .value)}}
themes/docdock/layouts/partials/flex/selectnavigation.html: <option value="{{ .RelPermalink}}" {{if eq .URL $currentNode.URL}} selected{{end}}>
themes/docdock/layouts/partials/flex/selectnavigation.html: <option value="{{ .RelPermalink}}" {{if eq .URL $currentNode.URL}} selected{{end}}>
themes/docdock/layouts/partials/flex/body-beforecontent.html: <a href="{{.URL}}" {{if eq $.Site.Params.menushortcutsnewtab true}}target="_blank"{{end}} rel="noopener">
DBJDBJ
June 19, 2019, 3:51pm
7
Ok thanks I can do it localy no problem … although might help if you tell me what href exactly to change to what ? I assume “.URL” is no good?
or should I just switch back to the HUGO learn theme whis we see has only very slight problem with page parameters.
Can I now ask how to change the logo.html and see the changes, eventually?
zwbetz
June 19, 2019, 3:55pm
8
I’d do one thing at a time. So if you look at the warning message you pasted in your original post, it tells you how to fix it.
Page’s .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.
DBJDBJ
June 19, 2019, 4:02pm
9
First, I switched back to the HUGO Learn theme and voila, logo.html change is appearing. And href indeed works … that file is now:
<a id="logo" href="{{ $.Params.url }}">
<!-- img
src="https://dbj.systems/wp-content/uploads/2016/08/dbj-system-icon-graphite--e1473578025484.jpg"
width="100%"
/ -->
<strong>DBJ.Systems</strong>
</a>
Next I will fix these two:
themes/learn/layouts/partials/footer.html: <a class="nav nav-next" href="{{.URL}}" title="{{.Title}}" style="margin-right: 0px;"><i class="fa fa-chevron-right"></i></a>
themes/learn/layouts/partials/header.html: {{ $value := (printf "<a href='%s'>%s</a> > %s" $parent.URL $parent.Title .value) }}
Did I understood correclty {{ .Params.url }} should be {{ .Permalink }} ?
Please bear in mind terminology is the core problem here for me.
zwbetz
June 19, 2019, 4:07pm
10
Kinda. So any occurrence of .URL
should be replaced with one of the following, whichever is your preference.
.RelPermalink
.Permalink
.Params.url (probably not what you want)
DBJDBJ
June 19, 2019, 4:16pm
11
Thanks again … Please send me the link where I can resolve my terminology issues on this subject ? While I run through basics of hu(go) templates.
ps: corrected site (with hugo learn theme) is published
https://dbj-kb.onrender.com/en
zwbetz
June 19, 2019, 4:24pm
12
Sure. The Hugo Docs have a nice search feature. Just enter each of those terms into the search bar and read up
1 Like