mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-02-06 20:10:56 -05:00
20 lines
600 B
TypeScript
20 lines
600 B
TypeScript
|
|
import fs from 'fs';
|
|
import path from 'path';
|
|
import MarkdownPage from "web/components/markdown";
|
|
|
|
const FILENAME = __filename.split('/').pop()?.split('.').shift();
|
|
|
|
export async function getStaticProps() {
|
|
const filePath = path.join(process.cwd(), 'public', 'md', FILENAME + '.md');
|
|
const content = fs.readFileSync(filePath, 'utf8');
|
|
return {props: {content}};
|
|
}
|
|
|
|
type Props = { content: string };
|
|
|
|
export default function Faq({content}: Props) {
|
|
if (!FILENAME) throw new Error('Could not determine filename');
|
|
return <MarkdownPage content={content} filename={FILENAME}></MarkdownPage>
|
|
}
|