mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-12-18 05:41:31 +00:00
fix(search): avoid missing spaces between paragraphs in search results (#2199)
- Use a common post-snippet for search results to avoid line break issues - Reduce Jekyll include files to speed up the build - Remove outdated key from search.json
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
{% comment %}
|
||||
Remove the line number of the code snippet.
|
||||
{% endcomment %}
|
||||
|
||||
{% assign content = include.content %}
|
||||
|
||||
{% 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><td class="rouge-code">', '</td> --><td class="rouge-code">' %}
|
||||
{% endif %}
|
||||
@@ -8,8 +8,17 @@
|
||||
{%- if post.description -%}
|
||||
{{- post.description -}}
|
||||
{%- else -%}
|
||||
{%- include no-linenos.html content=post.content -%}
|
||||
{{- content | markdownify | strip_html -}}
|
||||
{% comment %}
|
||||
Remove the line number of the code snippet.
|
||||
{% endcomment %}
|
||||
{% assign content = post.content %}
|
||||
|
||||
{% 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><td class="rouge-code">', '</td> --><td class="rouge-code">' %}
|
||||
{% endif %}
|
||||
|
||||
{{- content | markdownify | strip_html | newline_to_br | replace: '<br />', ' ' | strip_newlines -}}
|
||||
{%- endif -%}
|
||||
{%- endcapture -%}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
{tags}
|
||||
</div>
|
||||
</header>
|
||||
<p>{snippet}</p>
|
||||
<p>{content}</p>
|
||||
</article>
|
||||
{% endcapture %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user