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

allow to toggle Flag and update libsass #14

Merged
merged 5 commits into from
Jan 25, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ lektor plugins add lektor-scss
Or by hand, adding the plugin to the packages section in your lektorproject file:
```ini
[packages]
lektor-scss = 1.4.2
lektor-scss = 1.5.0
```
Usage
------
Expand Down Expand Up @@ -60,6 +60,7 @@ The Plugin has the following settings you can adjust to your needs:
|source_comments|False | whether to add comments about source lines |
|precision |5 | precision for numbers |
|include_paths | |If you want to include SASS libraries from a different directory, libsass's compile function has a parameter called `include_paths` to add those directories to the search path. |
|use_compile_flag|True | If True the flag '-scss' is needed. Otherwise not. |


An example file with the default config can be found at ``configs/scss.ini``. For every parameter that is not specified in the config file the default value is used by the plugin.
Expand Down
1 change: 1 addition & 0 deletions configs/scss.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use_compile_flag = True
source_dir = assets/scss/
output_dir = assets/css/
output_style = compressed
Expand Down
6 changes: 5 additions & 1 deletion lektor_scss.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class scssPlugin(Plugin):
def __init__(self, *args, **kwargs):
Plugin.__init__(self, *args, **kwargs)
config = self.get_config()
self.use_compile_flag = config.get('use_compile_flag', 'True')
self.source_dir = config.get('source_dir', 'assets/scss/')
self.output_dir = config.get('output_dir', 'assets/css/')
self.output_style = config.get('output_style', 'compressed')
Expand All @@ -39,7 +40,10 @@ def __init__(self, *args, **kwargs):
self.run_watcher = False

def is_enabled(self, build_flags):
return bool(build_flags.get(COMPILE_FLAG))
if self.use_compile_flag == 'True' or self.use_compile_flag == 'true' or self.use_compile_flag == '1' or self.use_compile_flag == 'yes':
return bool(build_flags.get(COMPILE_FLAG))
else:
return True

def find_dependencies(self, target):
dependencies = [target]
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
packages=find_packages(),
py_modules=['lektor_scss'],
url='https://github.com/chaos-bodensee/lektor-scss.git',
version='1.4.2',
version='1.5.0',
install_requires = [
"libsass==0.22.0", "termcolor",
"libsass==0.23.0", "termcolor",
],
classifiers=[
"Development Status :: 5 - Production/Stable",
Expand Down