A beautiful static blog using Next.js with markdown support.
- Clone the repository
- Install dependencies:
npm install
- Start the development server:
npm run dev
- Create a new
.md
file in the_posts
directory, the filename will be used as the slug for the post - Add the following frontmatter at the top of your markdown file:
--- title: "Your Post Title" date: "2024-10-24" excerpt: "A brief description of your post" image: "https://images.unsplash.com/photo-1488590528505-98d2b5aba04b?q=80&w=2070&auto=format&fit=crop" ---
- Write your post content in markdown below the frontmatter
The project includes a comprehensive test suite using Vitest and Testing Library:
-
Unit Tests: Test individual components and utilities
npm run test # Run tests npm run test:watch # Run tests in watch mode npm run coverage # Generate coverage report
-
E2E Tests: Test full user flows with Playwright
npm run test:e2e # Run e2e tests npm run test:e2e:ui # Run e2e tests with UI
__tests__/
: Unit testse2e/
: End-to-end tests
- All new features must include tests
- E2E tests for critical user flows
This project is configured for static exports, making it perfect for deployment on static hosting platforms.
- Build the static site:
npm run build
- The static site will be generated in the
out
directory - You can preview the built site locally:
npx serve out
When deploying to Vercel, the platform will automatically:
- Run
npm run build
to generate the static export - Optimize and serve the static files from the
out
directory - Enable instant static page serving through their global edge network
This project is configured for static site generation using Next.js's output: "export"
configuration.
When deploying to Vercel:
-
Connect your GitHub repository to Vercel:
- Go to Vercel
- Import your repository
- Vercel will automatically detect Next.js settings
-
Vercel automatically handles:
- Production deployments from the
master
branch - Preview deployments for all Pull Requests
- Instant rollbacks if needed
- Static file optimization and delivery through their global edge network
- Production deployments from the
The Vercel GitHub integration provides:
- Automatic deployments
- Preview deployments for PRs
- Deploy comments on PRs
- Branch protection rules
- Deploy statuses in GitHub
_posts/
: Markdown files for blog postsapp/
: Next.js app directorycomponents/
: UI componentslib/
: Utility functions and blog helpers
MIT