28 lines
1.3 KiB
TypeScript
28 lines
1.3 KiB
TypeScript
/* ═══════════════════════════════════════════════════════════════
|
|
SITE VERSION: src/lib/version.ts
|
|
|
|
One string, bumped by hand when the working directory name
|
|
changes. Read by the admin's footer and home, and the site's
|
|
footer.
|
|
|
|
Each version has a name, Minecraft style: the tag's words after
|
|
the number, "v1.13.2-region-cards" → "The Region Cards Update".
|
|
A version with no words after its number has no name.
|
|
═══════════════════════════════════════════════════════════════ */
|
|
|
|
export const SITE_VERSION = "NGU-Web.v1.14.0-profiles";
|
|
|
|
/** The number, eg. v1.13.2. */
|
|
export const VERSION_NUMBER: string = SITE_VERSION.match(/v\d+(?:\.\d+)*/)?.[0] ?? SITE_VERSION
|
|
|
|
/** The version's name from its tag, eg. The Region Cards Update, or null. */
|
|
export const VERSION_NAME: string | null = (() => {
|
|
const words = SITE_VERSION.match(/v\d+(?:\.\d+)*-(.+)$/)?.[1]
|
|
if (!words) return null
|
|
const title = words
|
|
.split('-')
|
|
.filter(Boolean)
|
|
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
.join(' ')
|
|
return `The ${title} Update`
|
|
})()
|