MCPcopy Create free account
hub / github.com/anders-swanson/oracle-database-code-samples / buildCanonicalUrl

Function buildCanonicalUrl

website/src/lib/site.ts:17–20  ·  view source on GitHub ↗
(pathname = '/')

Source from the content-addressed store, hash-verified

15export const DEFAULT_OG_IMAGE_URL = `${SITE_URL}social-card.${SOCIAL_CARD_EXTENSION}`;
16
17export function buildCanonicalUrl(pathname = '/') {
18 const normalized = pathname.startsWith('/') ? pathname.slice(1) : pathname;
19 return new URL(normalized, SITE_URL).toString();
20}
21
22export function buildLanguagePath(slug: string) {
23 return `/languages/${slug}/`;

Callers

nothing calls this directly

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected