The pagelink shortcode generates a link with a title, description, and icon to highlight related pages or external resources.

Basic usage #

Use named parameters to define the destination, title, description, and icon:

{{< pagelink href="/docs/latest/guides" title="Guides" description="Get started with Hudocs" icon="book-open" >}}
{{< pagelink href="https://gohugo.io/" title="Hugo Documentation" description="Official guides" >}}

Result #

GuidesGet started with Hudocs Hugo DocumentationOfficial Hugo guides

Parameters #

ParameterPositionTypeRequiredDescription
href0stringYesDestination path or external URL.
title1stringYesMain title of the link.
description2stringNoDescriptive text. Also accepts subtitle as an alias.
icon3stringNoName of a Meteor Icons icon.
rel4stringNoCustom value for the rel attribute.

The icon parameter is optional. If not specified, no icon is shown at the beginning.

For external links, the shortcode automatically displays an indicator on the right side. If a custom icon is also defined, both icons are displayed independently:

Hudocs GitHubView the source code

The shortcode delegates destination resolution to the resolve-link partial. For internal paths, resolve-link generates the URL corresponding to the active language. For external URLs, resolve-link determines the target and rel attributes applied to the link.

Validation #

The href and title parameters are required. If either is missing, Hugo stops the build and reports the missing parameter.

The description parameter is optional. If not provided, the card is displayed without descriptive text.