diff --git a/_includes/fixlinenos.html b/_includes/fixlinenos.html index 2f88865..e736923 100644 --- a/_includes/fixlinenos.html +++ b/_includes/fixlinenos.html @@ -3,7 +3,10 @@ https://github.com/penibelst/jekyll-compress-html/issues/101 https://github.com/penibelst/jekyll-compress-html/issues/71#issuecomment-188144901 --> -{% if _content contains '
' %} - {% assign _content = _content | replace: '', '' %} -{% endif %} \ No newline at end of file +{% if include.content contains '' %} + {% assign content = include.content | replace: '', '' %} + {{ content }} +{% else %} + {{ include.content }} +{% endif %} diff --git a/_includes/no-linenos.html b/_includes/no-linenos.html index 0b55105..0b3a1ec 100644 --- a/_includes/no-linenos.html +++ b/_includes/no-linenos.html @@ -1,12 +1,14 @@ {% comment %} - Remove line numbers from code snippets. + Remove the line number of the code snippet. v2.2 https://github.com/cotes2020/jekyll-theme-chirpy © 2020 Cotes Chung Published under the MIT License {% endcomment %} -{% if _content contains ' ' %} - {% assign _content = _content | replace: ' ', '' %} +{% assign content = include.content %} + +{% if content contains ' ' %} + {% assign content = content | replace: ' ', '' %} {% endif %} diff --git a/_includes/related-posts.html b/_includes/related-posts.html index d61f90f..bfe4e49 100644 --- a/_includes/related-posts.html +++ b/_includes/related-posts.html @@ -99,9 +99,10 @@ {{ post.title }}
- {% assign content = post.content %} - {% include no-linenos.html %} -diff --git a/_includes/search-results.html b/_includes/search-results.html index a11832d..078f425 100644 --- a/_includes/search-results.html +++ b/_includes/search-results.html @@ -9,11 +9,14 @@{{ content | markdownify | strip_html | truncate: 200 | replace: '&', '&' }}
++ {% include no-linenos.html content=post.content %} + {{ content | markdownify | strip_html | truncate: 200 }} +
diff --git a/_layouts/default.html b/_layouts/default.html index e0740cc..8c78a51 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -36,15 +36,12 @@ layout: compress{{ site.data.label.panel.trending_tags }}
+ {% include trending-tags.html %} + {% for tag in trending_tags %} {% capture url %}/tags/{{ tag | downcase | url_encode }}/{% endcapture %} {{ tag | replace: '-', ' ' }} - {% endfor %} + {% endfor %} +diff --git a/_layouts/home.html b/_layouts/home.html index 3184071..c6ce1ce 100644 --- a/_layouts/home.html +++ b/_layouts/home.html @@ -58,9 +58,8 @@ layout: page- {% capture _content %} - {{ content }} - {% endcapture %} - - {% include fixlinenos.html %} - {{ _content }} + {% include fixlinenos.html content=content %} {% include footer.html %} ++ {% include search-results.html %}diff --git a/assets/js/data/search.json b/assets/js/data/search.json index de8111d..87badba 100644 --- a/assets/js/data/search.json +++ b/assets/js/data/search.json @@ -10,9 +10,8 @@ layout: compress "categories": "{{ post.categories | join: ', '}}", "tags": "{{ post.tags | join: ', ' }}", "date": "{{ post.date }}", - {% assign _content = post.content %} - {% include no-linenos.html %} - "snippet": "{{ _content | strip_html | strip_newlines | remove_chars | escape | truncate: 300 | replace: '\', '\\\\' }}" + {% include no-linenos.html content=post.content %} + "snippet": "{{ content | strip_html | strip_newlines | remove_chars | escape | truncate: 300 | replace: '\', '\\\\' }}" }{% unless forloop.last %},{% endunless %} {% endfor %} ]- {% assign _content = post.content %} - {% include no-linenos.html %} - {{ _content | markdownify | strip_html | truncate: 200 }} + {% include no-linenos.html content=post.content %} + {{ content | markdownify | strip_html | truncate: 200 }}