add title for each pages
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Closes #7
This commit is contained in:
parent
84a4377853
commit
491f0cded5
6 changed files with 9 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
import { Translations } from "./translates/rus.ts";
|
||||
|
||||
export interface Context {
|
||||
title?: string;
|
||||
locPath: string;
|
||||
lang: Lang;
|
||||
tr: Translations;
|
||||
|
|
|
@ -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]),
|
||||
|
|
|
@ -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]),
|
||||
]);
|
||||
|
|
|
@ -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)]);
|
||||
}
|
||||
|
||||
|
|
|
@ -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)]);
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue