diff --git a/_layouts/compress.html b/_layouts/compress.html index 81c14e5..2f24ced 100644 --- a/_layouts/compress.html +++ b/_layouts/compress.html @@ -1,61 +1,11 @@ --- # # Jekyll layout that compresses HTML -# v0.2.0 -# https://github.com/penibelst/jekyll-compress-html +# v1.1.1 +# http://jch.penibelst.de/ +# © 2015 Anatol Broder +# MIT License # -compress: - elements: - # Root - - html - # Metadata content - - head - - title - - base - - link - - meta - - style - # Sections - - body - - article - - section - - nav - - aside - - h1 - - h2 - - h3 - - h4 - - h5 - - h6 - - hgroup - - header - - footer - - address - # Grouping content except `pre` - - p - - hr - - blockquote - - ol - - ul - - li - - dl - - dt - - dd - - figure - - figcaption - - main - - div - # Tabular data - - table - - caption - - colgroup - - col - - tbody - - thead - - tfoot - - tr - - td - - th --- -{% assign _pres = content | split: '' %}{% if _pre2.size == 2 %}{% endif %}{% assign _second = _pre2.last | split: ' ' | join: ' ' %}{% for _element in page.compress.elements %}{% assign _edge = ' {% endcapture %}{% assign _content = _content | remove: _end %}{% endfor %}{% if site.compress_html.comments.size == 2 %}{% assign _comment_befores = _content | split: site.compress_html.comments.first %}{% for _comment_before in _comment_befores %}{% assign _comment_content = _comment_before | split: site.compress_html.comments.last | first %}{% if _comment_content %}{% capture _comment %}{{ site.compress_html.comments.first }}{{ _comment_content }}{{ site.compress_html.comments.last }}{% endcapture %}{% assign _content = _content | remove: _comment %}{% endif %}{% endfor %}{% endif %}{% assign _pre_befores = _content | split: "" %}{% case _pres.size %}{% when 2 %}{% capture _content %}{{ _content }}{{ _pres.last | split: " " | join: " " }}{% endcapture %}{% when 1 %}{% capture _content %}{{ _content }}{{ _pres.last | split: " " | join: " " }}{% endcapture %}{% endcase %}{% endfor %}{% if site.compress_html.clippings == "all" %}{% assign _clippings = "html head title base link meta style body article section nav aside h1 h2 h3 h4 h5 h6 hgroup header footer address p hr blockquote ol ul li dl dt dd figure figcaption main div table caption colgroup col tbody thead tfoot tr td th" | split: " " %}{% else %}{% assign _clippings = site.compress_html.clippings %}{% endif %}{% for _element in _clippings %}{% assign _edges = " ;; ;" | replace: "e", _element | split: ";" %}{% assign _content = _content | replace: _edges[0], _edges[1] | replace: _edges[2], _edges[3] | replace: _edges[4], _edges[5] %}{% endfor %}{{ _content }}{% endif %}