├── components ├── nav │ ├── index.js │ └── Nav.jsx ├── layout │ ├── index.js │ └── MainLayout.jsx ├── index.js └── resource │ ├── index.js │ ├── ResourceArticle.jsx │ ├── ResourceList.jsx │ └── ResourceCard.jsx ├── .eslintrc.json ├── utils ├── index.js ├── pick.js └── convertTime.js ├── public ├── favicon.ico └── authors │ └── hunter.jpeg ├── postcss.config.js ├── pages ├── index.js ├── api │ └── hello.js ├── _document.js ├── _app.js └── resources │ ├── index.js │ └── [slug].js ├── jsconfig.json ├── next.config.js ├── tailwind.config.js ├── .gitignore ├── package.json ├── README.md ├── contentlayer.config.js ├── content └── resources │ ├── my-second-resource.mdx │ └── my-first-resource.mdx └── styles └── globals.css /components/nav/index.js: -------------------------------------------------------------------------------- 1 | export * from './Nav'; 2 | -------------------------------------------------------------------------------- /components/layout/index.js: -------------------------------------------------------------------------------- 1 | export * from './MainLayout'; 2 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "next/core-web-vitals" 3 | } 4 | -------------------------------------------------------------------------------- /utils/index.js: -------------------------------------------------------------------------------- 1 | export * from './pick'; 2 | export * from './convertTime'; 3 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hunterbecton/next-js-mdx/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /components/index.js: -------------------------------------------------------------------------------- 1 | export * from './resource'; 2 | export * from './nav'; 3 | export * from './layout'; 4 | -------------------------------------------------------------------------------- /public/authors/hunter.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hunterbecton/next-js-mdx/HEAD/public/authors/hunter.jpeg -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /pages/index.js: -------------------------------------------------------------------------------- 1 | import { MainLayout } from 'components'; 2 | 3 | export default function Home() { 4 | return ; 5 | } 6 | -------------------------------------------------------------------------------- /components/resource/index.js: -------------------------------------------------------------------------------- 1 | export * from './ResourceArticle'; 2 | export * from './ResourceCard'; 3 | export * from './ResourceList'; 4 | -------------------------------------------------------------------------------- /utils/pick.js: -------------------------------------------------------------------------------- 1 | export const pick = (obj, keys) => { 2 | return keys.reduce((acc, key) => { 3 | acc[key] = obj[key]; 4 | return acc; 5 | }, {}); 6 | }; 7 | -------------------------------------------------------------------------------- /pages/api/hello.js: -------------------------------------------------------------------------------- 1 | // Next.js API route support: https://nextjs.org/docs/api-routes/introduction 2 | 3 | export default function handler(req, res) { 4 | res.status(200).json({ name: 'John Doe' }) 5 | } 6 | -------------------------------------------------------------------------------- /utils/convertTime.js: -------------------------------------------------------------------------------- 1 | export const convertTime = (time) => { 2 | return new Date(time).toLocaleDateString('en-us', { 3 | year: 'numeric', 4 | month: 'long', 5 | day: 'numeric', 6 | }); 7 | }; 8 | -------------------------------------------------------------------------------- /components/layout/MainLayout.jsx: -------------------------------------------------------------------------------- 1 | import { Nav } from 'components'; 2 | 3 | export const MainLayout = ({ children }) => { 4 | return ( 5 | <> 6 |