Skip to content

Commit

Permalink
Add shortcut for all ignoring environments
Browse files Browse the repository at this point in the history
  • Loading branch information
krystof-k committed Sep 29, 2018
1 parent 13b7194 commit 5d6b0de
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/compress.liquid
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% endcapture %}

{% if site.compress_html.ignore.envs contains jekyll.environment %}
{% if site.compress_html.ignore.envs contains jekyll.environment or site.compress_html.ignore.envs == "all" %}
{{ content }}
{% else %}

Expand Down
3 changes: 3 additions & 0 deletions test/_config_ignore_all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
compress_html:
ignore:
envs: all
7 changes: 7 additions & 0 deletions test/test_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,13 @@ def test_ignore
ENV["JEKYLL_ENV"] = nil
end

def test_ignore_all
ENV["JEKYLL_ENV"] = "production"
jekyll_build ["_config.yml", "_config_ignore_all.yml"]
assert_dir "ignore"
ENV["JEKYLL_ENV"] = nil
end

def test_startings
jekyll_build ["_config.yml", "_startings.yml"]
assert_dir "startings"
Expand Down

0 comments on commit 5d6b0de

Please # to comment.