UNPKG

@x-govuk/govuk-eleventy-plugin

Version:

Write documentation using Markdown and publish it using GOV.UK styles

12 lines (11 loc) 320 B
/** * Remove (index).html from a string * * @see {@link https://www.w3.org/Provider/Style/URI.html} * @param {string} string - URL, i.e. /page/index.html * @returns {string} Permalink URL, i.e. /page/ */ export function pretty(string) { string = String(string) return string.replace(/(?:index)?\.html/g, '') }