/
customhighlight.html
43 lines (39 loc) · 1.19 KB
/
customhighlight.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{% unless GLOBAL_INCLUDED contains "|customhighlight_assets|"%}
{% assign GLOBAL_INCLUDED = GLOBAL_INCLUDED | append: "|customhighlight_assets|" %}
<link rel="stylesheet" href="/assets/css/customhighlight.css" />
{% endunless %}
{%- capture customhighlight_id -%}
customhighlight-{%-increment customhighlightCounter -%}
{%- endcapture -%}
{% include collapsible.html
for=customhighlight_id
labelClasses="highlight"
labelContent=include.caption
collapsed=include.collapsed
%}
{%- capture content -%}
{%- if include.content -%}
{%- if include.noStrip | default : false -%}
{{ include.content }}
{%- else -%}
{{ include.content | strip }}
{%- endif -%}
{%- else -%}
{%- include_relative {{ include.dir | default: page.customhighlight.dir }}/{{include.file}} -%}
{%- endif -%}
{%- endcapture -%}
```{{include.ext | default: (include.file | split: '.' | last | default: "") }}
{{ content }}
```
{: #{{customhighlight_id}}
{% if include.wrap != nil -%}
{%- if include.wrap -%}
.wrap-code
{%- endif -%}
{%- elsif page.customhighlight.wrap -%}
.wrap-code
{%- endif -%}
}
{% comment %}
vim: filetype=liquid
{% endcomment %}