addContextToSlug

Function

Add a context (prefix) to slug if it doesn't already have one

  • addContextToSlug(slug: string, context: string) : string

Parameters

Parameter Type Default Notes
slug Required string

Hub API slug (with or without context)

context Required string

usually a portal's orgKey

Returns

slug with context ({context}::{slug})

string

Function defined in common/src/content/slugs.ts:45