File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ {%- comment -%}
2+
3+ Get the post's description or body content.
4+
5+ Arguments:
6+ full_text: If true, return the full content. Default is false.
7+ max_length: The maximum length of the returned content. Default is 200.
8+ {%- endcomment -%}
9+
10+ {%- if post.description and include.full_text != true -%}
11+ {{- post.description -}}
12+ {%- else -%}
13+ {%- comment -%} Remove the line numbers from the code snippet. {%- endcomment -%}
14+
15+ {%- assign content = post.content -%}
16+
17+ {%- if content contains '< td class ="rouge-gutter gl "> < pre class ="lineno "> ' -%}
18+ {%- assign content = content
19+ | replace: '< td class ="rouge-gutter gl "> < pre class ="lineno "> ',
20+ '<!-- <td class="rouge-gutter gl"><pre class="lineno">'
21+ -%}
22+ {%- assign content = content | replace: '</td><td class="rouge-code">', '</td> --> < td class ="rouge-code "> ' -%}
23+ {%- endif -%}
24+
25+ {%- assign content = content
26+ | markdownify
27+ | strip_html
28+ | newline_to_br
29+ | replace: '< br /> ', ' '
30+ | strip_newlines
31+ | strip
32+ -%}
33+
34+ {%- unless include.full_text -%}
35+ {%- assign max_length = include.max_length | default: 200 -%}
36+ {%- assign content = content | truncate: max_length -%}
37+ {%- endunless -%}
38+
39+ {{- content -}}
40+ {%- endif -%}
You can’t perform that action at this time.
0 commit comments