[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:
@@ -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
35
docs/components/layout.js
Normal 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
13
docs/components/prose.js
Normal 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>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user