Skip to content

Latest commit

 

History

History
149 lines (102 loc) · 3.74 KB

File metadata and controls

149 lines (102 loc) · 3.74 KB

CG Blog 🎨

image

Minimalist React blog engine with first-class RTL support. Your content, any hosting, no lock-in.

License: MIT

Features

🔁 Auto RTL Article switching (Arabic/Urdu/Persian ready)
🌐 Server-side rendering (React Router 7)
📡 Remote markdown content from any URL
♾️ Infinite scroll with loading states
🖼️ Graceful fallbacks for missing data
🌗 Built-in dark mode (Shadcn/ui)

Get Started in 4 Steps

  1. Clone:
git clone https://github.com/Creative-Geek/cg-blog.git
  1. Create Content:
  • Copy the template folder contents to a new folder and edit the content.

  • Set a build command:

    node generate-index.js
  • Deploy to any static serving service.

  1. Configure via environment variables:

Create a .env file or set these in your deployment platform (Vercel, Netlify, Cloudflare Pages):

# Required: URL where your content is hosted
VITE_BASE_URL=https://your-content.pages.dev

# Your name/site name (default: "Creative Geek")
VITE_NAME=Your Name

# Optional: External resume URL (Google Drive, etc.)
# Leave empty to use BASE_URL/Pages/resume.pdf
VITE_RESUME_URL=

# Check if resume.pdf exists at BASE_URL (default: false)
VITE_CHECK_RESUME_EXISTS=true

# Use cover image instead of animated background (default: false)
VITE_USE_COVER_IMAGE=false

See .env.example for all available options.

  1. Launch:
pnpm install

Development with production content:

pnpm dev

This uses the VITE_BASE_URL from your .env file (pointing to your production/deployed content server).

Development with local content:

pnpm dev:full

This starts both:

  • A local content server at http://localhost:4000 serving your local content directory
  • The dev server at http://localhost:3000 configured to use the local content

By default, it serves from ../CG-Blog-Articles relative to the project. You can modify .env.fulldev or the script arguments to change the content directory.

Deploy the project to your vercel account:

Deploy with Vercel

Content Structure Template

Content Server/
├── Articles/
│   ├── my-post.md     # Article content in markdown
│   ├── my-post.json   # Article metadata
│   └── my-post.jpg    # Optional cover image
└── Pages/
    ├── about.md       # Static page content
    └── about.json     # Page metadata

Article JSON Format

{
  "title": "Your Article Title",
  "image": "optional-cover.jpg",
  "description": "A brief description of your article",
  "date": "DD MMM YYYY",
  "author": "Author Name"
}

Page JSON Format

{
  "title": "Page Title"
}

Hosting Strategies

  • Frontend: Deploy this repo to Vercel/Netlify/Github Pages
  • Content: Host MD files on GitHub/S3/Cloudflare
    Edits appear live without redeploys, only new articles need to be added to index using the build command

Why CG Blog?

  • 🕋 Providing real RTL support to markdown content.
  • 🚀 Content lives separately - no CMS wars
  • 🧩 Tested with 100+ articles (stress-free scroll)
# Rebuild search index when adding content
node generate-index.js

Contribute

Help us improve:

  • Develop Git-based CMS adapter
  • Provide feedback!

License: MIT