1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-10-20 17:53:45 +00:00

Merge branch 'production'

This commit is contained in:
semantic-release-bot 2025-07-26 12:25:02 +00:00
commit 8bf72fc234
5 changed files with 31 additions and 23 deletions

View File

@ -2,24 +2,29 @@
Get post description or generate it from the post content. Get post description or generate it from the post content.
{%- endcomment -%} {%- endcomment -%}
{%- assign max_length = include.max_length | default: 200 -%}
{%- capture description -%} {%- capture description -%}
{%- if post.description -%} {%- if post.description -%}
{{- post.description -}} {{- post.description -}}
{%- else -%} {%- else -%}
{% comment %} {% comment %}
Remove the line number of the code snippet. Remove the line number of the code snippet.
{% endcomment %} {% endcomment %}
{% assign content = post.content %} {%- assign content = post.content -%}
{% if content contains '<td class="rouge-gutter gl"><pre class="lineno">' %} {%- if content contains '<td class="rouge-gutter gl"><pre class="lineno">' -%}
{% assign content = content | replace: '<td class="rouge-gutter gl"><pre class="lineno">', '<!-- <td class="rouge-gutter gl"><pre class="lineno">'%} {%- assign content = content | replace: '<td class="rouge-gutter gl"><pre class="lineno">', '<!-- <td class="rouge-gutter gl"><pre class="lineno">' -%}
{% assign content = content | replace: '</td><td class="rouge-code">', '</td> --><td class="rouge-code">' %} {%- assign content = content | replace: '</td><td class="rouge-code">', '</td> --><td class="rouge-code">' -%}
{% endif %} {%- endif -%}
{{- content | markdownify | strip_html | newline_to_br | replace: '<br />', ' ' | strip_newlines -}} {{- content | strip_html | newline_to_br | replace: '<br />', ' ' | strip_newlines -}}
{%- endif -%} {%- endif -%}
{%- endcapture -%} {%- endcapture -%}
{{- description | strip | truncate: max_length | escape -}} {%- if include.json -%}
{%- assign description = description | jsonify -%}
{%- else -%}
{%- assign max_length = include.max_length | default: 200 -%}
{%- assign description = description | strip | truncate: max_length -%}
{%- endif -%}
{{- description -}}

View File

@ -5,16 +5,13 @@ swcache: true
[ [
{% for post in site.posts %} {% for post in site.posts %}
{%- capture description -%}
{% include post-description.html %}
{%- endcapture -%}
{ {
"title": {{ post.title | jsonify }}, "title": {{ post.title | jsonify }},
"url": {{ post.url | relative_url | jsonify }}, "url": {{ post.url | relative_url | jsonify }},
"categories": {{ post.categories | join: ', ' | jsonify }}, "categories": {{ post.categories | join: ', ' | jsonify }},
"tags": {{ post.tags | join: ', ' | jsonify }}, "tags": {{ post.tags | join: ', ' | jsonify }},
"date": "{{ post.date }}", "date": {{ post.date | jsonify }},
"content": "{{ description }}" "content": {% include post-description.html json=true %}
}{% unless forloop.last %},{% endunless %} }{% unless forloop.last %},{% endunless %}
{% endfor %} {% endfor %}
] ]

View File

@ -1,5 +1,11 @@
# Changelog # Changelog
## [7.3.1](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v7.3.0...v7.3.1) (2025-07-26)
### Bug Fixes
* escape special JSON characters in search results ([#2481](https://github.com/cotes2020/jekyll-theme-chirpy/issues/2481)) ([7615d72](https://github.com/cotes2020/jekyll-theme-chirpy/commit/7615d72e9300a1514ef2fc8ec941ab2974ba7eb4))
## [7.3.0](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v7.2.4...v7.3.0) (2025-05-18) ## [7.3.0](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v7.2.4...v7.3.0) (2025-05-18)
### Features ### Features

View File

@ -2,7 +2,7 @@
Gem::Specification.new do |spec| Gem::Specification.new do |spec|
spec.name = "jekyll-theme-chirpy" spec.name = "jekyll-theme-chirpy"
spec.version = "7.3.0" spec.version = "7.3.1"
spec.authors = ["Cotes Chung"] spec.authors = ["Cotes Chung"]
spec.email = ["cotes.chung@gmail.com"] spec.email = ["cotes.chung@gmail.com"]

View File

@ -1,6 +1,6 @@
{ {
"name": "jekyll-theme-chirpy", "name": "jekyll-theme-chirpy",
"version": "7.3.0", "version": "7.3.1",
"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",