HUGO
Menu
GitHub 90479 stars Mastodon

RelPermalink

Returns the relative permalink of the given page.
Syntax
PAGE.RelPermalink
Returns
string

Usage

The RelPermalink method on a Page object returns the server-relative 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.RelPermalink }} → /docs/about/