commit 2c1f2adcf8a854cfd3353a887a224add2fc66824 Author: sup39 Date: Fri Nov 4 21:44:29 2022 +0900 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57ff971 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules/ +.next/ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c85a4d5 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 sup39 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..aa97380 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# supMDX +A template to make blog-like site with MDX + +## Configuration +- `supMDX.yml` diff --git a/components/Footer.tsx b/components/Footer.tsx new file mode 100644 index 0000000..da64091 --- /dev/null +++ b/components/Footer.tsx @@ -0,0 +1,10 @@ +import config from '#config'; + +export default function Footer() { + const {startYear: year0, siteAuthor} = config; + const year = new Date().getFullYear(); + + return ; +} diff --git a/components/MDXRoot.tsx b/components/MDXRoot.tsx new file mode 100644 index 0000000..c83be36 --- /dev/null +++ b/components/MDXRoot.tsx @@ -0,0 +1,35 @@ +import Head from 'next/head'; +import Nav from './Nav'; +import MetaInfo from './MetaInfo'; +import type {HeadingInfo} from '@sup39/rehype-mdx-export-headings'; + +export type MDXProps = { + children: JSX.Element + data: { + pathname: string, + }, + meta: Partial<{ + title: string + description: string + h1: string + [key: string]: any + }> + headings: HeadingInfo[] +}; + +export default function MDXRoot({children, data: {pathname}, meta={}, headings}: MDXProps) { + const {title, description} = meta; + const h1 = meta.h1 ?? title; + return <> + + {title} + {description && } + +