Skip to content

Commit b61d9ff

Browse files
committed
fix(blog) Get rid of extraneous white spaces caused by liquid
1 parent 2fc0d3b commit b61d9ff

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

_blog-src/_layouts/post.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ <h1 style="color: #666; font-weight: bold" class="post-title section-header">{{
1717
<p class="bg-warning"
1818
style="margin-top:15px; padding: 10px;">
1919
Note: A newer revision of this blogpost for <b>apiman 1.2.x</b> can be found <a href="
20+
{% strip %}
2021
{% for post in site.posts %}
2122
{% assign postName = post.path | find_post_by_path %}
2223
{% if postName == page.newUrl %}
2324
{{ site.url }}{{ site.baseurl }}{{ post.url }}
2425
{% endif %}
2526
{% endfor %}
27+
{% endstrip %}
2628
">here</a>. This version was written for <b>apiman 1.1.x</b>.
2729
</p>
2830
{% endif %}

_blog-src/_plugins/strip.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#https://github.com/aucor/jekyll-plugins/blob/master/LICENCE
2+
# Replaces multiple newlines and whitespace
3+
# between them with one newline
4+
5+
module Jekyll
6+
class StripTag < Liquid::Block
7+
8+
def render(context)
9+
super.gsub /\n\s*\n/, "\n"
10+
end
11+
12+
end
13+
end
14+
15+
Liquid::Template.register_tag('strip', Jekyll::StripTag)

0 commit comments

Comments
 (0)