add title for each pages
continuous-integration/drone/push Build is passing Details

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";
export interface Context {
title?: string;
locPath: string;
lang: Lang;
tr: Translations;

View File

@ -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]),

View File

@ -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]),
]);

View File

@ -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)]);
}

View File

@ -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)]);
}

View File

@ -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,