How to get the current url in Hugo

{{ trim .Page.RelPermalink "/"}}

This is the result:

yoursite.com/ebooks -> "ebooks"
yoursite.com/ebooks/php -> "ebooks/php"

Download my free Programming Ebooks!