1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-19 14:14:17 +00:00

Compare commits

..

16 Commits

Author SHA1 Message Date
Cotes Chung
2b9d379d70 chore(release): 6.3.0 2023-11-10 20:10:34 +08:00
Cotes Chung
bdee5d6b6d Merge branch 'master' into production 2023-11-10 20:09:30 +08:00
Cotes Chung
348f6bff8b chore: add a period at the end of the meta info 2023-11-10 20:08:08 +08:00
Cotes Chung
7a3d624364 chore(deps-dev): reduce external config files 2023-11-09 01:53:47 +08:00
Cotes Chung
06f1c6f256 refactor: align the position of the share buttons 2023-11-08 01:16:00 +08:00
Cotes Chung
4a7f33f7bb build(tools): improve the release script 2023-11-07 03:38:02 +08:00
Cotes Chung
e077d2911d chore(deps): upgrade dependent libraries 2023-11-07 03:29:28 +08:00
dependabot[bot]
5f2edb0914 build(deps-dev): bump the npm group with 8 updates (#1365)
Updates the requirements on [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core), [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env), [@rollup/plugin-babel](https://github.com/rollup/plugins/tree/HEAD/packages/babel), [@rollup/plugin-terser](https://github.com/rollup/plugins/tree/HEAD/packages/terser), [rollup](https://github.com/rollup/rollup), [rollup-plugin-license](https://github.com/mjeanroy/rollup-plugin-license), [stylelint](https://github.com/stylelint/stylelint) and [stylelint-config-standard-scss](https://github.com/stylelint-scss/stylelint-config-standard-scss) to permit the latest version.

Updates `@babel/core` to 7.23.2
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/@babel/core@7.23.2/packages/babel-core)

Updates `@babel/preset-env` to 7.23.2
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-preset-env)

Updates `@rollup/plugin-babel` to 6.0.4
- [Changelog](https://github.com/rollup/plugins/blob/master/packages/babel/CHANGELOG.md)
- [Commits](https://github.com/rollup/plugins/commits/babel-v6.0.4/packages/babel)

Updates `@rollup/plugin-terser` to 0.4.4
- [Changelog](https://github.com/rollup/plugins/blob/master/packages/terser/CHANGELOG.md)
- [Commits](https://github.com/rollup/plugins/commits/terser-v0.4.4/packages/terser)

Updates `rollup` from 3.29.4 to 4.3.0
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v3.29.4...v4.3.0)

Updates `rollup-plugin-license` to 3.2.0
- [Changelog](https://github.com/mjeanroy/rollup-plugin-license/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mjeanroy/rollup-plugin-license/compare/v3.1.0...v3.2.0)

Updates `stylelint` to 15.11.0
- [Release notes](https://github.com/stylelint/stylelint/releases)
- [Changelog](https://github.com/stylelint/stylelint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/stylelint/stylelint/compare/15.10.3...15.11.0)

Updates `stylelint-config-standard-scss` to 11.1.0
- [Release notes](https://github.com/stylelint-scss/stylelint-config-standard-scss/releases)
- [Changelog](https://github.com/stylelint-scss/stylelint-config-standard-scss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/stylelint-scss/stylelint-config-standard-scss/compare/v11.0.0...v11.1.0)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:development
  dependency-group: npm
- dependency-name: "@babel/preset-env"
  dependency-type: direct:development
  dependency-group: npm
- dependency-name: "@rollup/plugin-babel"
  dependency-type: direct:development
  dependency-group: npm
- dependency-name: "@rollup/plugin-terser"
  dependency-type: direct:development
  dependency-group: npm
- dependency-name: rollup
  dependency-type: direct:development
  update-type: version-update:semver-major
  dependency-group: npm
- dependency-name: rollup-plugin-license
  dependency-type: direct:development
  dependency-group: npm
- dependency-name: stylelint
  dependency-type: direct:development
  dependency-group: npm
- dependency-name: stylelint-config-standard-scss
  dependency-type: direct:development
  dependency-group: npm
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-06 15:33:59 +08:00
Cotes Chung
911206be80 build(gh): reduce the frequency of dependabot PR submissions 2023-11-06 15:26:09 +08:00
Cotes Chung
18808851a9 build(deps): upgrade rubygem-deps
Ruby 2.x has passed its end of life and is now unsupported.
2023-11-06 15:26:03 +08:00
Natalie Somersall
2bf87e0de7 feat: add Mastodon sharing link (#1344)
Adds a "share to Mastodon" button as a link sharing option using @justinribeiro's share-to-mastodon package

Discussion of proposed change - #1324

---------

Co-authored-by: Cotes Chung <11371340+cotes2020@users.noreply.github.com>
2023-10-30 02:02:58 +08:00
dependabot[bot]
f6d96ab2b8 build(deps): upgrade actions/checkout to v4 (#1340)
Bumps the gh-actions group with 1 update: [actions/setup-node](https://github.com/actions/setup-node).

- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](https://github.com/actions/setup-node/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: gh-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-24 03:43:40 +08:00
Cotes Chung
59c55121c7 docs: update project description 2023-10-23 05:41:55 +08:00
Cotes Chung
9f174d9088 fix: resume lazy loading for Twitch videos (#1326)
The property of lazy load is missing in #1267
2023-10-16 05:20:42 +08:00
Cotes Chung
5810bcd1d7 fix(home): crop the preview image that doesn't match 1.91:1 (#1325) 2023-10-16 01:51:02 +08:00
Cotes Chung
897b57bfb4 chore(release): 6.2.3 2023-10-10 13:00:55 +08:00
22 changed files with 218 additions and 174 deletions

View File

@@ -1,5 +0,0 @@
# https://github.com/browserslist/browserslist#browserslistrc
last 2 versions
> 0.2%
not dead

View File

@@ -1,8 +0,0 @@
{
"rules": {
"body-max-line-length": [
0,
"always"
]
}
}

View File

@@ -7,7 +7,7 @@ updates:
bundler: bundler:
dependency-type: "production" dependency-type: "production"
schedule: schedule:
interval: "weekly" interval: "monthly"
- package-ecosystem: "npm" - package-ecosystem: "npm"
directory: "/" directory: "/"
versioning-strategy: increase versioning-strategy: increase
@@ -15,7 +15,7 @@ updates:
npm: npm:
dependency-type: "development" dependency-type: "development"
schedule: schedule:
interval: "weekly" interval: "monthly"
- package-ecosystem: "github-actions" - package-ecosystem: "github-actions"
directory: "/" directory: "/"
groups: groups:
@@ -23,4 +23,4 @@ updates:
update-types: update-types:
- "major" - "major"
schedule: schedule:
interval: "weekly" interval: "monthly"

View File

@@ -19,10 +19,6 @@ jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
matrix:
ruby: [2.7, 3]
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
@@ -32,11 +28,11 @@ jobs:
- name: Setup Ruby - name: Setup Ruby
uses: ruby/setup-ruby@v1 uses: ruby/setup-ruby@v1
with: with:
ruby-version: ${{ matrix.ruby }} ruby-version: 3
bundler-cache: true bundler-cache: true
- name: Setup Node - name: Setup Node
uses: actions/setup-node@v3 uses: actions/setup-node@v4
- name: Build Assets - name: Build Assets
run: npm i && npm run build run: npm i && npm run build

View File

@@ -20,6 +20,6 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup Node - name: Setup Node
uses: actions/setup-node@v3 uses: actions/setup-node@v4
- run: npm i - run: npm i
- run: npm test - run: npm test

View File

@@ -1,3 +0,0 @@
{
"trailingComma": "none"
}

View File

@@ -1,23 +0,0 @@
{
"extends": "stylelint-config-standard-scss",
"rules": {
"no-descending-specificity": null,
"shorthand-property-no-redundant-values": null,
"at-rule-no-vendor-prefix": null,
"property-no-vendor-prefix": null,
"selector-no-vendor-prefix": null,
"value-no-vendor-prefix": null,
"color-function-notation": "legacy",
"alpha-value-notation": "number",
"selector-not-notation": "simple",
"color-hex-length": "long",
"declaration-block-single-line-max-declarations": 3,
"scss/operator-no-newline-after": null,
"rule-empty-line-before": [
"always",
{ "ignore": ["after-comment", "first-nested"] }
],
"value-keyword-case": ["lower", { "ignoreProperties": ["/^\\$/"] }],
"media-feature-range-notation": "prefix"
}
}

View File

@@ -1,20 +0,0 @@
{
"skip": {
"commit": true,
"tag": true
},
"types": [
{
"type": "feat",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "perf",
"section": "Improvements"
}
]
}

View File

@@ -2,7 +2,7 @@
# Chirpy Jekyll Theme # Chirpy Jekyll Theme
A minimal, responsive and feature-rich Jekyll theme for technical writing. A minimal, responsive, and feature-rich Jekyll theme for technical writing.
[![Gem Version](https://img.shields.io/gem/v/jekyll-theme-chirpy?color=brightgreen)][gem]&nbsp; [![Gem Version](https://img.shields.io/gem/v/jekyll-theme-chirpy?color=brightgreen)][gem]&nbsp;
[![CI](https://github.com/cotes2020/jekyll-theme-chirpy/actions/workflows/ci.yml/badge.svg?branch=master&event=push)][ci]&nbsp; [![CI](https://github.com/cotes2020/jekyll-theme-chirpy/actions/workflows/ci.yml/badge.svg?branch=master&event=push)][ci]&nbsp;
@@ -55,9 +55,9 @@ For details, see the "[Contributing Guidelines][contribute-guide]".
## Credits ## Credits
This project is mainly built with [Jekyll][jekyllrb] ecosystem, This project was built primarily with the [Jekyll][jekyllrb] ecosystem,
[Bootstrap][bootstrap], [Font Awesome][icons], and some other [wonderful tools][lib]. [Bootstrap][bootstrap], [Font Awesome][icons], and some other [wonderful tools][lib].
The avatar and favicon design come from [Clipart Max][image]. The avatar and favicon design from [Clipart Max][image].
Many thanks to the [contributors][contributors] who participated in the development Many thanks to the [contributors][contributors] who participated in the development
and to the folks who reported bugs or shared ideas. and to the folks who reported bugs or shared ideas.

View File

@@ -40,7 +40,7 @@ copyright:
Except where otherwise noted, the blog posts on this site are licensed Except where otherwise noted, the blog posts on this site are licensed
under the Creative Commons Attribution 4.0 International (CC BY 4.0) License by the author. under the Creative Commons Attribution 4.0 International (CC BY 4.0) License by the author.
meta: Using the :THEME theme for :PLATFORM meta: Using the :THEME theme for :PLATFORM.
not_found: not_found:
statment: Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. statment: Sorry, we've misplaced that URL or it's pointing to something that doesn't exist.

View File

@@ -23,8 +23,8 @@ bootstrap:
js: https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js js: https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js
toc: toc:
css: https://cdn.jsdelivr.net/npm/tocbot@4.21.2/dist/tocbot.min.css css: https://cdn.jsdelivr.net/npm/tocbot@4.21.3/dist/tocbot.min.css
js: https://cdn.jsdelivr.net/npm/tocbot@4.21.2/dist/tocbot.min.js js: https://cdn.jsdelivr.net/npm/tocbot@4.21.3/dist/tocbot.min.js
fontawesome: fontawesome:
css: https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.4.2/css/all.min.css css: https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.4.2/css/all.min.css
@@ -33,7 +33,7 @@ search:
js: https://cdn.jsdelivr.net/npm/simple-jekyll-search@1.10.0/dest/simple-jekyll-search.min.js js: https://cdn.jsdelivr.net/npm/simple-jekyll-search@1.10.0/dest/simple-jekyll-search.min.js
mermaid: mermaid:
js: https://cdn.jsdelivr.net/npm/mermaid@10.5.0/dist/mermaid.min.js js: https://cdn.jsdelivr.net/npm/mermaid@10.6.0/dist/mermaid.min.js
dayjs: dayjs:
js: js:

View File

@@ -23,3 +23,16 @@ platforms:
# - type: Weibo # - type: Weibo
# icon: "fab fa-weibo" # icon: "fab fa-weibo"
# link: "http://service.weibo.com/share/share.php?title=TITLE&url=URL" # link: "http://service.weibo.com/share/share.php?title=TITLE&url=URL"
#
# - type: Mastodon
# icon: "fa-brands fa-mastodon"
# # See: https://github.com/justinribeiro/share-to-mastodon#properties
# instances:
# - label: mastodon.social
# link: "https://mastodon.social/"
# - label: mastodon.online
# link: "https://mastodon.online/"
# - label: fosstodon.org
# link: "https://fosstodon.org/"
# - label: photog.social
# link: "https://photog.social/"

View File

@@ -1,5 +1,6 @@
<iframe <iframe
class="embed-video twitch" class="embed-video twitch"
loading="lazy"
src="https://player.twitch.tv/?video={{ include.id }}&parent={{ site.url | split: '://' | last | remove: '/' }}" src="https://player.twitch.tv/?video={{ include.id }}&parent={{ site.url | split: '://' | last | remove: '/' }}"
frameborder="0" frameborder="0"
allowfullscreen="true" allowfullscreen="true"

View File

@@ -1,24 +1,39 @@
<!-- Post sharing snippet --> <!-- Post sharing snippet -->
<div class="share-wrapper d-flex align-items-center"> <div class="share-wrapper d-flex align-items-center">
<span class="share-label text-muted me-1">{{ site.data.locales[include.lang].post.share }}</span> <span class="share-label text-muted">{{ site.data.locales[include.lang].post.share }}</span>
<span class="share-icons"> <span class="share-icons">
{% capture title %}{{ page.title }} - {{ site.title }}{% endcapture %} {% capture title %}{{ page.title }} - {{ site.title }}{% endcapture %}
{% assign title = title | uri_escape %} {% assign title = title | uri_escape %}
{% assign url = page.url | absolute_url | url_encode %} {% assign url = page.url | absolute_url | url_encode %}
{% for share in site.data.share.platforms %} {% for share in site.data.share.platforms -%}
{% assign link = share.link | replace: 'TITLE', title | replace: 'URL', url %} {%- capture tooltip -%}
<a data-bs-toggle="tooltip" data-bs-placement="top" title="{{ share.type }}" aria-label="{{ share.type }}"
href="{{ link }}" {%- endcapture -%}
data-bs-toggle="tooltip"
data-bs-placement="top" {% if share.type == 'Mastodon' %}
title="{{ share.type }}" <script defer type="module" src="https://cdn.jsdelivr.net/npm/@justinribeiro/share-to-mastodon/+esm"></script>
target="_blank" <button class="btn text-start" {{ tooltip }}>
rel="noopener" <share-to-mastodon
aria-label="{{ share.type }}" class="share-mastodon"
message="{{ title }}"
url="{{ url }}"
{%- if share.instances -%}
customInstanceList="{{ share.instances | jsonify | xml_escape }}"
{%- endif %}
> >
<i class="fa-fw {{ share.icon }}"></i> <i class="fa-fw {{ share.icon }}"></i>
</share-to-mastodon>
</button>
{% continue %}
{% endif %}
{% assign link = share.link | replace: 'TITLE', title | replace: 'URL', url %}
<a href="{{ link }}" target="_blank" rel="noopener" {{ tooltip }}>
<i class="fa-fw {{ share.icon }}"></i>
</a> </a>
{% endfor %} {% endfor %}
@@ -31,7 +46,7 @@
title="{{ site.data.locales[include.lang].post.button.share_link.title }}" title="{{ site.data.locales[include.lang].post.button.share_link.title }}"
data-title-succeed="{{ site.data.locales[include.lang].post.button.share_link.succeed }}" data-title-succeed="{{ site.data.locales[include.lang].post.button.share_link.succeed }}"
> >
<i class="fa-fw fas fa-link pe-none"></i> <i class="fa-fw fas fa-link pe-none fs-6"></i>
</button> </button>
</span> </span>
</div> </div>

View File

@@ -309,7 +309,6 @@ sup {
.preview-img { .preview-img {
aspect-ratio: 40 / 21; aspect-ratio: 40 / 21;
width: 100%; width: 100%;
height: 100%;
overflow: hidden; overflow: hidden;
@extend %rounded; @extend %rounded;
@@ -324,6 +323,10 @@ sup {
object-fit: cover; object-fit: cover;
@extend %rounded; @extend %rounded;
@at-root #post-list & {
width: 100%;
}
} }
} }

View File

@@ -63,7 +63,8 @@
/* Posts */ /* Posts */
--toc-highlight: #0550ae; --toc-highlight: #0550ae;
--btn-share-hover-color: var(--link-color); --btn-share-color: gray;
--btn-share-hover-color: #0d6efd;
--card-bg: white; --card-bg: white;
--card-hovor-bg: #e2e2e2; --card-hovor-bg: #e2e2e2;
--card-shadow: rgb(104, 104, 104, 0.05) 0 2px 6px 0, --card-shadow: rgb(104, 104, 104, 0.05) 0 2px 6px 0,

View File

@@ -2,14 +2,6 @@
Post-specific style Post-specific style
*/ */
@mixin btn-sharing-color($light-color, $important: false) {
@if $important {
color: var(--btn-share-color, $light-color) !important;
} @else {
color: var(--btn-share-color, $light-color);
}
}
%btn-post-nav { %btn-post-nav {
width: 50%; width: 50%;
position: relative; position: relative;
@@ -72,11 +64,23 @@ h1 + .post-meta {
-ms-user-select: none; -ms-user-select: none;
user-select: none; user-select: none;
%icon-size {
font-size: 1.125rem;
}
.share-icons { .share-icons {
font-size: 1.2rem; display: flex;
i {
color: var(--btn-share-color);
@extend %icon-size;
}
> * { > * {
margin-left: 0.25rem; @extend %icon-size;
margin-left: 0.5rem;
&:hover { &:hover {
i { i {
@@ -86,44 +90,29 @@ h1 + .post-meta {
} }
button { button {
position: relative;
bottom: 2px;
padding: 0; padding: 0;
border: none;
line-height: inherit;
@extend %cursor-pointer; @extend %cursor-pointer;
} }
a :hover {
text-decoration: none;
}
.fa-square-x-twitter {
@include btn-sharing-color(black);
}
.fa-facebook-square {
@include btn-sharing-color(rgb(66, 95, 156));
}
.fa-telegram {
@include btn-sharing-color(rgb(39, 159, 217));
}
.fa-linkedin {
@include btn-sharing-color(rgb(0, 119, 181));
}
.fa-weibo {
@include btn-sharing-color(rgb(229, 20, 43));
}
} /* .share-icons */ } /* .share-icons */
.fas.fa-link {
@include btn-sharing-color(rgb(171, 171, 171));
}
} /* .share-wrapper */ } /* .share-wrapper */
} }
.share-mastodon {
/* See: https://github.com/justinribeiro/share-to-mastodon#properties */
--wc-stm-font-family: $font-family-base;
--wc-stm-dialog-background-color: var(--card-bg);
--wc-stm-form-button-border: 1px solid var(--btn-border-color);
--wc-stm-form-submit-background-color: var(--sidebar-btn-bg);
--wc-stm-form-cancel-background-color: var(--sidebar-btn-bg);
--wc-stm-form-button-background-color-hover: #007bff;
--wc-stm-form-button-color-hover: white;
font-size: 1rem;
}
.post-tags { .post-tags {
line-height: 2rem; line-height: 2rem;

View File

@@ -2,6 +2,17 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
## [6.3.0](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v6.2.3...v6.3.0) (2023-11-10)
### Features
* add Mastodon sharing link ([#1344](https://github.com/cotes2020/jekyll-theme-chirpy/issues/1344)) ([2bf87e0](https://github.com/cotes2020/jekyll-theme-chirpy/commit/2bf87e0de7928f325811e1bb96cfcaefdf6cf66a)), closes [#1324](https://github.com/cotes2020/jekyll-theme-chirpy/issues/1324)
### Bug Fixes
* **home:** crop the preview image that doesn't match 1.91:1 ([#1325](https://github.com/cotes2020/jekyll-theme-chirpy/issues/1325)) ([5810bcd](https://github.com/cotes2020/jekyll-theme-chirpy/commit/5810bcd1d7b83e111017831fa82c368a6b15c7cd))
* resume lazy loading for Twitch videos ([#1326](https://github.com/cotes2020/jekyll-theme-chirpy/issues/1326)) ([9f174d9](https://github.com/cotes2020/jekyll-theme-chirpy/commit/9f174d9088e5c83a5e0c4630336cea65e199c553)), closes [#1267](https://github.com/cotes2020/jekyll-theme-chirpy/issues/1267)
## [6.2.3](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v6.2.2...v6.2.3) (2023-10-10) ## [6.2.3](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v6.2.2...v6.2.3) (2023-10-10)
### Bug Fixes ### Bug Fixes

View File

@@ -2,11 +2,11 @@
Gem::Specification.new do |spec| Gem::Specification.new do |spec|
spec.name = "jekyll-theme-chirpy" spec.name = "jekyll-theme-chirpy"
spec.version = "6.2.3" spec.version = "6.3.0"
spec.authors = ["Cotes Chung"] spec.authors = ["Cotes Chung"]
spec.email = ["cotes.chung@gmail.com"] spec.email = ["cotes.chung@gmail.com"]
spec.summary = "A minimal, responsive and feature-rich Jekyll theme for technical writing." spec.summary = "A minimal, responsive, and feature-rich Jekyll theme for technical writing."
spec.homepage = "https://github.com/cotes2020/jekyll-theme-chirpy" spec.homepage = "https://github.com/cotes2020/jekyll-theme-chirpy"
spec.license = "MIT" spec.license = "MIT"
@@ -23,12 +23,12 @@ Gem::Specification.new do |spec|
"plugin_type" => "theme" "plugin_type" => "theme"
} }
spec.required_ruby_version = ">= 2.6" spec.required_ruby_version = ">= 3.0"
spec.add_runtime_dependency "jekyll", "~> 4.3" spec.add_runtime_dependency "jekyll", "~> 4.3"
spec.add_runtime_dependency "jekyll-paginate", "~> 1.1" spec.add_runtime_dependency "jekyll-paginate", "~> 1.1"
spec.add_runtime_dependency "jekyll-redirect-from", "~> 0.16" spec.add_runtime_dependency "jekyll-redirect-from", "~> 0.16"
spec.add_runtime_dependency "jekyll-seo-tag", "~> 2.7" spec.add_runtime_dependency "jekyll-seo-tag", "~> 2.8"
spec.add_runtime_dependency "jekyll-archives", "~> 2.2" spec.add_runtime_dependency "jekyll-archives", "~> 2.2"
spec.add_runtime_dependency "jekyll-sitemap", "~> 1.4" spec.add_runtime_dependency "jekyll-sitemap", "~> 1.4"
spec.add_runtime_dependency "jekyll-include-cache", "~> 0.2" spec.add_runtime_dependency "jekyll-include-cache", "~> 0.2"

View File

@@ -1,7 +1,7 @@
{ {
"name": "jekyll-theme-chirpy", "name": "jekyll-theme-chirpy",
"version": "6.2.3", "version": "6.3.0",
"description": "A minimal, responsive and feature-rich Jekyll theme for technical writing.", "description": "A minimal, responsive, and feature-rich Jekyll theme for technical writing.",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/cotes2020/jekyll-theme-chirpy.git" "url": "git+https://github.com/cotes2020/jekyll-theme-chirpy.git"
@@ -21,15 +21,86 @@
"fixlint": "npm run test -- --fix" "fixlint": "npm run test -- --fix"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.23.0", "@babel/core": "^7.23.2",
"@babel/plugin-proposal-class-properties": "^7.18.6", "@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/preset-env": "^7.22.20", "@babel/preset-env": "^7.23.2",
"@rollup/plugin-babel": "^6.0.3", "@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-terser": "^0.4.3", "@rollup/plugin-terser": "^0.4.4",
"rimraf": "^5.0.5", "rimraf": "^5.0.5",
"rollup": "^3.29.4", "rollup": "^4.3.0",
"rollup-plugin-license": "^3.1.0", "rollup-plugin-license": "^3.2.0",
"stylelint": "^15.10.3", "stylelint": "^15.11.0",
"stylelint-config-standard-scss": "^11.0.0" "stylelint-config-standard-scss": "^11.1.0"
},
"prettier": {
"trailingComma": "none"
},
"browserslist": [
"last 2 versions",
"> 0.2%",
"not dead"
],
"commitlint": {
"rules": {
"body-max-line-length": [
0,
"always"
]
}
},
"stylelint": {
"extends": "stylelint-config-standard-scss",
"rules": {
"no-descending-specificity": null,
"shorthand-property-no-redundant-values": null,
"at-rule-no-vendor-prefix": null,
"property-no-vendor-prefix": null,
"selector-no-vendor-prefix": null,
"value-no-vendor-prefix": null,
"color-function-notation": "legacy",
"alpha-value-notation": "number",
"selector-not-notation": "simple",
"color-hex-length": "long",
"declaration-block-single-line-max-declarations": 3,
"scss/operator-no-newline-after": null,
"rule-empty-line-before": [
"always",
{
"ignore": [
"after-comment",
"first-nested"
]
}
],
"value-keyword-case": [
"lower",
{
"ignoreProperties": [
"/^\\$/"
]
}
],
"media-feature-range-notation": "prefix"
}
},
"standard-version": {
"skip": {
"commit": true,
"tag": true
},
"types": [
{
"type": "feat",
"section": "Features"
},
{
"type": "fix",
"section": "Bug Fixes"
},
{
"type": "perf",
"section": "Improvements"
}
]
} }
} }

View File

@@ -8,7 +8,7 @@
# and production branch. # and production branch.
# #
# #
# Usage: run on main branch or the patch branch # Usage: run on the default, release or the patch branch
# #
# Requires: Git, NPM and RubyGems # Requires: Git, NPM and RubyGems
@@ -18,8 +18,7 @@ opt_pre=false # preview mode option
working_branch="$(git branch --show-current)" working_branch="$(git branch --show-current)"
# AKA the default branch, main/master branch DEFAULT_BRANCH="$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')"
STAGING_BRANCH="$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')"
PROD_BRANCH="production" PROD_BRANCH="production"
@@ -65,15 +64,16 @@ _check_cli() {
} }
_check_git() { _check_git() {
# ensure nothing is uncommitted # ensure that changes have been committed
if [[ -n $(git status . -s) ]]; then if [[ -n $(git status . -s) ]]; then
echo "> Abort: Commit the staged files first, and then run this tool again." echo "> Abort: Commit the staged files first, and then run this tool again."
exit 1 exit 1
fi fi
# ensure the working branch is the default/patch branch if [[ $working_branch != "$DEFAULT_BRANCH" &&
if [[ $working_branch != "$STAGING_BRANCH" && $working_branch != hotfix/* ]]; then $working_branch != hotfix/* &&
echo "> Abort: Please run on the $STAGING_BRANCH branch or a patch branche." $working_branch != "$PROD_BRANCH" ]]; then
echo "> Abort: Please run on the default, release or patch branch."
exit 1 exit 1
fi fi
} }
@@ -101,14 +101,16 @@ check() {
_check_node_packages _check_node_packages
} }
# auto-generate a new version number to the file 'package.json' and # Auto-generate a new version number to the file 'package.json'
bump_node() { bump_node() {
bump="standard-version -i $CHANGE_LOG"
if $opt_pre; then if $opt_pre; then
standard-version -i "$CHANGE_LOG" -p rc bump="$bump -p rc"
else
standard-version -i "$CHANGE_LOG"
fi fi
eval "$bump"
# Change heading of Patch version to heading level 2 (a bug from `standard-version`) # Change heading of Patch version to heading level 2 (a bug from `standard-version`)
sed -i "s/^### \[/## \[/g" "$CHANGE_LOG" sed -i "s/^### \[/## \[/g" "$CHANGE_LOG"
# Replace multiple empty lines with a single empty line # Replace multiple empty lines with a single empty line
@@ -117,29 +119,34 @@ bump_node() {
## Bump new version to gem config file ## Bump new version to gem config file
bump_gem() { bump_gem() {
sed -i "s/[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+/$1/" "$GEM_SPEC" _ver="$1"
if $opt_pre; then
_ver="${1/-/.}"
fi
sed -i "s/[[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+/$_ver/" "$GEM_SPEC"
} }
# Update the git branches, create a new tag, and then build the gem package. # Creates a new tag on the production branch with the given version number.
release() { # Also commits the changes and merges the production branch into the default branch.
branch() {
_version="$1" # X.Y.Z _version="$1" # X.Y.Z
_latest_commit="$(git rev-parse HEAD)"
git add .
git commit -m "chore(release): $_version"
# Create a new tag on production branch # Create a new tag on production branch
echo -e "> Create tag v$_version\n" echo -e "> Create tag v$_version\n"
git tag "v$_version" git tag "v$_version"
git checkout "$STAGING_BRANCH" git checkout "$DEFAULT_BRANCH"
git merge --no-ff --no-edit "$PROD_BRANCH"
if [[ $working_branch == hotfix/* ]]; then if [[ $working_branch == hotfix/* ]]; then
git merge --no-ff --no-edit "$working_branch"
# delete the patch branch # delete the patch branch
git branch -D "$working_branch" git branch -D "$working_branch"
fi fi
# cherry-pick the latest commit from production branch to default branch
git cherry-pick "$_latest_commit"
} }
## Build a gem package ## Build a gem package
@@ -164,7 +171,7 @@ build_gem() {
main() { main() {
check check
if [[ $opt_pre = false ]]; then if [[ $opt_pre = false && $working_branch != "$PROD_BRANCH" ]]; then
git checkout "$PROD_BRANCH" git checkout "$PROD_BRANCH"
git merge --no-ff --no-edit "$working_branch" git merge --no-ff --no-edit "$working_branch"
fi fi
@@ -175,16 +182,12 @@ main() {
bump_gem "$_version" bump_gem "$_version"
echo -e "> Build the gem package for v$_version\n"
if [[ $opt_pre = false ]]; then if [[ $opt_pre = false ]]; then
echo -e "> Bumped version number to $_version\n" branch "$_version"
git add .
git commit -m "chore(release): $_version"
release "$_version"
fi fi
echo -e "> Build the gem package for v$_version\n"
build_gem build_gem
} }