Dollar sign ($) variable is used to refer to variable in the global scope.
Assuming you are editing template in layouts/_default/single.html
.Title
and$.Title
will refer to current page title.- When you are in a loop of
range .Site.Pages
,.Title
will refer each.Site.Pages
title, while$.Title
still refer to current page title.
<pre>
CurrentPageTitle={{ .Title }}
CurrentPageTitle={{ $.Title }}
{{ range .Site.Pages }}
Title={{ .Title }} - CurrentPageTitle={{ $.Title }}
{{ end }}
</pre>