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 {
title: string;
description?: string;
author?: {
name: string;
};
comp: any;
}
@ -8,6 +11,7 @@ export default function(props: Props) {
return (
<header className="page-header">
<h1>{ props.title }</h1>
{props.author && <p>By {props.author.name}</p>}
{props.comp.separator()}
<p className="subheading">{ props.description }</p>
</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 (
<html lang="en-CA">
<head>
@ -25,7 +25,7 @@ export default function({ title, description, children, comp, metas, links }) {
</head>
<body>
{ comp.navbar() }
{ comp.header({title, description}) }
{ comp.header({title, description, author}) }
<main>{children}</main>
{ comp.footer() }
</body>