A modern, customizable directory/blog template built with Next.js, MDX, and shadcn/ui. Perfect for creating content-driven websites, directories, portfolios, or blogs.
- 📝 MDX Support - Write content using Markdown with JSX components
- 🎨 Customizable Design - Built with Tailwind CSS and shadcn/ui
- 🔍 Search & Filtering - Built-in content search and tag filtering
- 📱 Responsive Layout - Mobile-first design approach
- 🖼️ Image Optimization - Automatic image optimization with Next.js
- 🎵 Audio Support - Optional audio player for content
- 🏷️ Tag System - Organize content with tags
- ⚡ Fast Page Loads - Static site generation for optimal performance
- 🎯 SEO Optimized - Built-in SEO best practices
- Framework: Next.js 14
- Styling: Tailwind CSS
- UI Components: shadcn/ui
- Content: MDX
- Typography: Google Fonts (Cormorant Garamond & Nunito)
-
Clone this repository:
git clone https://github.com/huntsyea/nextjs-directory-boilerplate/
-
Install dependencies:
npm install
-
Run the development server:
npm run dev
-
Open http://localhost:3000 to see your site
src/
├── app/ # Next.js app directory
│ ├── content/ # Content page routes
│ ├── stories/ # Story page routes
│ ├── tags/ # Tag page routes
│ ├── layout.tsx # Root layout component
│ ├── not-found.tsx # 404 page component
│ └── page.tsx # Home page
├── components/ # React components
│ ├── layout/ # Layout components
│ ├── ui/ # UI components
│ ├── AudioPlayer.tsx # Audio player component
│ ├── ErrorBoundary.tsx # Error boundary component
│ ├── Navbar.tsx # Navbar component
│ ├── Pagination.tsx # Pagination component
│ ├── Search/ # Search components
│ ├── Search.tsx # Search component
│ ├── summaryCard.tsx # Summary card component
│ └── TagFilter.tsx # Tag filter component
├── config/ # Site configuration
│ └── directory.config.ts
├── content/ # MDX content files
├── lib/ # Utility functions
│ ├── content.ts # Content management
│ ├── metadata.ts # Metadata generation
│ ├── posts.ts # Post management
│ └── utils.ts # Utility functions
├── stories/ # MDX story files
├── types/ # TypeScript types
│ └── content.ts
└── app/globals.css # Global styles
Content is written in MDX format with frontmatter metadata. Create new .mdx
files in the src/content
directory:
---
title: 'Example Post'
topic: 'Topic'
image: '/image.png'
summary: "Brief summary"
tags: ['tag1', 'tag2']
date: '2024-01-01'
author: 'Author Name'
---
Content goes here...
Field | Required | Description |
---|---|---|
title | Yes | Content title |
topic | No | Content topic/category |
image | No | Featured image path |
summary | No | Brief content summary |
tags | No | Array of related tags |
date | No | Publication date |
author | No | Content author |
audioUrl | No | URL to associated audio file |
Modify src/config/directory.config.ts
to customize site-wide settings:
export const directoryConfig: DirectoryConfig = {
name: 'Your Site Name',
description: 'Your site description',
itemsPerPage: 9,
features: {
audio: true,
images: true,
tags: true,
search: true,
pagination: true,
},
theme: {
fontHeading: 'Your_Heading_Font',
fontBody: 'Your_Body_Font',
},
};
- Global styles:
src/app/globals.css
- Tailwind config:
tailwind.config.ts
- Component styles: Individual component files using Tailwind classes
- Create new components in
src/components
- Modify existing components to match your needs
- Use shadcn/ui components for consistent styling
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - feel free to use this template for any project.