Skip to content

Commit 813551d

Browse files
committed
Merge branch 'renewal'
2 parents 47c9d5e + 3995262 commit 813551d

File tree

288 files changed

+17506
-3568
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

288 files changed

+17506
-3568
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ vendor
88
.env
99
bin
1010
.jekyll*
11+
node_modules/
12+
package-lock.json
13+
_figma/
14+
_svg-backup/

404.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,23 @@
22
layout: page
33
title: "404: Not Found"
44
lang: en
5-
permalink: 404.html
5+
permalink: /404.html
66
---
77

8+
<script>
9+
(function() {
10+
// Detect language from URL path
11+
var path = window.location.pathname;
12+
var match = path.match(/^\/(bg|de|en|es|fr|id|it|ja|ko|pl|pt|ru|tr|vi|zh_cn|zh_tw)\//);
13+
14+
if (match && match[1] !== 'en') {
15+
var lang = match[1];
16+
// Redirect to language-specific 404 page
17+
window.location.href = '/' + lang + '/404.html';
18+
}
19+
})();
20+
</script>
21+
822
The requested page does not exist.
923

1024
You might try and start from the [home page](/).

CLAUDE.md

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
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.
8+
9+
## Build & Development Commands
10+
11+
### Jekyll Site Operations
12+
13+
```bash
14+
# Build the site (takes several minutes)
15+
bundle exec rake build
16+
17+
# Serve locally at http://localhost:4000/
18+
bundle exec rake serve
19+
20+
# Alternative: Jekyll direct serve with incremental builds
21+
bundle exec jekyll serve --watch --future --incremental
22+
```
23+
24+
### CSS (Tailwind)
25+
26+
```bash
27+
# Build CSS (production)
28+
npm run build-css
29+
30+
# Watch CSS for development
31+
npm run watch-css
32+
```
33+
34+
### Testing & Quality Assurance
35+
36+
```bash
37+
# Run all tests (includes linter, lint, build)
38+
bundle exec rake test
39+
40+
# Run individual test suites
41+
bundle exec rake test-news-plugin # News archive plugin tests
42+
bundle exec rake test-linter # Linter library tests
43+
44+
# Linting
45+
bundle exec rake lint # Markdown linter
46+
47+
# Post-build validation (requires built site)
48+
bundle exec rake check:markup # Validate HTML markup
49+
bundle exec rake check:links # Check for broken links (needs local server running)
50+
```
51+
52+
### Creating News Posts
53+
54+
```bash
55+
# Create news post template for specific language
56+
bundle exec rake new_post:en # English
57+
bundle exec rake new_post:ja # Japanese
58+
bundle exec rake new_post:fr # French
59+
# ... etc for: bg, de, es, id, it, ko, pl, pt, ru, tr, vi, zh_cn, zh_tw
60+
```
61+
62+
## Architecture & Structure
63+
64+
### Multi-Language System
65+
66+
- **16 supported languages**: bg, de, en, es, fr, id, it, ja, ko, pl, pt, ru, tr, vi, zh_cn, zh_tw
67+
- Language-specific content organized in top-level directories (e.g., `/en/`, `/ja/`)
68+
- Locale data stored in `_data/locales/*.yml`
69+
- Language switching handled by `_includes/language_selector.html`
70+
71+
### Jekyll Configuration
72+
73+
- **Markdown**: Kramdown with Rouge syntax highlighting
74+
- **Timezone**: UTC (critical for news posts)
75+
- **Permalinks**: Pretty URLs
76+
- **Build output**: `_site/` directory
77+
78+
### Key Directories
79+
80+
- `_layouts/`: Page templates (default, homepage, news_post, news_archive_month, etc.)
81+
- `_includes/`: Reusable components (header, footer, navigation, toc, sidebar)
82+
- `_plugins/`: Custom Jekyll plugins (news archive generator, posted_by, translation_status)
83+
- `_data/`: YAML data files (releases.yml, downloads.yml, branches.yml, locales/)
84+
- `lib/`: Ruby utilities (linter, markup checker, draft release)
85+
- `test/`: Test files for plugins and linter
86+
- `stylesheets/`: CSS source and compiled output
87+
- `_javascripts_src/`: TypeScript source files
88+
- `javascripts/`: Compiled JavaScript output
89+
90+
### Design System (Tailwind CSS)
91+
92+
The site uses a custom Tailwind configuration with:
93+
94+
- **Semantic color tokens** via CSS variables (defined in `tailesheets/semantic-colors.css`)
95+
- Accessible via `bg-semantic-*`, `text-semantic-*`, `border-semantic-*` classes
96+
- Automatically handles light/dark mode via `prefers-color-scheme`
97+
- **Brand colors**: Ruby (red) and Gold palettes
98+
- **Typography plugin** for prose styling
99+
- **Custom breakpoints**: Container max-widths configured for content layouts
100+
- **Dark mode**: Enabled via OS preference (`darkMode: 'media'`)
101+
102+
Input: `stylesheets/tailwind.css` → Output: `stylesheets/compiled.css`
103+
104+
### News System
105+
106+
The news system is powered by a custom Jekyll plugin (`_plugins/news.rb`):
107+
108+
- **Archive generation**: Automatically creates yearly/monthly archive pages
109+
- **Post structure**: Posts stored in `{lang}/news/_posts/YYYY-MM-DD-title.md`
110+
- **Archive pages**: Index, yearly archives, monthly archives
111+
- **RSS feeds**: Generated per language via `news_feed.rss` layout
112+
113+
### Linter (`lib/linter.rb`)
114+
115+
Enforces strict content quality rules:
116+
117+
- YAML front matter validation (lang, author, translator, date)
118+
- File naming conventions (date must match filename)
119+
- UTC timezone enforcement for news posts
120+
- Line ending consistency (LF only, no CRLF)
121+
- Trailing whitespace checks
122+
- Release post SHA hash validation (SHA1/SHA256/SHA512)
123+
- Release data validation against `_data/releases.yml`
124+
125+
### Layout Hierarchy
126+
127+
```
128+
default.html (base)
129+
├── homepage.html
130+
├── page.html
131+
├── news.html
132+
├── news_post.html
133+
├── news_archive_year.html
134+
├── news_archive_month.html
135+
└── news_feed.rss
136+
```
137+
138+
### Front Matter Requirements
139+
140+
**Standard pages:**
141+
```yaml
142+
---
143+
layout: page
144+
title: "Page Title"
145+
lang: en
146+
---
147+
```
148+
149+
**News posts:**
150+
```yaml
151+
---
152+
layout: news_post
153+
title: "Post Title"
154+
author: "Author Name"
155+
translator: "Translator Name" # Required for non-original language
156+
date: YYYY-MM-DD HH:MM:SS +0000 # Must be UTC
157+
lang: en
158+
---
159+
```
160+
161+
## TypeScript/JavaScript
162+
163+
- Source files in `_javascripts_src/` (TypeScript)
164+
- Compiled to `javascripts/` (JavaScript)
165+
- Files: `examples.ts`, `page.ts`
166+
- No build command specified - likely manual compilation or external process
167+
168+
## Dependencies
169+
170+
**Ruby (Gemfile):**
171+
- `jekyll` - Static site generator
172+
- `rouge` - Syntax highlighting
173+
- `rake` - Task automation
174+
- `html-proofer` - Markup validation
175+
- `validate-website` - Link checking
176+
- `minitest` - Testing framework
177+
- `csv`, `base64` - Ruby 3.4+ compatibility
178+
179+
**Node (package.json):**
180+
- `tailwindcss` - CSS framework
181+
- `@tailwindcss/typography` - Prose styling plugin
182+
183+
## Important Conventions
184+
185+
1. **All news posts must use UTC timezone** (`+0000`) in the date field
186+
2. **File naming**: News posts must be `YYYY-MM-DD-title.md` matching the date in front matter
187+
3. **Language codes**: Must match directory structure (e.g., `lang: en` for files in `/en/`)
188+
4. **Translator field**: Required for translated news posts, not for original posts
189+
5. **Line endings**: LF only, no CRLF
190+
6. **Release posts**: Must include valid SHA checksums if referencing downloads
191+
192+
## CI/CD
193+
194+
GitHub Actions workflow (`.github/workflows/ci.yml`):
195+
- Runs on: Ruby 3.2, Ubuntu latest
196+
- Executes: `bundle exec rake test` (includes linter, lint, build)
197+
- Triggers: Push and pull requests

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,19 @@ Open the preview in your browser with `heroku open` or
115115
retrieve the preview URL using `heroku info` and open it in your browser.
116116

117117

118+
## Styling with Tailwind CSS
119+
120+
This site uses [Tailwind CSS](https://tailwindcss.com/) for styling.
121+
After making changes to HTML/Markdown files or Tailwind configuration:
122+
123+
``` sh
124+
npm run build-css # build CSS
125+
npm run watch-css # watch and rebuild CSS automatically
126+
```
127+
128+
**Note:** You need to have Node.js installed to run these commands.
129+
130+
118131
## Testing
119132

120133
Besides generating and previewing the site

_config.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ highlighter: rouge
55
timezone: UTC
66

77
kramdown:
8-
auto_ids: false
8+
auto_ids: true # Enable auto IDs for TOC links
9+
10+
include:
11+
- _headers
912

1013
exclude:
1114
- Gemfile

_data/languages.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
- code: bg
3+
name: Български
4+
native_name: Български
5+
- code: de
6+
name: German
7+
native_name: Deutsch
8+
- code: en
9+
name: English
10+
native_name: English
11+
- code: es
12+
name: Spanish
13+
native_name: Español
14+
- code: fr
15+
name: French
16+
native_name: Français
17+
- code: id
18+
name: Indonesian
19+
native_name: Indonesia
20+
- code: it
21+
name: Italian
22+
native_name: Italiano
23+
- code: ja
24+
name: Japanese
25+
native_name: 日本語
26+
- code: ko
27+
name: Korean
28+
native_name: 한국어
29+
- code: pl
30+
name: Polish
31+
native_name: polski
32+
- code: pt
33+
name: Portuguese
34+
native_name: Português
35+
- code: ru
36+
name: Russian
37+
native_name: Русский
38+
- code: tr
39+
name: Turkish
40+
native_name: Türkçe
41+
- code: vi
42+
name: Vietnamese
43+
native_name: Tiếng Việt
44+
- code: zh_cn
45+
name: Simplified Chinese
46+
native_name: 简体中文
47+
- code: zh_tw
48+
name: Traditional Chinese
49+
native_name: 繁體中文

_data/latest_version.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
version: "4.0.0"

0 commit comments

Comments
 (0)