Skip to content
duxt

useDuxtSiteUrl()

The configured origin, and paths made absolute.

Signature

const { origin, absolute } = useDuxtSiteUrl();

Returns

ValueTypeWhat it is
originstringThe site configured origin
absolutefunctionA path, made absolute against it

Notes

Needed wherever a URL leaves the page — a feed item, a canonical tag, an OG image. Inside the page, use a path.

Was this page helpful?