mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-12-18 05:41:31 +00:00
Add code block header
This commit is contained in:
@@ -113,8 +113,13 @@
|
||||
{% assign _new_content = _snippet %}
|
||||
{% else %}
|
||||
{% assign _lang = _snippet | split: ' ' | first %}
|
||||
{% capture _tag_head %}<div lang="{{_lang}}" class="language-{% endcapture %}
|
||||
{% assign _new_content = _new_content | append: _tag_head | append: _snippet %}
|
||||
{% capture _tag_head %}<div class="language-{% endcapture %}
|
||||
{% assign _replacement = '-rouge"><div class="code-header" data-lang="'
|
||||
| append: _lang
|
||||
| append: '"></div><div class="highlight">'
|
||||
%}
|
||||
{% capture _tag_tail %}{{ _snippet | replace: '-rouge"><div class="highlight">', _replacement }}{% endcapture %}
|
||||
{% assign _new_content = _new_content | append: _tag_head | append: _tag_tail %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user