A modern, responsive tech blog built with Jekyll and Tailwind CSS, featuring search functionality, tags/categories, and GitHub Discussions-based comments.
- π¨ Modern Design: Clean, responsive design with Tailwind CSS
- π Full-Text Search: Client-side search powered by Lunr.js
- π·οΈ Tags & Categories: Organize posts with tags and categories
- π¬ Comments: GitHub Discussions integration via Giscus
- π± Mobile Responsive: Optimized for all device sizes
- β‘ Fast Loading: Static site generation with Jekyll
- π GitHub Pages Ready: Deploy directly to GitHub Pages
- Jekyll 4.x: Static site generator
- Tailwind CSS 3.x: Utility-first CSS framework
- Lunr.js: Client-side search engine
- Giscus: GitHub Discussions-based comments
- GitHub Pages: Hosting platform
- Ruby 2.7+ (for Jekyll)
- Node.js 16+ (for Tailwind CSS)
- Git
-
Clone the repository
git clone https://github.com/danieldai/danieldai.github.io.git cd danieldai.github.io
-
Install Ruby dependencies
bundle install
-
Install Node.js dependencies
npm install
-
Build Tailwind CSS
npm run build-css-prod
-
Start the development server
bundle exec jekyll serve
-
Open your browser Navigate to
http://localhost:4000
- Create a new file in
_posts/
with the format:YYYY-MM-DD-post-title.md
- Add front matter to your post:
---
layout: post
title: "Your Post Title"
date: 2024-01-15 10:00:00 +0000
categories: [Category1, Category2]
tags: [tag1, tag2, tag3]
author: "Your Name"
reading_time: 5
---
Your post content here...
- For development: Run
npm run build-css
to watch for changes - For production: Run
npm run build-css-prod
to build minified CSS
- Create
.html
or.md
files in the root directory - Add front matter:
---
layout: default
title: "Page Title"
permalink: /page-url/
---
Update the following settings in _config.yml
:
# Site information
title: "Your Blog Title"
description: "Your blog description"
author: "Your Name"
email: "your-email@example.com"
url: "https://yourusername.github.io"
baseurl: ""
# Navigation
navigation:
- title: "Home"
url: "/"
- title: "About"
url: "/about"
# Add more navigation items
- Enable GitHub Discussions on your repository
- Install Giscus app on your GitHub account
- Get your repository ID:
curl -H "Accept: application/vnd.github.v3+json" \ https://api.github.com/repos/yourusername/yourusername.github.io
- Get your category ID:
curl -H "Accept: application/vnd.github.v3+json" \ https://api.github.com/repos/yourusername/yourusername.github.io/discussions/categories
- Update
_config.yml
:giscus: repo: "yourusername/yourusername.github.io" repo_id: "YOUR_REPO_ID" category: "General" category_id: "YOUR_CATEGORY_ID" # ... other settings
-
Push to GitHub:
git add . git commit -m "Initial blog setup" git push origin main
-
Enable GitHub Pages:
- Go to repository Settings β Pages
- Select "Deploy from a branch"
- Choose "main" branch and "/ (root)" folder
- Save
-
Build CSS for production:
npm run build-css-prod git add assets/css/style.css git commit -m "Update CSS for production" git push origin main
- Add a
CNAME
file to the root directory with your domain - Configure DNS settings with your domain provider
- Update
url
in_config.yml
This blog is designed to work seamlessly on both Windows and macOS:
- Install Ruby using RubyInstaller
- Install Node.js from nodejs.org
- Use Git Bash or Windows Subsystem for Linux for terminal commands
- Install Ruby using Homebrew:
brew install ruby
- Install Node.js using Homebrew:
brew install node
- Use Terminal for all commands
danieldai.github.io/
βββ _config.yml # Jekyll configuration
βββ _layouts/ # Page layouts
β βββ default.html # Base layout
β βββ post.html # Blog post layout
β βββ home.html # Homepage layout
βββ _includes/ # Reusable components
β βββ header.html # Site header
β βββ footer.html # Site footer
β βββ post-card.html # Post preview component
β βββ comments.html # Comments component
βββ _posts/ # Blog posts
βββ assets/ # Static assets
β βββ css/ # Stylesheets
β βββ js/ # JavaScript files
β βββ images/ # Images
βββ tags.html # Tags page
βββ categories.html # Categories page
βββ search.html # Search page
βββ about.md # About page
βββ 404.html # 404 error page
βββ Gemfile # Ruby dependencies
βββ package.json # Node.js dependencies
βββ tailwind.config.js # Tailwind configuration
Edit tailwind.config.js
to customize colors and theme:
theme: {
extend: {
colors: {
primary: {
// Your custom color palette
}
}
}
}
- Header: Edit
_includes/header.html
- Footer: Edit
_includes/footer.html
- Post Cards: Edit
_includes/post-card.html
- New Pages: Create HTML/Markdown files in root directory
- Custom Components: Add to
_includes/
directory - Additional Styles: Add to
assets/css/main.css
-
Jekyll serve fails:
bundle exec jekyll serve --trace
-
CSS not updating:
- Run
npm run build-css
to rebuild styles - Clear browser cache
- Run
-
Search not working:
- Check browser console for JavaScript errors
- Ensure
search.json
is generated correctly
-
Comments not showing:
- Verify Giscus configuration in
_config.yml
- Check if GitHub Discussions are enabled
- Ensure repository is public
- Verify Giscus configuration in
- Check Jekyll documentation: https://jekyllrb.com/docs/
- Tailwind CSS docs: https://tailwindcss.com/docs
- Giscus documentation: https://giscus.app/
Feel free to submit issues and enhancement requests!
This project is open source and available under the MIT License.
Happy Blogging! π