Skip to content
Merged
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
10 changes: 0 additions & 10 deletions _includes/no-linenos.html

This file was deleted.

11 changes: 10 additions & 1 deletion _includes/post-description.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,16 @@
{%- if post.description -%}
{{- post.description -}}
{%- else -%}
{%- include no-linenos.html content=post.content -%}
{% 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 -}}
{%- endif -%}
{%- endcapture -%}
Expand Down
2 changes: 1 addition & 1 deletion _includes/search-loader.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h2><a href="{url}">{title}</a></h2>
{tags}
</div>
</header>
<p>{snippet}</p>
<p>{content}</p>
</article>
{% endcapture %}

Expand Down
8 changes: 4 additions & 4 deletions assets/js/data/search.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ swcache: true

[
{% for post in site.posts %}
{%- capture description -%}
{% include post-description.html %}
{%- endcapture -%}
{
"title": {{ post.title | jsonify }},
"url": {{ post.url | relative_url | jsonify }},
"categories": {{ post.categories | join: ', ' | jsonify }},
"tags": {{ post.tags | join: ', ' | jsonify }},
"date": "{{ post.date }}",
{% include no-linenos.html content=post.content %}
{% assign _content = content | strip_html | strip_newlines %}
"snippet": {{ _content | truncate: 200 | jsonify }},
"content": {{ _content | jsonify }}
"content": "{{ description | newline_to_br | replace: '<br />', ' ' | strip_newlines }}"
}{% unless forloop.last %},{% endunless %}
{% endfor %}
]
Loading