Skip to content

Commit

Permalink
Merge pull request #14 from chaos-bodensee/flag
Browse files Browse the repository at this point in the history
allow to toggle Flag and update libsass
  • Loading branch information
DO1JLR authored Jan 25, 2024
2 parents c44ef22 + 35a653e commit 8f19689
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
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

0 comments on commit 8f19689

Please sign in to comment.