diff options
Diffstat (limited to 'src/server/template/Page.ts')
-rw-r--r-- | src/server/template/Page.ts | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/server/template/Page.ts b/src/server/template/Page.ts new file mode 100644 index 0000000..ec76e97 --- /dev/null +++ b/src/server/template/Page.ts @@ -0,0 +1,23 @@ +import Base, { BaseI, content } from "./Base.js" +import h from "./header.js" +import { article } from "./html.js" +import { c, node } from "./vdom.js" + +export interface PageI<T extends node = node> extends BaseI<T> { + title: string +} + +export default function Page<Type extends PageI>(data: Type): ReturnType<typeof Base<Type>> { + const arg = { + ...data, + content() { + var { title } = this + return c(article, {}, + c(h, { level: 1 }, title), + c(content, { data }) + ) + } + + } + return Base(arg) +}
\ No newline at end of file |