Skip to content

Commit d5fb123

Browse files
committed
[MOD] Update compress due to Liquid errors [FIX] Liquid errors in masthead [FIX] baseurl in local configuration now works
1 parent 4e80daa commit d5fb123

File tree

7 files changed

+19
-22
lines changed

7 files changed

+19
-22
lines changed

Gemfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
source 'https://rubygems.org'
22

33
# for some reason omitting the version defaults to 0
4-
gem 'github-pages', '>= 96'
5-
gem 'pygments.rb'
4+
gem 'github-pages', '>= 98'
65

76
# http://jekyllrb.com/docs/windows/#auto-regeneration
87
# for --watch to work on Windows

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ me@website$ bundle install # takes about 5 minutes
2222
```
2323

2424
In case of `SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed` follow [these instructions](https://gist.github.com/luislavena/f064211759ee0f806c88).
25+
If there's the same SSL issue, for example when using `jekyll-gist`, then [try this](https://gist.github.com/fnichol/867550#the-manual-way-boring).
2526

2627

2728
## Run

_config.yml

+2
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,9 @@ sass:
191191
compress_html:
192192
clippings: all
193193
comments: ["<!-- ", " -->"]
194+
startings: []
194195
endings: all
196+
blanklines: false
195197
profile: false
196198
ignore:
197199
envs: [development]

_config_dev.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77
url: 'http://localhost:4000'
88

99
# Make sure the site is ready to be served in a subfolder with a simple config change
10-
# `baseurl` is broken in Jekyll 3.x, fixed in Jekyll 3.2.0
11-
# waiting for https://github.com/jekyll/jekyll/pull/4953 to be released to pages-gem
12-
#baseurl: '/dev'
13-
#urlimg: '/dev/images/'
10+
baseurl: '/dev'
11+
urlimg: '/dev/images/'
1412

1513
# Need to be unsafe for {{ var | debug }} plugin
1614
safe: false

_config_local.yml

+6
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,9 @@ url: 'http://localhost:4000'
1010
# Disable when not in production
1111
google_analytics_tracking_id: false
1212
disqus_shortname: false
13+
14+
liquid:
15+
# :lax acts like liquid 2.5 and silently ignores malformed tags in most cases.
16+
# :warn is the default and will give deprecation warnings when invalid syntax is used.
17+
# :strict will enforce correct syntax.
18+
error_mode: strict

_includes/masthead.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h1 id="print-logo" class="print-only">
3333
{% include masthead-breadcrumbs.html %}
3434
{% endif %}
3535

36-
{% if page.header.caption_url && page.header.caption %}
36+
{% if page.header.caption_url and page.header.caption %}
3737
<div class="masthead-caption">
3838
<a href="{{ page.header.caption_url }}">{{ page.header.caption }}</a>
3939
</div>
@@ -61,7 +61,7 @@ <h1 id="print-logo" class="print-only">
6161
{% include masthead-breadcrumbs.html %}
6262
{% endif %}
6363

64-
{% if page.header.caption_url && page.header.caption %}
64+
{% if page.header.caption_url and page.header.caption %}
6565
<div class="masthead-caption">
6666
<a href="{{ page.header.caption_url }}">{{ page.header.caption }}</a>
6767
</div>
@@ -89,7 +89,7 @@ <h1 id="print-logo" class="print-only">
8989
{% include masthead-breadcrumbs.html %}
9090
{% endif %}
9191

92-
{% if page.header.caption_url && page.header.caption %}
92+
{% if page.header.caption_url and page.header.caption %}
9393
<div class="masthead-caption">
9494
<a href="{{ page.header.caption_url }}">{{ page.header.caption }}</a>
9595
</div>
@@ -117,7 +117,7 @@ <h1 id="print-logo" class="print-only">
117117
{% include masthead-breadcrumbs.html %}
118118
{% endif %}
119119

120-
{% if page.header.caption_url && page.header.caption %}
120+
{% if page.header.caption_url and page.header.caption %}
121121
<div class="masthead-caption">
122122
<a href="{{ page.header.caption_url }}">{{ page.header.caption }}</a>
123123
</div>

_layouts/compress.html

+3-12
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
11
---
22
# Jekyll layout that compresses HTML
3-
# v1.3.0
3+
# v3.0.2
44
# http://jch.penibelst.de/
55
# © 2014–2015 Anatol Broder
66
# MIT License
77
---
88

9-
{% if site.compress_html.ignore.envs contains jekyll.environment %}{{ content }}{% else %}{% capture _content %}{{ content }}{% endcapture %}{% assign _profile = site.compress_html.profile or site.compress_html.debugging %}{% if site.compress_html.endings == "all" %}{% assign _endings = "html head body li dt dd p rt rp optgroup option colgroup caption thead tbody tfoot tr td th" | split: " " %}{% else %}{% assign _endings = site.compress_html.endings %}{% endif %}{% for _element in _endings %}{% capture _end %}</{{ _element }}>{% endcapture %}{% assign _content = _content | remove: _end %}{% endfor %}{% if _profile and _endings %}{% assign _profile_endings = _content | size | plus: 1 %}{% endif %}{% assign _pre_befores = _content | split: "<pre" %}{% assign _content = "" %}{% for _pre_before in _pre_befores %}{% assign _pres = _pre_before | split: "</pre>" %}{% case _pres.size %}{% when 2 %}{% capture _content %}{{ _content }}<pre{{ _pres.first }}</pre>{{ _pres.last | split: " " | join: " " }}{% endcapture %}{% when 1 %}{% capture _content %}{{ _content }}{{ _pres.last | split: " " | join: " " }}{% endcapture %}{% endcase %}{% endfor %}{% if _profile %}{% assign _profile_collapse = _content | size | plus: 1 %}{% endif %}{% 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 %}{% if _profile %}{% assign _profile_comments = _content | size | plus: 1 %}{% endif %}{% endif %}{% 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 = " <e;<e; </e>;</e>;</e> ;</e>" | replace: "e", _element | split: ";" %}{% assign _content = _content | replace: _edges[0], _edges[1] | replace: _edges[2], _edges[3] | replace: _edges[4], _edges[5] %}{% endfor %}{% if _profile and _clippings %}{% assign _profile_clippings = _content | size | plus: 1 %}{% endif %}{{ _content }}{% if _profile %}
10-
<table id="compress_html_profile_{{ site.time | date: "%Y%m%d" }}" class="compress_html_profile">
11-
<thead>
12-
<tr><td>Step<td>Bytes
13-
<tbody>
14-
<tr><td>raw<td>{{ content | size }}{% if _profile_endings %}
15-
<tr><td>endings<td>{{ _profile_endings }}{% endif %}{% if _profile_collapse %}
16-
<tr><td>collapse<td>{{ _profile_collapse }}{% endif %}{% if _profile_comments %}
17-
<tr><td>comments<td>{{ _profile_comments }}{% endif %}{% if _profile_clippings %}
18-
<tr><td>clippings<td>{{ _profile_clippings }}{% endif %}
19-
</table>{% endif %}{% endif %}
9+
{% capture _LINE_FEED %}
10+
{% endcapture %}{% if site.compress_html.ignore.envs contains jekyll.environment %}{{ content }}{% else %}{% capture _content %}{{ content }}{% endcapture %}{% assign _profile = site.compress_html.profile %}{% if site.compress_html.endings == "all" %}{% assign _endings = "html head body li dt dd p rt rp optgroup option colgroup caption thead tbody tfoot tr td th" | split: " " %}{% else %}{% assign _endings = site.compress_html.endings %}{% endif %}{% for _element in _endings %}{% capture _end %}</{{ _element }}>{% endcapture %}{% assign _content = _content | remove: _end %}{% endfor %}{% if _profile and _endings %}{% assign _profile_endings = _content | size | plus: 1 %}{% endif %}{% for _element in site.compress_html.startings %}{% capture _start %}<{{ _element }}>{% endcapture %}{% assign _content = _content | remove: _start %}{% endfor %}{% if _profile and site.compress_html.startings %}{% assign _profile_startings = _content | size | plus: 1 %}{% endif %}{% if site.compress_html.comments == "all" %}{% assign _comments = "<!-- -->" | split: " " %}{% else %}{% assign _comments = site.compress_html.comments %}{% endif %}{% if _comments.size == 2 %}{% capture _comment_befores %}.{{ _content }}{% endcapture %}{% assign _comment_befores = _comment_befores | split: _comments.first %}{% for _comment_before in _comment_befores %}{% if forloop.first %}{% continue %}{% endif %}{% capture _comment_outside %}{% if _carry %}{{ _comments.first }}{% endif %}{{ _comment_before }}{% endcapture %}{% capture _comment %}{% unless _carry %}{{ _comments.first }}{% endunless %}{{ _comment_outside | split: _comments.last | first }}{% if _comment_outside contains _comments.last %}{{ _comments.last }}{% assign _carry = false %}{% else %}{% assign _carry = true %}{% endif %}{% endcapture %}{% assign _content = _content | remove_first: _comment %}{% endfor %}{% if _profile %}{% assign _profile_comments = _content | size | plus: 1 %}{% endif %}{% endif %}{% assign _pre_befores = _content | split: "<pre" %}{% assign _content = "" %}{% for _pre_before in _pre_befores %}{% assign _pres = _pre_before | split: "</pre>" %}{% assign _pres_after = "" %}{% if _pres.size != 0 %}{% if site.compress_html.blanklines %}{% assign _lines = _pres.last | split: _LINE_FEED %}{% capture _pres_after %}{% for _line in _lines %}{% assign _trimmed = _line | split: " " | join: " " %}{% if _trimmed != empty or forloop.last %}{% unless forloop.first %}{{ _LINE_FEED }}{% endunless %}{{ _line }}{% endif %}{% endfor %}{% endcapture %}{% else %}{% assign _pres_after = _pres.last | split: " " | join: " " %}{% endif %}{% endif %}{% capture _content %}{{ _content }}{% if _pre_before contains "</pre>" %}<pre{{ _pres.first }}</pre>{% endif %}{% unless _pre_before contains "</pre>" and _pres.size == 1 %}{{ _pres_after }}{% endunless %}{% endcapture %}{% endfor %}{% if _profile %}{% assign _profile_collapse = _content | size | plus: 1 %}{% endif %}{% 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 = " <e;<e; </e>;</e>;</e> ;</e>" | replace: "e", _element | split: ";" %}{% assign _content = _content | replace: _edges[0], _edges[1] | replace: _edges[2], _edges[3] | replace: _edges[4], _edges[5] %}{% endfor %}{% if _profile and _clippings %}{% assign _profile_clippings = _content | size | plus: 1 %}{% endif %}{{ _content }}{% if _profile %} <table id="compress_html_profile_{{ site.time | date: "%Y%m%d" }}" class="compress_html_profile"> <thead> <tr> <td>Step <td>Bytes <tbody> <tr> <td>raw <td>{{ content | size }}{% if _profile_endings %} <tr> <td>endings <td>{{ _profile_endings }}{% endif %}{% if _profile_startings %} <tr> <td>startings <td>{{ _profile_startings }}{% endif %}{% if _profile_comments %} <tr> <td>comments <td>{{ _profile_comments }}{% endif %}{% if _profile_collapse %} <tr> <td>collapse <td>{{ _profile_collapse }}{% endif %}{% if _profile_clippings %} <tr> <td>clippings <td>{{ _profile_clippings }}{% endif %} </table>{% endif %}{% endif %}

0 commit comments

Comments
 (0)