Skip to content

Commit 8bf72fc

Browse files
Merge branch 'production'
2 parents 1bac96a + c0e4756 commit 8bf72fc

File tree

5 files changed

+31
-23
lines changed

5 files changed

+31
-23
lines changed

_includes/post-description.html

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,29 @@
22
Get post description or generate it from the post content.
33
{%- endcomment -%}
44

5-
{%- assign max_length = include.max_length | default: 200 -%}
6-
75
{%- capture description -%}
8-
{%- if post.description -%}
9-
{{- post.description -}}
10-
{%- else -%}
11-
{% comment %}
12-
Remove the line number of the code snippet.
13-
{% endcomment %}
14-
{% assign content = post.content %}
6+
{%- if post.description -%}
7+
{{- post.description -}}
8+
{%- else -%}
9+
{% comment %}
10+
Remove the line number of the code snippet.
11+
{% endcomment %}
12+
{%- assign content = post.content -%}
1513

16-
{% if content contains '<td class="rouge-gutter gl"><pre class="lineno">' %}
17-
{% assign content = content | replace: '<td class="rouge-gutter gl"><pre class="lineno">', '<!-- <td class="rouge-gutter gl"><pre class="lineno">'%}
18-
{% assign content = content | replace: '</td><td class="rouge-code">', '</td> --><td class="rouge-code">' %}
19-
{% endif %}
14+
{%- if content contains '<td class="rouge-gutter gl"><pre class="lineno">' -%}
15+
{%- assign content = content | replace: '<td class="rouge-gutter gl"><pre class="lineno">', '<!-- <td class="rouge-gutter gl"><pre class="lineno">' -%}
16+
{%- assign content = content | replace: '</td><td class="rouge-code">', '</td> --><td class="rouge-code">' -%}
17+
{%- endif -%}
2018

21-
{{- content | markdownify | strip_html | newline_to_br | replace: '<br />', ' ' | strip_newlines -}}
22-
{%- endif -%}
19+
{{- content | strip_html | newline_to_br | replace: '<br />', ' ' | strip_newlines -}}
20+
{%- endif -%}
2321
{%- endcapture -%}
2422

25-
{{- description | strip | truncate: max_length | escape -}}
23+
{%- if include.json -%}
24+
{%- assign description = description | jsonify -%}
25+
{%- else -%}
26+
{%- assign max_length = include.max_length | default: 200 -%}
27+
{%- assign description = description | strip | truncate: max_length -%}
28+
{%- endif -%}
29+
30+
{{- description -}}

assets/js/data/search.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,13 @@ swcache: true
55

66
[
77
{% for post in site.posts %}
8-
{%- capture description -%}
9-
{% include post-description.html %}
10-
{%- endcapture -%}
118
{
129
"title": {{ post.title | jsonify }},
1310
"url": {{ post.url | relative_url | jsonify }},
1411
"categories": {{ post.categories | join: ', ' | jsonify }},
1512
"tags": {{ post.tags | join: ', ' | jsonify }},
16-
"date": "{{ post.date }}",
17-
"content": "{{ description }}"
13+
"date": {{ post.date | jsonify }},
14+
"content": {% include post-description.html json=true %}
1815
}{% unless forloop.last %},{% endunless %}
1916
{% endfor %}
2017
]

docs/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## [7.3.1](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v7.3.0...v7.3.1) (2025-07-26)
4+
5+
### Bug Fixes
6+
7+
* 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))
8+
39
## [7.3.0](https://github.com/cotes2020/jekyll-theme-chirpy/compare/v7.2.4...v7.3.0) (2025-05-18)
410

511
### Features

jekyll-theme-chirpy.gemspec

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

33
Gem::Specification.new do |spec|
44
spec.name = "jekyll-theme-chirpy"
5-
spec.version = "7.3.0"
5+
spec.version = "7.3.1"
66
spec.authors = ["Cotes Chung"]
77
spec.email = ["[email protected]"]
88

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jekyll-theme-chirpy",
3-
"version": "7.3.0",
3+
"version": "7.3.1",
44
"description": "A minimal, responsive, and feature-rich Jekyll theme for technical writing.",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)