Skip to content

Commit cccddd3

Browse files
committed
I'm back, with help from Claude
chore: upgrade dev dependencies and fix deprecation warnings - Bump npm devDependencies to latest major versions: @commitlint/cli 8→21, eslint 6→10, husky 4→9, stylelint 13→17, stylelint-config-standard 19→40 - Migrate ESLint config from .eslintrc to flat config (eslint.config.mjs) - Update stylelint config for v17: remove deprecated stylistic rules - Migrate husky from v4 package.json hooks to v9 .husky/ directory - Replace Sass '/' division with math.div() in _variables.scss, _grid.scss, _toc.scss, _extensions.scss - Tighten gem dependency lower bounds to match GitHub Pages versions - Fix JS lint issues: unused variable, hasOwnProperty call - Update copyright year from 2021 to 2026 in all locale files - Add CLAUDE.md with project architecture documentation
1 parent 9f19980 commit cccddd3

17 files changed

Lines changed: 225 additions & 125 deletions

File tree

.eslintrc

Lines changed: 0 additions & 20 deletions
This file was deleted.

.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx --no -- commitlint --edit "$1"

.stylelintrc

Lines changed: 35 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,53 @@
1-
21
{
3-
"extends": ["stylelint-config-standard", "stylelint-config-recommended-scss"],
2+
"extends": [
3+
"stylelint-config-standard",
4+
"stylelint-config-recommended-scss"
5+
],
46
"plugins": [
57
"stylelint-order"
68
],
79
"rules": {
10+
"alpha-value-notation": "number",
811
"at-rule-empty-line-before": null,
9-
"at-rule-name-space-after": "always",
10-
"at-rule-no-vendor-prefix": true,
11-
"at-rule-semicolon-space-before": "never",
12-
"block-closing-brace-empty-line-before": null,
13-
"block-closing-brace-newline-after": null,
14-
"block-opening-brace-space-before": null,
12+
"at-rule-no-vendor-prefix": null,
13+
"color-function-alias-notation": null,
14+
"color-function-notation": "legacy",
1515
"color-named": "never",
16-
"color-hex-case": "lower",
1716
"color-hex-length": "short",
18-
"declaration-block-semicolon-newline-after": "always-multi-line",
19-
"declaration-block-semicolon-newline-before": "never-multi-line",
20-
"declaration-block-semicolon-space-after": "always-single-line",
17+
"declaration-block-single-line-max-declarations": null,
2118
"declaration-empty-line-before": null,
22-
"declaration-no-important": true,
19+
"declaration-no-important": null,
2320
"font-family-name-quotes": "always-where-recommended",
2421
"font-weight-notation": null,
2522
"function-url-no-scheme-relative": true,
2623
"function-url-quotes": "always",
24+
"import-notation": "string",
2725
"length-zero-no-unit": true,
28-
"max-empty-lines": 2,
29-
"max-line-length": null,
3026
"media-feature-name-no-vendor-prefix": true,
31-
"media-feature-parentheses-space-inside": "never",
32-
"media-feature-range-operator-space-after": "always",
33-
"media-feature-range-operator-space-before": "never",
3427
"no-descending-specificity": null,
35-
"no-duplicate-selectors": true,
36-
"number-leading-zero": "never",
37-
"media-feature-name-no-unknown": [true, {
38-
"ignoreMediaFeatureNames": ["prefers-reduced-motion"]
39-
}],
28+
"no-duplicate-selectors": null,
29+
"no-empty-source": null,
30+
"property-no-deprecated": null,
31+
"property-no-vendor-prefix": null,
32+
"rule-empty-line-before": null,
33+
"selector-class-pattern": null,
34+
"selector-max-attribute": 2,
35+
"selector-max-class": 4,
36+
"selector-max-combinators": 4,
37+
"selector-max-compound-selectors": 4,
38+
"selector-max-id": 0,
39+
"selector-max-specificity": null,
40+
"selector-max-type": 2,
41+
"selector-max-universal": 1,
42+
"selector-no-qualifying-type": null,
43+
"selector-no-vendor-prefix": null,
44+
"shorthand-property-no-redundant-values": null,
45+
"value-keyword-case": null,
46+
"value-no-vendor-prefix": null,
47+
"scss/at-extend-no-missing-placeholder": null,
48+
"scss/at-if-no-null": null,
49+
"scss/comment-no-empty": null,
50+
"scss/no-global-function-names": null,
4051
"order/properties-order": [
4152
"position",
4253
"top",
@@ -247,30 +258,6 @@
247258
"animation-fill-mode",
248259
"fill",
249260
"stroke"
250-
],
251-
"property-no-vendor-prefix": true,
252-
"rule-empty-line-before": null,
253-
"selector-attribute-quotes": "always",
254-
"selector-list-comma-newline-after": "always-multi-line",
255-
"selector-list-comma-newline-before": "never-multi-line",
256-
"selector-list-comma-space-after": "always-single-line",
257-
"selector-list-comma-space-before": "never-single-line",
258-
"selector-max-attribute": 2,
259-
"selector-max-class": 4,
260-
"selector-max-combinators": 4,
261-
"selector-max-compound-selectors": 4,
262-
"selector-max-empty-lines": 1,
263-
"selector-max-id": 0,
264-
"selector-max-specificity": null,
265-
"selector-max-type": 2,
266-
"selector-max-universal": 1,
267-
"selector-no-qualifying-type": null,
268-
"selector-no-vendor-prefix": true,
269-
"string-quotes": "double",
270-
"value-keyword-case": "lower",
271-
"value-list-comma-newline-after": "never-multi-line",
272-
"value-list-comma-newline-before": "never-multi-line",
273-
"value-list-comma-space-after": "always",
274-
"value-no-vendor-prefix": true
261+
]
275262
}
276263
}

CLAUDE.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Commands
6+
7+
```bash
8+
# Build the production site
9+
npm run build
10+
11+
# Serve locally with live reload (default)
12+
npm run serve
13+
14+
# Serve with tracing output
15+
npm run default
16+
17+
# Serve docs/demo site (dev, beta, production variants)
18+
npm run dev # docs/_config.dev.yml
19+
npm run demo-dev # docs/_config.yml (dev env)
20+
npm run demo-prod # docs/_config.yml (production env)
21+
22+
# Lint JS in _includes/**/*.js
23+
npm run eslint
24+
npm run eslint-fix
25+
26+
# Lint SCSS in _sass/**/*.scss
27+
npm run stylelint
28+
npm run stylelint-fix
29+
30+
# Build & publish gem (release flow only)
31+
npm run gem-build
32+
npm run gem-push
33+
34+
# Docker-based development
35+
npm run docker-dev:default
36+
npm run docker-dev:dev
37+
npm run docker-dev:demo-dev
38+
39+
# Docker production build + serve
40+
npm run docker-prod:build
41+
npm run docker-prod:serve
42+
```
43+
44+
**CI**: Travis builds the docs site via `JEKYLL_ENV=production bundle exec jekyll build --config ./docs/_config.yml` and deploys to `gh-pages` branch.
45+
46+
**Commit style**: Conventional Commits via commitlint (`feat:`, `fix:`, `docs:`, `refactor:`, `release:`, etc.).
47+
48+
## Project Architecture
49+
50+
### Skin System
51+
6 built-in skins (`default`, `dark`, `forest`, `ocean`, `chocolate`, `orange`) + 5 highlight themes. A skin is a SCSS file at `_sass/skins/_<name>.scss` that defines CSS custom properties (colors, fonts, borders). Selected via `text_skin` in `_config.yml`. The main entry point `assets/css/main.scss` dynamically `@import`s the active skin.
52+
53+
### Layout Inheritance
54+
Layouts in `_layouts/` form a chain: `none``base``page``article` / `home` / `landing` / `articles` / `archive` / `404`. `base.html` is the root — it sets up the HTML shell, analytics, head, and core JS utilities. Page-level layouts extend it and add content wrappers.
55+
56+
### Include System
57+
`_includes/` is organized by concern:
58+
- **article/** — header, footer, info, list components
59+
- **aside/** — sidebar content (TOC, affix)
60+
- **scripts/** — vanilla JS (no framework): lib/ (third-party), utils/, components/ (search, lightbox, sidebar)
61+
- **head/**, **footer/**, **sidebar/** — structural includes
62+
- **comments-providers/**, **analytics-providers/**, **search-providers/**, **sharing-providers/**, **pageview-providers/** — pluggable third-party integrations
63+
64+
### JavaScript Architecture
65+
Vanilla JS (no build step, no framework). Scripts are included directly via Liquid `{%- include scripts/...js -%}` in `base.html`. The JS is split into:
66+
- **lib/** — isolated utilities (lazyload, throttle, affix, TOC, swiper, modal, gallery, scroll-to)
67+
- **components/** — stateful UI (search, lightbox, sidebar)
68+
- **utils/** — helpers (image loading, general utils)
69+
- Page-level scripts: `article.js`, `page.js`, `home.js`, `archieve.js`
70+
71+
No bundler — all JS is served raw from `_includes/scripts/`.
72+
73+
### SCSS Organization
74+
`_sass/` is structured as:
75+
- **skins/** — color/font themes (each skin is a standalone variable file)
76+
- **common/** — shared variables, functions, classes, reset, print styles, reusable components (button, card, modal, gallery, etc.)
77+
- **components/** — page-level component styles (header, footer, search, lightbox, etc.)
78+
- **layout/** — page layout styles (base, page, article, home, archive, etc.)
79+
- **additional/** — optional utility styles (alerts, tags, photo frames)
80+
- **animate/** — keyframe animations (fade-in variants)
81+
- **custom.scss** — user overrides placeholder
82+
83+
### Content & Data
84+
- `_data/` — YAML files for authors, licenses, locale (i18n), navigation, and theme variables
85+
- `_posts/` — sample/blog posts directory
86+
- `docs/` — standalone documentation site (has its own `_config.yml`, posts, sample pages, and shared `_includes` from root via Travis `before_script`)
87+
- `test/` — minimal test site (used for smoke testing the theme)
88+
89+
### Building a Release
90+
1. Update version in `jekyll-text-theme.gemspec`, `package.json`, and `_includes/scripts/variables.html`
91+
2. Update `CHANGELOG.md`
92+
3. Run `npm run gem-build && npm run gem-push`
93+
4. Tag and push with `release: vx.x.x` commit message

_data/locale.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ en: &EN
1919
FOLLOW_US : "Follow us on [NAME]."
2020
EMAIL_ME : "Send me an Email."
2121
EMAIL_US : "Send us an Email."
22-
COPYRIGHT_DATES : "2021"
22+
COPYRIGHT_DATES : "2026"
2323

2424
en-GB:
2525
<<: *EN
@@ -50,7 +50,7 @@ zh-Hans: &ZH_HANS
5050
FOLLOW_US : "在 [NAME] 上关注我们。"
5151
EMAIL_ME : "给我发邮件。"
5252
EMAIL_US : "给我们发邮件。"
53-
COPYRIGHT_DATES : "2021"
53+
COPYRIGHT_DATES : "2026"
5454

5555
zh:
5656
<<: *ZH_HANS
@@ -79,7 +79,7 @@ zh-Hant: &ZH_HANT
7979
FOLLOW_US : "在 [NAME] 上關注我們。"
8080
EMAIL_ME : "給我發郵件。"
8181
EMAIL_US : "給我們發郵件。"
82-
COPYRIGHT_DATES : "2021"
82+
COPYRIGHT_DATES : "2026"
8383

8484
zh-TW:
8585
<<: *ZH_HANT
@@ -106,7 +106,7 @@ ko: &KO
106106
FOLLOW_US : "[NAME]에서 팔로우하기"
107107
EMAIL_ME : "이메일 보내기"
108108
EMAIL_US : "이메일 보내기"
109-
COPYRIGHT_DATES : "2021"
109+
COPYRIGHT_DATES : "2026"
110110

111111
ko-KR:
112112
<<: *KO
@@ -131,7 +131,7 @@ fr: &FR
131131
FOLLOW_US : "Suivez-nous sur [NAME]."
132132
EMAIL_ME : "Envoyez-moi un courriel."
133133
EMAIL_US : "Envoyez-nous un courriel"
134-
COPYRIGHT_DATES : "2021"
134+
COPYRIGHT_DATES : "2026"
135135
DONATE : "Faites un don de [NAME]."
136136

137137
fr-BE:
@@ -164,6 +164,6 @@ tr: &TR
164164
FOLLOW_US : "Bizi [NAME] üzerinden takip edin."
165165
EMAIL_ME : "Bana email ile ulaşın."
166166
EMAIL_US : "Bize email ile ulaşın."
167-
COPYRIGHT_DATES : "2021"
167+
COPYRIGHT_DATES : "2026"
168168

169169
# @end locale config

_includes/scripts/archieve.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
function queryString() {
44
// This function is anonymous, is executed immediately and
55
// the return value is assigned to QueryString!
6-
var i = 0, queryObj = {}, pair;
6+
var i, queryObj = {}, pair;
77
var queryStr = window.location.search.substring(1);
88
var queryArr = queryStr.split('&');
99
for (i = 0; i < queryArr.length; i++) {

_includes/scripts/components/search.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
var $searchBox = null;
1717
var $searchInput = null;
18-
var $searchClear = null;
18+
var $searchClear;
1919

2020
function getModalVisible() {
2121
return modalVisible;

_includes/scripts/lib/lazyload.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
var createNode = function(name, attrs) {
5959
var node = doc.createElement(name), attr;
6060
for (attr in attrs) {
61-
if (attrs.hasOwnProperty(attr)) {
61+
if (Object.prototype.hasOwnProperty.call(attrs, attr)) {
6262
node.setAttribute(attr, attrs[attr]);
6363
}
6464
}

_sass/common/_variables.scss

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use 'sass:math';
2+
13
$base: (
24
font-family: (-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif),
35
font-family-code: (Menlo, Monaco, Consolas, Andale Mono, lucida console, Courier New, monospace),
@@ -114,16 +116,16 @@ $button-height-sm: 1.5rem;
114116
$button-height-xs: 1.2rem;
115117

116118
$button: (
117-
padding-y-xl: ($button-height-xl - map-get($base, font-size-xl)) / 2,
118-
padding-x-xl: $button-height-xl / 3,
119-
padding-y-lg: ($button-height-lg - map-get($base, font-size-lg)) / 2,
120-
padding-x-lg: $button-height-lg / 3,
121-
padding-y: ($button-height - map-get($base, font-size)) / 2,
122-
padding-x: $button-height / 3,
123-
padding-y-sm: ($button-height-sm - map-get($base, font-size-sm)) / 2,
124-
padding-x-sm: $button-height-sm / 3,
125-
padding-y-xs: ($button-height-xs - map-get($base, font-size-xs)) / 2,
126-
padding-x-xs: $button-height-xs / 3,
119+
padding-y-xl: math.div($button-height-xl - map-get($base, font-size-xl), 2),
120+
padding-x-xl: math.div($button-height-xl, 3),
121+
padding-y-lg: math.div($button-height-lg - map-get($base, font-size-lg), 2),
122+
padding-x-lg: math.div($button-height-lg, 3),
123+
padding-y: math.div($button-height - map-get($base, font-size), 2),
124+
padding-x: math.div($button-height, 3),
125+
padding-y-sm: math.div($button-height-sm - map-get($base, font-size-sm), 2),
126+
padding-x-sm: math.div($button-height-sm, 3),
127+
padding-y-xs: math.div($button-height-xs - map-get($base, font-size-xs), 2),
128+
padding-x-xs: math.div($button-height-xs, 3),
127129

128130
pill-radius: 6rem,
129131

_sass/common/classes/_grid.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use 'sass:math';
2+
13
$grid-columns: 12;
24

35
.grid-container {
@@ -18,7 +20,7 @@ $grid-columns: 12;
1820
@include flex(1);
1921
} @else {
2022
@include flex(none);
21-
width: percentage($columns / $grid-columns);
23+
width: percentage(math.div($columns, $grid-columns));
2224
}
2325
}
2426

0 commit comments

Comments
 (0)