add title for each pages
All checks were successful
continuous-integration/drone/push Build is passing

Closes #7
This commit is contained in:
Dmitriy Pleshevskiy 2023-02-03 03:09:57 +03:00
parent 84a4377853
commit 491f0cded5
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215
6 changed files with 9 additions and 1 deletions

View file

@ -1,6 +1,7 @@
import { Translations } from "./translates/rus.ts"; import { Translations } from "./translates/rus.ts";
export interface Context { export interface Context {
title?: string;
locPath: string; locPath: string;
lang: Lang; lang: Lang;
tr: Translations; tr: Translations;

View file

@ -10,7 +10,7 @@ export function Layout(ctx: Context, page: AnyNode): AnyNode {
content: "width=device-width, initial-scale=1", content: "width=device-width, initial-scale=1",
}), }),
E("link", { rel: "stylesheet", href: "/styles/main.css" }), E("link", { rel: "stylesheet", href: "/styles/main.css" }),
E("title", [], "Pleshevski"), E("title", [], ctx.title ?? "Pleshevski"),
]), ]),
E("body", [], [ E("body", [], [
E("div", { id: "root" }, [page]), E("div", { id: "root" }, [page]),

View file

@ -4,6 +4,8 @@ import { classNames } from "ren/attrs.ts";
import { Context } from "../../context.ts"; import { Context } from "../../context.ts";
export function ContentPage(ctx: Context, content: AnyNode): AnyNode { export function ContentPage(ctx: Context, content: AnyNode): AnyNode {
ctx.title = "About | Pleshevski";
return PageLayout(ctx, [ return PageLayout(ctx, [
E("div", classNames("content-width responsive-typography"), [content]), E("div", classNames("content-width responsive-typography"), [content]),
]); ]);

View file

@ -5,6 +5,8 @@ import { Context } from "../../context.ts";
import { H3 } from "../uikit/typo.ts"; import { H3 } from "../uikit/typo.ts";
export function E404Page(ctx: Context): AnyNode { export function E404Page(ctx: Context): AnyNode {
ctx.title = "Not Found - 404 | Pleshevski";
return PageLayout(ctx, [E404(ctx)]); return PageLayout(ctx, [E404(ctx)]);
} }

View file

@ -5,6 +5,8 @@ import { Context } from "../../context.ts";
import { H3 } from "../uikit/typo.ts"; import { H3 } from "../uikit/typo.ts";
export function E500Page(ctx: Context): AnyNode { export function E500Page(ctx: Context): AnyNode {
ctx.title = "Internal Server Error - 500 | Pleshevski";
return PageLayout(ctx, [E500(ctx)]); return PageLayout(ctx, [E500(ctx)]);
} }

View file

@ -10,6 +10,7 @@ const td = E.bind(null, "td", []);
const th = E.bind(null, "th", []); const th = E.bind(null, "th", []);
export function WorksPage(ctx: Context, content: AnyNode): AnyNode { export function WorksPage(ctx: Context, content: AnyNode): AnyNode {
ctx.title = "Works | Pleshevski";
return PageLayout(ctx, [ return PageLayout(ctx, [
E("div", classNames("content-width gap-v-1x5 responsive-typography"), [ E("div", classNames("content-width gap-v-1x5 responsive-typography"), [
content, content,