HUGO
Menu
GitHub 90498 stars Mastodon

Permalink

Returns the permalink of the given page.
Syntax
PAGE.Permalink
Returns
string

Usage

The Permalink method on a Page object returns the absolute URL of the given page. Hugo creates the URL path from the logical path of the page, the slug and url fields in front matter, and your project configuration.

Examples

Consider this project configuration:

baseURL: https://example.org/docs/
title: Documentation
baseURL = 'https://example.org/docs/'
title = 'Documentation'
{
   "baseURL": "https://example.org/docs/",
   "title": "Documentation"
}
{{ $page := site.GetPage "/about" }}
{{ $page.Permalink }} → https://example.org/docs/about/