This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is the Jekyll-based source for the official Ruby programming language website (www.ruby-lang.org), featuring multi-language support for 16+ languages and a Tailwind CSS-based design system.
# Build the site (takes several minutes)
bundle exec rake build
# Serve locally at http://localhost:4000/
bundle exec rake serve
# Alternative: Jekyll direct serve with incremental builds
bundle exec jekyll serve --watch --future --incremental# Build CSS (production)
npm run build-css
# Watch CSS for development
npm run watch-css# Run all tests (includes linter, lint, build)
bundle exec rake test
# Run individual test suites
bundle exec rake test-news-plugin # News archive plugin tests
bundle exec rake test-linter # Linter library tests
# Linting
bundle exec rake lint # Markdown linter
# Post-build validation (requires built site)
bundle exec rake check:markup # Validate HTML markup
bundle exec rake check:links # Check for broken links (needs local server running)# Create news post template for specific language
bundle exec rake new_post:en # English
bundle exec rake new_post:ja # Japanese
bundle exec rake new_post:fr # French
# ... etc for: bg, de, es, id, it, ko, pl, pt, ru, tr, vi, zh_cn, zh_tw- 16 supported languages: bg, de, en, es, fr, id, it, ja, ko, pl, pt, ru, tr, vi, zh_cn, zh_tw
- Language-specific content organized in top-level directories (e.g.,
/en/,/ja/) - Locale data stored in
_data/locales/*.yml - Language switching handled by
_includes/language_selector.html
- Markdown: Kramdown with Rouge syntax highlighting
- Timezone: UTC (critical for news posts)
- Permalinks: Pretty URLs
- Build output:
_site/directory
_layouts/: Page templates (default, homepage, news_post, news_archive_month, etc.)_includes/: Reusable components (header, footer, navigation, toc, sidebar)_plugins/: Custom Jekyll plugins (news archive generator, posted_by, translation_status)_data/: YAML data files (releases.yml, downloads.yml, branches.yml, locales/)lib/: Ruby utilities (linter, markup checker, draft release)test/: Test files for plugins and linterstylesheets/: CSS source and compiled output_javascripts_src/: TypeScript source filesjavascripts/: Compiled JavaScript output
The site uses a custom Tailwind configuration with:
- Semantic color tokens via CSS variables (defined in
tailesheets/semantic-colors.css)- Accessible via
bg-semantic-*,text-semantic-*,border-semantic-*classes - Automatically handles light/dark mode via
prefers-color-scheme
- Accessible via
- Brand colors: Ruby (red) and Gold palettes
- Typography plugin for prose styling
- Custom breakpoints: Container max-widths configured for content layouts
- Dark mode: Enabled via OS preference (
darkMode: 'media')
Input: stylesheets/tailwind.css → Output: stylesheets/compiled.css
The news system is powered by a custom Jekyll plugin (_plugins/news.rb):
- Archive generation: Automatically creates yearly/monthly archive pages
- Post structure: Posts stored in
{lang}/news/_posts/YYYY-MM-DD-title.md - Archive pages: Index, yearly archives, monthly archives
- RSS feeds: Generated per language via
news_feed.rsslayout
Enforces strict content quality rules:
- YAML front matter validation (lang, author, translator, date)
- File naming conventions (date must match filename)
- UTC timezone enforcement for news posts
- Line ending consistency (LF only, no CRLF)
- Trailing whitespace checks
- Release post SHA hash validation (SHA1/SHA256/SHA512)
- Release data validation against
_data/releases.yml
default.html (base)
├── homepage.html
├── page.html
├── news.html
├── news_post.html
├── news_archive_year.html
├── news_archive_month.html
└── news_feed.rss
Standard pages:
---
layout: page
title: "Page Title"
lang: en
---News posts:
---
layout: news_post
title: "Post Title"
author: "Author Name"
translator: "Translator Name" # Required for non-original language
date: YYYY-MM-DD HH:MM:SS +0000 # Must be UTC
lang: en
---- Source files in
_javascripts_src/(TypeScript) - Compiled to
javascripts/(JavaScript) - Files:
examples.ts,page.ts - No build command specified - likely manual compilation or external process
Ruby (Gemfile):
jekyll- Static site generatorrouge- Syntax highlightingrake- Task automationhtml-proofer- Markup validationvalidate-website- Link checkingminitest- Testing frameworkcsv,base64- Ruby 3.4+ compatibility
Node (package.json):
tailwindcss- CSS framework@tailwindcss/typography- Prose styling plugin
- All news posts must use UTC timezone (
+0000) in the date field - File naming: News posts must be
YYYY-MM-DD-title.mdmatching the date in front matter - Language codes: Must match directory structure (e.g.,
lang: enfor files in/en/) - Translator field: Required for translated news posts, not for original posts
- Line endings: LF only, no CRLF
- Release posts: Must include valid SHA checksums if referencing downloads
GitHub Actions workflow (.github/workflows/ci.yml):
- Runs on: Ruby 3.2, Ubuntu latest
- Executes:
bundle exec rake test(includes linter, lint, build) - Triggers: Push and pull requests