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.
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
- Node.js 14.x or higher
- npm or yarn
- Clone the repository:
git clone https://github.com/herd-mentality/hm_blog.git
cd hm_blog- Install dependencies:
npm install- Run the development server:
npm run dev- Open http://localhost:3000 in your browser
The site will auto-reload as you make changes!
Built with modern web technologies and best practices:
- 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
- π 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
- π» 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-friendly with RSS feeds and sitemaps
- π Analytics support (Plausible, Simple Analytics, Google Analytics)
- π Preconfigured security headers
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
data/siteMetadata.js- Site metadata (title, description, social links, etc.)data/headerNavLinks.ts- Navigation menu linkstailwind.config.js- Tailwind CSS theme customizationcss/tailwind.css- Global styles and color schemescss/prism.css- Code block syntax highlighting themenext.config.js- Next.js configuration and Content Security Policy
The site uses Tailwind CSS for styling. To customize the look:
- Modify colors in
tailwind.config.js - Update global styles in
css/tailwind.css - Change code block themes by editing
css/prism.css(or use Prism themes)
components/InPostComponents.tsx- Custom blog post components (<Caption>,<Highlight>)components/MDXComponents.tsx- Maps HTML elements to custom React componentscomponents/social-icons/- Social media icons (add more from Simple Icons)
npm run dev # Start development server
npm run build # Build for production
npm start # Start production server
npm run analyze # Analyze bundle sizeThe blog is deployed on Vercel, which provides seamless integration with Next.js:
- Push your changes to the main branch
- Vercel automatically builds and deploys
- 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.
- Sheep icon: From IconScout by Icograms (color modified to #A5A5A5)
- Favicons: Generated via favicon.io
Ongoing development and feature planning tracked on Trello
This blog is built on the excellent Tailwind Next.js Starter Blog template by Timothy Lin.
MIT Β© Timothy Lin
Built with π by the Herd Mentality team