Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions .eslintrc

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: GitHub Pages

on:
push:
branches: [master]

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true

- run: cp -rfv docs/_includes .

- run: JEKYLL_ENV=production bundle exec jekyll build --config ./docs/_config.yml

- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_site
keep_history: true
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no -- commitlint --edit "$1"
83 changes: 35 additions & 48 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -1,42 +1,53 @@

{
"extends": ["stylelint-config-standard", "stylelint-config-recommended-scss"],
"extends": [
"stylelint-config-standard",
"stylelint-config-recommended-scss"
],
"plugins": [
"stylelint-order"
],
"rules": {
"alpha-value-notation": "number",
"at-rule-empty-line-before": null,
"at-rule-name-space-after": "always",
"at-rule-no-vendor-prefix": true,
"at-rule-semicolon-space-before": "never",
"block-closing-brace-empty-line-before": null,
"block-closing-brace-newline-after": null,
"block-opening-brace-space-before": null,
"at-rule-no-vendor-prefix": null,
"color-function-alias-notation": null,
"color-function-notation": "legacy",
"color-named": "never",
"color-hex-case": "lower",
"color-hex-length": "short",
"declaration-block-semicolon-newline-after": "always-multi-line",
"declaration-block-semicolon-newline-before": "never-multi-line",
"declaration-block-semicolon-space-after": "always-single-line",
"declaration-block-single-line-max-declarations": null,
"declaration-empty-line-before": null,
"declaration-no-important": true,
"declaration-no-important": null,
"font-family-name-quotes": "always-where-recommended",
"font-weight-notation": null,
"function-url-no-scheme-relative": true,
"function-url-quotes": "always",
"import-notation": "string",
"length-zero-no-unit": true,
"max-empty-lines": 2,
"max-line-length": null,
"media-feature-name-no-vendor-prefix": true,
"media-feature-parentheses-space-inside": "never",
"media-feature-range-operator-space-after": "always",
"media-feature-range-operator-space-before": "never",
"no-descending-specificity": null,
"no-duplicate-selectors": true,
"number-leading-zero": "never",
"media-feature-name-no-unknown": [true, {
"ignoreMediaFeatureNames": ["prefers-reduced-motion"]
}],
"no-duplicate-selectors": null,
"no-empty-source": null,
"property-no-deprecated": null,
"property-no-vendor-prefix": null,
"rule-empty-line-before": null,
"selector-class-pattern": null,
"selector-max-attribute": 2,
"selector-max-class": 4,
"selector-max-combinators": 4,
"selector-max-compound-selectors": 4,
"selector-max-id": 0,
"selector-max-specificity": null,
"selector-max-type": 2,
"selector-max-universal": 1,
"selector-no-qualifying-type": null,
"selector-no-vendor-prefix": null,
"shorthand-property-no-redundant-values": null,
"value-keyword-case": null,
"value-no-vendor-prefix": null,
"scss/at-extend-no-missing-placeholder": null,
"scss/at-if-no-null": null,
"scss/comment-no-empty": null,
"scss/no-global-function-names": null,
"order/properties-order": [
"position",
"top",
Expand Down Expand Up @@ -247,30 +258,6 @@
"animation-fill-mode",
"fill",
"stroke"
],
"property-no-vendor-prefix": true,
"rule-empty-line-before": null,
"selector-attribute-quotes": "always",
"selector-list-comma-newline-after": "always-multi-line",
"selector-list-comma-newline-before": "never-multi-line",
"selector-list-comma-space-after": "always-single-line",
"selector-list-comma-space-before": "never-single-line",
"selector-max-attribute": 2,
"selector-max-class": 4,
"selector-max-combinators": 4,
"selector-max-compound-selectors": 4,
"selector-max-empty-lines": 1,
"selector-max-id": 0,
"selector-max-specificity": null,
"selector-max-type": 2,
"selector-max-universal": 1,
"selector-no-qualifying-type": null,
"selector-no-vendor-prefix": true,
"string-quotes": "double",
"value-keyword-case": "lower",
"value-list-comma-newline-after": "never-multi-line",
"value-list-comma-newline-before": "never-multi-line",
"value-list-comma-space-after": "always",
"value-no-vendor-prefix": true
]
}
}
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@

## 2.0.0 (2018-07-01)

Breaking changes, please check [Update from 1.x to 2.x](https://tianqi.name/jekyll-TeXt-theme/docs/en/update-from-1-to-2) for details
Breaking changes, please check [Update from 1.x to 2.x](https://kitian616.github.io/jekyll-TeXt-theme/docs/en/update-from-1-to-2) for details

### Enhancements

Expand Down
93 changes: 93 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Commands

```bash
# Build the production site
npm run build

# Serve locally with live reload (default)
npm run serve

# Serve with tracing output
npm run default

# Serve docs/demo site (dev, beta, production variants)
npm run dev # docs/_config.dev.yml
npm run demo-dev # docs/_config.yml (dev env)
npm run demo-prod # docs/_config.yml (production env)

# Lint JS in _includes/**/*.js
npm run eslint
npm run eslint-fix

# Lint SCSS in _sass/**/*.scss
npm run stylelint
npm run stylelint-fix

# Build & publish gem (release flow only)
npm run gem-build
npm run gem-push

# Docker-based development
npm run docker-dev:default
npm run docker-dev:dev
npm run docker-dev:demo-dev

# Docker production build + serve
npm run docker-prod:build
npm run docker-prod:serve
```

**CI**: Travis builds the docs site via `JEKYLL_ENV=production bundle exec jekyll build --config ./docs/_config.yml` and deploys to `gh-pages` branch.

**Commit style**: Conventional Commits via commitlint (`feat:`, `fix:`, `docs:`, `refactor:`, `release:`, etc.).

## Project Architecture

### Skin System
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.

### Layout Inheritance
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.

### Include System
`_includes/` is organized by concern:
- **article/** — header, footer, info, list components
- **aside/** — sidebar content (TOC, affix)
- **scripts/** — vanilla JS (no framework): lib/ (third-party), utils/, components/ (search, lightbox, sidebar)
- **head/**, **footer/**, **sidebar/** — structural includes
- **comments-providers/**, **analytics-providers/**, **search-providers/**, **sharing-providers/**, **pageview-providers/** — pluggable third-party integrations

### JavaScript Architecture
Vanilla JS (no build step, no framework). Scripts are included directly via Liquid `{%- include scripts/...js -%}` in `base.html`. The JS is split into:
- **lib/** — isolated utilities (lazyload, throttle, affix, TOC, swiper, modal, gallery, scroll-to)
- **components/** — stateful UI (search, lightbox, sidebar)
- **utils/** — helpers (image loading, general utils)
- Page-level scripts: `article.js`, `page.js`, `home.js`, `archieve.js`

No bundler — all JS is served raw from `_includes/scripts/`.

### SCSS Organization
`_sass/` is structured as:
- **skins/** — color/font themes (each skin is a standalone variable file)
- **common/** — shared variables, functions, classes, reset, print styles, reusable components (button, card, modal, gallery, etc.)
- **components/** — page-level component styles (header, footer, search, lightbox, etc.)
- **layout/** — page layout styles (base, page, article, home, archive, etc.)
- **additional/** — optional utility styles (alerts, tags, photo frames)
- **animate/** — keyframe animations (fade-in variants)
- **custom.scss** — user overrides placeholder

### Content & Data
- `_data/` — YAML files for authors, licenses, locale (i18n), navigation, and theme variables
- `_posts/` — sample/blog posts directory
- `docs/` — standalone documentation site (has its own `_config.yml`, posts, sample pages, and shared `_includes` from root via Travis `before_script`)
- `test/` — minimal test site (used for smoke testing the theme)

### Building a Release
1. Update version in `jekyll-text-theme.gemspec`, `package.json`, and `_includes/scripts/variables.html`
2. Update `CHANGELOG.md`
3. Run `npm run gem-build && npm run gem-push`
4. Tag and push with `release: vx.x.x` commit message
2 changes: 1 addition & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:2.6
FROM ruby:2.7

# Set default locale for the environment
ENV LC_ALL C.UTF-8
Expand Down
30 changes: 15 additions & 15 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,32 +57,32 @@ TeXt 使用 [Tomorrow](https://github.com/chriskempson/tomorrow-theme) 作为它

### 开始

- [快速开始](https://tianqi.name/jekyll-TeXt-theme/docs/zh/quick-start)
- [从 1.x 升级到 2.x](https://tianqi.name/jekyll-TeXt-theme/docs/zh/update-from-1-to-2)
- [快速开始](https://kitian616.github.io/jekyll-TeXt-theme/docs/zh/quick-start)
- [从 1.x 升级到 2.x](https://kitian616.github.io/jekyll-TeXt-theme/docs/zh/update-from-1-to-2)

### 定制

- [配置](https://tianqi.name/jekyll-TeXt-theme/docs/zh/configuration)
- [导航栏](https://tianqi.name/jekyll-TeXt-theme/docs/zh/navigation)
- [布局](https://tianqi.name/jekyll-TeXt-theme/docs/zh/layouts)
- [Logo 和 Favicon](https://tianqi.name/jekyll-TeXt-theme/docs/zh/logo-and-favicon)
- [作者](https://tianqi.name/jekyll-TeXt-theme/docs/zh/authors)
- [国际化](https://tianqi.name/jekyll-TeXt-theme/docs/zh/i18n)
- [配置](https://kitian616.github.io/jekyll-TeXt-theme/docs/zh/configuration)
- [导航栏](https://kitian616.github.io/jekyll-TeXt-theme/docs/zh/navigation)
- [布局](https://kitian616.github.io/jekyll-TeXt-theme/docs/zh/layouts)
- [Logo 和 Favicon](https://kitian616.github.io/jekyll-TeXt-theme/docs/zh/logo-and-favicon)
- [作者](https://kitian616.github.io/jekyll-TeXt-theme/docs/zh/authors)
- [国际化](https://kitian616.github.io/jekyll-TeXt-theme/docs/zh/i18n)

### 内容

- [撰写博客](https://tianqi.name/jekyll-TeXt-theme/docs/zh/writing-posts)
- [附加样式](https://tianqi.name/jekyll-TeXt-theme/docs/zh/additional-styles)
- [扩展](https://tianqi.name/jekyll-TeXt-theme/docs/zh/extensions)
- [Markdown 增强](https://tianqi.name/jekyll-TeXt-theme/docs/zh/markdown-enhancements)
- [撰写博客](https://kitian616.github.io/jekyll-TeXt-theme/docs/zh/writing-posts)
- [附加样式](https://kitian616.github.io/jekyll-TeXt-theme/docs/zh/additional-styles)
- [扩展](https://kitian616.github.io/jekyll-TeXt-theme/docs/zh/extensions)
- [Markdown 增强](https://kitian616.github.io/jekyll-TeXt-theme/docs/zh/markdown-enhancements)

## 示例

| Name | Description |
| --- | --- |
| [Home](https://tianqi.name/jekyll-TeXt-theme/test/) | 列表页 |
| [Archive](https://tianqi.name/jekyll-TeXt-theme/archive.html) | 归档页 |
| [Layout Examples](https://tianqi.name/jekyll-TeXt-theme/samples.html) | 各种布局示例 |
| [Home](https://kitian616.github.io/jekyll-TeXt-theme/test/) | 列表页 |
| [Archive](https://kitian616.github.io/jekyll-TeXt-theme/archive.html) | 归档页 |
| [Layout Examples](https://kitian616.github.io/jekyll-TeXt-theme/samples.html) | 各种布局示例 |

## 支持我

Expand Down
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,32 +57,32 @@ TeXt use [Tomorrow](https://github.com/chriskempson/tomorrow-theme) as the highl

### Start

- [Quick Start](https://tianqi.name/jekyll-TeXt-theme/docs/en/quick-start)
- [Update from 1.x to 2.x](https://tianqi.name/jekyll-TeXt-theme/docs/en/update-from-1-to-2)
- [Quick Start](https://kitian616.github.io/jekyll-TeXt-theme/docs/en/quick-start)
- [Update from 1.x to 2.x](https://kitian616.github.io/jekyll-TeXt-theme/docs/en/update-from-1-to-2)

### Customization

- [Configuration](https://tianqi.name/jekyll-TeXt-theme/docs/en/configuration)
- [Navigation](https://tianqi.name/jekyll-TeXt-theme/docs/en/navigation)
- [Layouts](https://tianqi.name/jekyll-TeXt-theme/docs/en/layouts)
- [Logo and Favicon](https://tianqi.name/jekyll-TeXt-theme/docs/en/logo-and-favicon)
- [Authors](https://tianqi.name/jekyll-TeXt-theme/docs/en/authors)
- [Internationalization](https://tianqi.name/jekyll-TeXt-theme/docs/en/i18n)
- [Configuration](https://kitian616.github.io/jekyll-TeXt-theme/docs/en/configuration)
- [Navigation](https://kitian616.github.io/jekyll-TeXt-theme/docs/en/navigation)
- [Layouts](https://kitian616.github.io/jekyll-TeXt-theme/docs/en/layouts)
- [Logo and Favicon](https://kitian616.github.io/jekyll-TeXt-theme/docs/en/logo-and-favicon)
- [Authors](https://kitian616.github.io/jekyll-TeXt-theme/docs/en/authors)
- [Internationalization](https://kitian616.github.io/jekyll-TeXt-theme/docs/en/i18n)

### Content

- [Writing Posts](https://tianqi.name/jekyll-TeXt-theme/docs/en/writing-posts)
- [Additional styles](https://tianqi.name/jekyll-TeXt-theme/docs/en/additional-styles)
- [Extensions](https://tianqi.name/jekyll-TeXt-theme/docs/en/extensions)
- [Markdown Enhancements](https://tianqi.name/jekyll-TeXt-theme/docs/en/markdown-enhancements)
- [Writing Posts](https://kitian616.github.io/jekyll-TeXt-theme/docs/en/writing-posts)
- [Additional styles](https://kitian616.github.io/jekyll-TeXt-theme/docs/en/additional-styles)
- [Extensions](https://kitian616.github.io/jekyll-TeXt-theme/docs/en/extensions)
- [Markdown Enhancements](https://kitian616.github.io/jekyll-TeXt-theme/docs/en/markdown-enhancements)

## Demo Pages

| Name | Description |
| --- | --- |
| [Home](https://tianqi.name/jekyll-TeXt-theme/test/) | Home page |
| [Archive](https://tianqi.name/jekyll-TeXt-theme/archive.html) | Archive page |
| [Layout Examples](https://tianqi.name/jekyll-TeXt-theme/samples.html) | Examples for different layouts |
| [Home](https://kitian616.github.io/jekyll-TeXt-theme/test/) | Home page |
| [Archive](https://kitian616.github.io/jekyll-TeXt-theme/archive.html) | Archive page |
| [Layout Examples](https://kitian616.github.io/jekyll-TeXt-theme/samples.html) | Examples for different layouts |

## License

Expand Down
Loading