function uniqueSlugFromBase
uniqueSlugFromBase<Index extends string>(opts: { base: string; computeIndex: ComputeIndex<Index>; isTaken: IsTaken; }): Promise<SlugWithIndex<Index>>

Make a deterministic base slug unique by appending -2, -3, … until one is free. Unlike generateUniqueSlug (random 5-char slugs), this keeps a human-readable base — the news permalink yyyy-MM-dd-post-name — and only disambiguates on collision (two same-day posts with the same name).

Type Parameters

Index extends string

Parameters

opts: { base: string; computeIndex: ComputeIndex<Index>; isTaken: IsTaken; }

Return Type

Usage

import { uniqueSlugFromBase } from "docs/utilities.ts";