A modern, customizable directory/blog template built with Next.js, MDX, and shadcn/ui. Perfect for creating content-driven websites, directories, portfolios, blogs, or educational content collections like stories, articles, and guides.
This boilerplate provides a flexible foundation for organizing and presenting content with built-in search, filtering, and responsive design. Whether you're building a company directory, blog, educational resource, or content showcase, this template offers the tools you need to get started quickly.
- π 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 (great for podcasts, stories, etc.)
- π·οΈ Tag System - Organize content with tags and categories
- β‘ Fast Page Loads - Static site generation for optimal performance
- π― SEO Optimized - Built-in SEO best practices
- π§ Highly Configurable - Easy configuration through a single config file
- π Multi-Content Types - Support for different content categories (stories, articles, posts, etc.)
This boilerplate is perfect for:
- Educational Content - Story collections, lesson libraries, course materials
- Company Directories - Team member profiles, service catalogs, resource libraries
- Blogs & Magazines - Personal blogs, company blogs, digital magazines
- Portfolio Sites - Project showcases, case studies, work samples
- Documentation Sites - API docs, user guides, knowledge bases
- Content Libraries - Article collections, research papers, media libraries
- 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/rohanpatriot/nextjs-directory-boilerplate
-
Install dependencies:
npm install
-
Run the development server:
npm run dev
-
Open http://localhost:3000 to see your site
-
Start customizing:
- Replace the example content in
src/content/
with your own MDX files - Update
src/config/directory.config.ts
with your site information - Modify the styling and components to match your brand
- Replace the example content in
Out of the box, you'll have a fully functional content directory with:
- A clean, responsive homepage with search and filtering
- Individual content pages with rich formatting
- Tag-based content organization
- Mobile-friendly responsive design
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 (src/config)
β βββ directory.config.ts
βββ content/ # MDX content files (src/content)
βββ 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 |
virtue | No | Key lesson or takeaway (custom field example) |
Note: You can add custom fields to the frontmatter as needed. The
virtue
field shown above is an example of how you can extend the metadata for specific content types.
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.
This project is released under the MIT License.