feat: add Markdown cut link to footer and page for improved accessibility
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import Image from 'next/image';
|
||||
import Link from 'next/link';
|
||||
import {useRouter} from 'next/router';
|
||||
import {WIKI_URI} from '../../lib/constants';
|
||||
import logo from '../../../public/assets/logo.svg';
|
||||
|
||||
@@ -7,6 +8,10 @@ import logo from '../../../public/assets/logo.svg';
|
||||
*
|
||||
*/
|
||||
export default function Footer() {
|
||||
const router = useRouter();
|
||||
const path = (router.asPath || '/').split(/[?#]/)[0];
|
||||
const trimmed = path === '/' ? '/' : path.replace(/\/$/, '');
|
||||
const mdHref = `${trimmed}.md`;
|
||||
return (
|
||||
<>
|
||||
<footer className={'border-t border-neutral-200 bg-white'}>
|
||||
@@ -263,8 +268,15 @@ export default function Footer() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="mt-16 border-t border-neutral-200 pt-8">
|
||||
<div className="mt-16 flex flex-col gap-2 border-t border-neutral-200 pt-8 sm:flex-row sm:items-center sm:justify-between">
|
||||
<p className="text-sm text-neutral-500">© {new Date().getFullYear()} Plunk. All rights reserved.</p>
|
||||
<p style={{fontFamily: 'var(--font-mono)'}} className="text-[11px] text-neutral-400">
|
||||
Reading this with electronic eyes? Append{' '}
|
||||
<a href={mdHref} className="text-neutral-500 underline decoration-dotted underline-offset-2 transition hover:text-neutral-900">
|
||||
<code>.md</code>
|
||||
</a>{' '}
|
||||
to any URL for the Markdown cut.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
@@ -26,6 +26,13 @@ export default async function Page(props: {params: Promise<{slug?: string[]}>})
|
||||
markdownUrl={`/llms.mdx${page.url}`}
|
||||
githubUrl={`https://github.com/useplunk/plunk/blob/next/apps/wiki/content/docs/${page.path}`}
|
||||
/>
|
||||
<p className="ml-auto hidden text-[11px] text-fd-muted-foreground sm:block">
|
||||
Reading this with electronic eyes? Add{' '}
|
||||
<a href={`${page.url}.md`} className="underline decoration-dotted underline-offset-2 transition hover:text-fd-foreground">
|
||||
<code>.md</code>
|
||||
</a>{' '}
|
||||
for the Markdown cut.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<DocsBody>
|
||||
|
||||
Reference in New Issue
Block a user