Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

herd-mentality/hm_blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

266 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🐏 The Herd Mentality Blog

Welcome to the Herd Mentality blog repository! This is where we share our technical insights, tutorials, and experiences in data science, software engineering, and cloud technologies.

demo

πŸ“ Contributing

Want to write for the blog? Check out our Contributing Guide for detailed instructions on:

  • Adding new blog posts
  • Creating author profiles
  • Using custom components
  • Image management
  • Best practices and style guidelines

πŸš€ Quick Start

Prerequisites

  • Node.js 14.x or higher
  • npm or yarn

Installation

  1. Clone the repository:
git clone https://github.com/herd-mentality/hm_blog.git
cd hm_blog
  1. Install dependencies:
npm install
  1. Run the development server:
npm run dev
  1. Open http://localhost:3000 in your browser

The site will auto-reload as you make changes!

πŸ—οΈ Tech Stack & Features

Built with modern web technologies and best practices:

Core Framework

  • Next.js - React framework with SSR and static generation
  • TypeScript - Type-safe JavaScript
  • Tailwind CSS 3.0 - Utility-first CSS framework
  • MDX - Write JSX in markdown documents

Content Features

  • πŸ“ Multiple author support
  • 🏷️ Tag-based organization (each tag gets its own page)
  • πŸ”’ Table of contents generation
  • πŸ“Š Math display via KaTeX
  • πŸ“š Citation and bibliography support via rehype-citation
  • 🎨 Custom React components in blog posts
  • πŸ—‚οΈ Nested routing for blog posts

Development Features

  • πŸ’» Server-side syntax highlighting with line numbers (rehype-prism-plus)
  • πŸ–ΌοΈ Automatic image optimization via next/image
  • πŸŒ“ Light and dark theme
  • πŸ“± Fully responsive design
  • ⚑ Lightweight (45kB first load JS)
  • 🎯 Near-perfect Lighthouse scores

SEO & Analytics

  • πŸ” SEO-friendly with RSS feeds and sitemaps
  • πŸ“ˆ Analytics support (Plausible, Simple Analytics, Google Analytics)
  • πŸ”’ Preconfigured security headers

πŸ“ Project Structure

Key directories and files:

my-blog/
β”œβ”€β”€ components/          # React components
β”‚   β”œβ”€β”€ InPostComponents.tsx  # Custom components for blog posts
β”‚   β”œβ”€β”€ MDXComponents.tsx     # MDX component mappings
β”‚   └── ...
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ blog/           # Blog posts (.mdx files)
β”‚   β”œβ”€β”€ authors/        # Author profiles
β”‚   β”œβ”€β”€ siteMetadata.js # Site configuration
β”‚   └── headerNavLinks.ts
β”œβ”€β”€ layouts/            # Page layout templates
β”œβ”€β”€ pages/              # Next.js pages and routing
β”œβ”€β”€ public/
β”‚   └── static/
β”‚       └── images/     # Blog post images
β”œβ”€β”€ css/                # Global styles and themes
└── contentlayer.config.ts

🎨 Customization

Key Configuration Files

  • data/siteMetadata.js - Site metadata (title, description, social links, etc.)
  • data/headerNavLinks.ts - Navigation menu links
  • tailwind.config.js - Tailwind CSS theme customization
  • css/tailwind.css - Global styles and color schemes
  • css/prism.css - Code block syntax highlighting theme
  • next.config.js - Next.js configuration and Content Security Policy

Styling

The site uses Tailwind CSS for styling. To customize the look:

  1. Modify colors in tailwind.config.js
  2. Update global styles in css/tailwind.css
  3. Change code block themes by editing css/prism.css (or use Prism themes)

Components

  • components/InPostComponents.tsx - Custom blog post components (<Caption>, <Highlight>)
  • components/MDXComponents.tsx - Maps HTML elements to custom React components
  • components/social-icons/ - Social media icons (add more from Simple Icons)

πŸ› οΈ Available Scripts

npm run dev          # Start development server
npm run build        # Build for production
npm start            # Start production server
npm run analyze      # Analyze bundle size

🚒 Deployment

The blog is deployed on Vercel, which provides seamless integration with Next.js:

  1. Push your changes to the main branch
  2. Vercel automatically builds and deploys
  3. Visit your live site!

For other deployment platforms (Netlify, GitHub Pages, etc.), see the Next.js deployment documentation.

Note

The site uses next/image for automatic image optimization. If deploying to static hosting platforms, you may need to configure an alternative image optimization provider.

πŸ“‹ Development Notes

Design Assets

Development Tracking

Ongoing development and feature planning tracked on Trello

πŸ™ Credits

This blog is built on the excellent Tailwind Next.js Starter Blog template by Timothy Lin.

πŸ“„ License

MIT Β© Timothy Lin


Built with 🐏 by the Herd Mentality team

Releases

No releases published

Packages

No packages published

Contributors 5