[docs][m]: refactor to have a common layout component for all pages and a common prose layout within that for "prose" docs (everything other than front page) - refs #559.

This commit is contained in:
Rufus Pollock
2021-06-15 19:24:12 +02:00
parent cd6c81e44b
commit 73bc3d1761
10 changed files with 127 additions and 169 deletions

View File

@@ -1,15 +0,0 @@
export default function Footer() {
return (
<footer className="flex items-center justify-center w-full h-24 border-t">
<a
className="flex items-center justify-center"
href="https://datopian.com/"
target="_blank"
rel="noopener noreferrer"
>
Built by{' '}
<img src="/datopian-logo.png" alt="Datopian Logo" className="h-6 ml-2" />
</a>
</footer>
)
}

35
docs/components/layout.js Normal file
View File

@@ -0,0 +1,35 @@
import Link from 'next/link'
import Head from 'next/head'
import Nav from '../components/Nav'
export default function Layout({
children,
title = 'Portal.JS',
}) {
return (
<div>
<Head>
<title>{title}</title>
<link rel="icon" href="/favicon.ico" />
<meta charSet="utf-8" />
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
</Head>
<Nav />
{children}
<footer className="flex items-center justify-center w-full h-24 border-t">
<a
className="flex items-center justify-center"
href="https://datopian.com/"
target="_blank"
rel="noopener noreferrer"
>
Built by{' '}
<img src="/datopian-logo.png" alt="Datopian Logo" className="h-6 ml-2" />
</a>
</footer>
</div>
)
}

13
docs/components/prose.js Normal file
View File

@@ -0,0 +1,13 @@
export default function Prose({
children,
mdFile=null
}) {
return (
<main className="prose mx-auto my-24">
{mdFile &&
<div dangerouslySetInnerHTML={{ __html: mdFile }} />
}
{children}
</main>
)
}