Repository Guidelines
Repository Guidelines
Contributor guide for CaoJiahao2.github.io, a personal website built with Jekyll and the Minimal Mistakes theme, deployed via GitHub Pages.
Project Structure & Module Organization
_posts/— blog articles, namedYYYY-MM-DD-slug.md_pages/— standalone pages (about.md,search.md) with apermalinkfront-matter field_idea/,_resources/,_research/,_life/,_photography/— Jekyll collections for each navigation section_data/— site data (navigation.yml,authors.yml,ui-text.yml)_config.yml— site metadata, navigation, search, and comment settings_includes/,_layouts/,_sass/— theme components and stylesassets/— images, CSS, and JS_site/— generated build output (gitignored)
Build, Test, and Development Commands
Uses Ruby + Bundler with the github-pages gem for parity with GitHub Pages.
bundle install # install dependencies (Gemfile)
bundle exec jekyll serve # local preview at http://127.0.0.1:4000
bundle exec jekyll build # generate the site into _site/
There is no test suite. Verify new content locally with bundle exec jekyll serve.
Coding Style & Naming Conventions
- Content uses YAML front matter:
title,categories,tags, anddatefor posts;permalinkfor pages - Follow existing files (e.g.,
_resources/2025-07-02-resources.md) when adding collection entries - Posts and dated collections use
YYYY-MM-DD-slug.md; slugs are lowercase with hyphens - Keep
_config.ymlsettings commented; restart the server after editing it - No linters are configured; use 2-space indentation for YAML and follow existing Markdown style
Testing Guidelines
Automated tests are not used. Validate changes by:
- Running
bundle exec jekyll buildand confirming it exits cleanly - Serving locally and checking the affected pages and links
- Confirming
/search.jsonregenerates when content is added
Commit & Pull Request Guidelines
- Commit messages are short and imperative; recent history is in Chinese (e.g.,
fix bug on right,新增搜索功能). Match the language of the change - Create a descriptive branch off
masterbefore opening a PR - Fill out
.github/PULL_REQUEST_TEMPLATE.md; note whether the change is a bug fix, feature, or content addition - Reference related issues and include screenshots for visual changes
- Push to
master; GitHub Pages builds and deploys automatically
Security & Configuration Tips
- Never commit real API keys or tokens
- Giscus comments (
_config.yml→comments.giscus) need arepo_idandcategory_idfrom giscus.app; keep theYOUR_GISCUS_*placeholders until configured - Preserve
.gitignoreentries for_site/,.jekyll-cache, andGemfile.lock