How to suppress blank line in Jekyll?

后端 未结 5 2060
梦谈多话
梦谈多话 2021-02-04 00:49

I use GitHub Pages for my blog, and am running into a problem with Jekyll. My post.html has a block like this:

{%    for testpost in site.posts   %}
{%                  


        
5条回答
  •  萌比男神i
    2021-02-04 01:22

    Actually there is a new solution for this problem which works without any plugin.

    A Jekyll layout that compresses HTML. At a glance:

    • removes unnecessary whitespace;
    • removes optional end tags;
    • removes optional start tags;
    • removes comments;
    • preserves whitespace within
      ;
    • GitHub Pages compatible;
    • ignores development environments;
    • configurable affected elements;
    • profile mode;
    • automatically tested.

    http://jch.penibelst.de/

    If you - for some reason - do not want to use this here is a nice article, which describes some workarounds: Compressing Liquid generated code - sylvain durand

提交回复
热议问题