Skip to content

Commit

Permalink
Add quiet_deps and verbose option (#143)
Browse files Browse the repository at this point in the history
Merge pull request 143
  • Loading branch information
ntkme committed Oct 16, 2022
1 parent de3539e commit 816f53c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,22 @@ Available options are:

Defaults to `always`.

* **`quiet_deps`**

If this option is set to `true`, Sass won’t print warnings that are caused by dependencies.
A “dependency” is defined as any file that’s loaded through `sass_dir` or `load_paths`.
Stylesheets that are imported relative to the entrypoint are not considered dependencies.

Defaults to `false`.

* **`verbose`**

By default, Dart Sass will print only five instances of the same deprecation warning per
compilation to avoid deluging users in console noise. If you set `verbose` to `true`, it will
instead print every deprecation warning it encounters.

Defaults to `false`.

## Migrate from 2.x to 3.x

Classic GitHub Pages experience still uses [1.x version of jekyll-sass-converter](https://pages.github.com/versions/).
Expand Down
12 changes: 12 additions & 0 deletions lib/jekyll/converters/scss.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ def sass_configs
:style => sass_style,
:syntax => syntax,
:url => sass_file_url,
:quiet_deps => quiet_deps_option,
:verbose => verbose_option,
}
end

Expand Down Expand Up @@ -264,6 +266,16 @@ def site_source
def file_url_from_path(path)
Addressable::URI.encode("file://#{path.start_with?("/") ? "" : "/"}#{path}")
end

# Returns the value of the `quiet_deps`-option chosen by the user or 'false' by default.
def quiet_deps_option
!!jekyll_sass_configuration.fetch("quiet_deps", false)
end

# Returns the value of the `verbose`-option chosen by the user or 'false' by default.
def verbose_option
!!jekyll_sass_configuration.fetch("verbose", false)
end
end
end
end

0 comments on commit 816f53c

Please sign in to comment.