pleshevski.ru/context.ts
Dmitriy Pleshevskiy 491f0cded5
All checks were successful
continuous-integration/drone/push Build is passing
add title for each pages
Closes #7
2023-02-03 03:09:57 +03:00

25 lines
461 B
TypeScript

import { Translations } from "./translates/rus.ts";
export interface Context {
title?: string;
locPath: string;
lang: Lang;
tr: Translations;
}
export function getLangHref(lang: Lang, url: string): string {
return getLangUrlPrefix(lang) + url;
}
export function getLangUrlPrefix(lang: Lang): string {
return `/${lang}`;
}
export function iterLangs(): Lang[] {
return [Lang.Eng, Lang.Rus];
}
export enum Lang {
Rus = "rus",
Eng = "eng",
}