fmartingr.com/packages/sassify/lektor_sassify.py
Felipe Martin cba44a38fc
Simple lektor sass plugin
- Using python's libsass to compile the final CSS
Closes #4
2020-11-30 18:13:36 +01:00

22 lines
605 B
Python

import sass
from lektor.pluginsystem import Plugin
from werkzeug.utils import cached_property
class SassifyPlugin(Plugin):
name = "Sassify"
description = "Sassify"
def on_before_build_all(self, builder, **extra):
sass.compile(
dirname=(
self.config["sassify"]["src_path"],
self.config["sassify"]["dest_path"],
),
output_style="compressed",
)
@cached_property
def config(self):
conf = self.get_config()
return {section: conf.section_as_dict(section) for section in conf.sections()}