Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add quiet_deps and verbose option #143

Merged
merged 2 commits into from
Oct 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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