diff --git a/context.ts b/context.ts index adb6136..4404445 100644 --- a/context.ts +++ b/context.ts @@ -1,6 +1,7 @@ import { Translations } from "./translates/rus.ts"; export interface Context { + title?: string; locPath: string; lang: Lang; tr: Translations; diff --git a/views/comp/layout.ts b/views/comp/layout.ts index aac6e2d..c7ab48a 100644 --- a/views/comp/layout.ts +++ b/views/comp/layout.ts @@ -10,7 +10,7 @@ export function Layout(ctx: Context, page: AnyNode): AnyNode { content: "width=device-width, initial-scale=1", }), E("link", { rel: "stylesheet", href: "/styles/main.css" }), - E("title", [], "Pleshevski"), + E("title", [], ctx.title ?? "Pleshevski"), ]), E("body", [], [ E("div", { id: "root" }, [page]), diff --git a/views/pages/content.ts b/views/pages/content.ts index 4141f33..de41e61 100644 --- a/views/pages/content.ts +++ b/views/pages/content.ts @@ -4,6 +4,8 @@ import { classNames } from "ren/attrs.ts"; import { Context } from "../../context.ts"; export function ContentPage(ctx: Context, content: AnyNode): AnyNode { + ctx.title = "About | Pleshevski"; + return PageLayout(ctx, [ E("div", classNames("content-width responsive-typography"), [content]), ]); diff --git a/views/pages/e404.ts b/views/pages/e404.ts index 56cdb1b..bd224d6 100644 --- a/views/pages/e404.ts +++ b/views/pages/e404.ts @@ -5,6 +5,8 @@ import { Context } from "../../context.ts"; import { H3 } from "../uikit/typo.ts"; export function E404Page(ctx: Context): AnyNode { + ctx.title = "Not Found - 404 | Pleshevski"; + return PageLayout(ctx, [E404(ctx)]); } diff --git a/views/pages/e500.ts b/views/pages/e500.ts index 3a45b91..d3930e4 100644 --- a/views/pages/e500.ts +++ b/views/pages/e500.ts @@ -5,6 +5,8 @@ import { Context } from "../../context.ts"; import { H3 } from "../uikit/typo.ts"; export function E500Page(ctx: Context): AnyNode { + ctx.title = "Internal Server Error - 500 | Pleshevski"; + return PageLayout(ctx, [E500(ctx)]); } diff --git a/views/pages/works.ts b/views/pages/works.ts index 72f24d4..4baaa12 100644 --- a/views/pages/works.ts +++ b/views/pages/works.ts @@ -10,6 +10,7 @@ const td = E.bind(null, "td", []); const th = E.bind(null, "th", []); export function WorksPage(ctx: Context, content: AnyNode): AnyNode { + ctx.title = "Works | Pleshevski"; return PageLayout(ctx, [ E("div", classNames("content-width gap-v-1x5 responsive-typography"), [ content,