Add ability to display author on header

This commit is contained in:
Foster Hangdaan 2023-08-05 17:30:41 -04:00
parent 0101221ea8
commit 81da5bf68c
Signed by: foster
GPG key ID: E48D7F49A852F112
2 changed files with 6 additions and 2 deletions

View file

@ -1,6 +1,9 @@
export interface Props { export interface Props {
title: string; title: string;
description?: string; description?: string;
author?: {
name: string;
};
comp: any; comp: any;
} }
@ -8,6 +11,7 @@ export default function(props: Props) {
return ( return (
<header className="page-header"> <header className="page-header">
<h1>{ props.title }</h1> <h1>{ props.title }</h1>
{props.author && <p>By {props.author.name}</p>}
{props.comp.separator()} {props.comp.separator()}
<p className="subheading">{ props.description }</p> <p className="subheading">{ props.description }</p>
</header> </header>

View file

@ -1,4 +1,4 @@
export default function({ title, description, children, comp, metas, links }) { export default function({ title, description, children, comp, metas, links, author }) {
return ( return (
<html lang="en-CA"> <html lang="en-CA">
<head> <head>
@ -25,7 +25,7 @@ export default function({ title, description, children, comp, metas, links }) {
</head> </head>
<body> <body>
{ comp.navbar() } { comp.navbar() }
{ comp.header({title, description}) } { comp.header({title, description, author}) }
<main>{children}</main> <main>{children}</main>
{ comp.footer() } { comp.footer() }
</body> </body>