A Next.js application that renders GitHub README content in a Medium-style blog format. This project can fetch and display README files from GitHub repositories, handling various content types including text, images, and embedded videos.
- Renders markdown content in a clean, blog-style layout
- Supports various content types:
- Headings
- Paragraphs
- Images (including SVGs)
- YouTube video embeds
- Optimized image loading using Next.js Image component
- Responsive design
- TypeScript support
- Tailwind CSS styling
- Node.js 16.8 or later
- npm or yarn
- Clone the repository:
git clone [repository-url]
cd [project-name]
- Install dependencies:
npm install
# or
yarn install
- Start the development server:
npm run dev
# or
yarn dev
src/
├── components/
│ └── Article.tsx
├── pages/
│ ├── _app.tsx
│ └── index.tsx
├── styles/
│ └── globals.css
└── types/
└── article.ts
The project is configured to handle GitHub images. Check next.config.ts
:
const nextConfig: NextConfig = {
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'github.com',
pathname: '/**',
}
],
dangerouslyAllowSVG: true,
contentDispositionType: 'attachment',
contentSecurityPolicy: "default-src 'self'; script-src 'none'; sandbox;",
},
};
Tailwind is configured with typography and aspect-ratio plugins. Check tailwind.config.ts
:
export default {
content: [
"./src/**/*.{js,ts,jsx,tsx,mdx}",
],
theme: {
extend: {
colors: {
background: "var(--background)",
foreground: "var(--foreground)",
},
},
},
plugins: [
require('@tailwindcss/typography'),
require('@tailwindcss/aspect-ratio'),
],
} satisfies Config;
The application expects README content in the following format:
interface ArticleData {
metadata: {
title: string;
repo: string;
lastUpdated: string;
};
content: {
sections: Array<{
type: string;
level?: number;
content?: string;
alt?: string;
url?: string;
dimensions?: {
width: number | null;
height: number | null;
} | null;
platform?: string;
embedUrl?: string;
}>;
};
}
- Fork the repository
- Create a new branch
- Make your changes
- Submit a pull request
- Add database integration
- Implement admin dashboard for managing repos
- Add caching mechanism
- Implement error boundaries
- Add loading states
- Add image zoom functionality