1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-18 05:41:31 +00:00

Code improvement.

Passing parameters to includes
This commit is contained in:
Cotes Chung
2020-07-22 21:41:49 +08:00
parent 562fcd4fd8
commit 209058b84a
7 changed files with 28 additions and 24 deletions

View File

@@ -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 '<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 = 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 %}